Если на моей html-странице есть Flex SWC, и Flex SWC содержит проигрыватель Flex 4 videoDisplay, который имеет опцию для полноэкранного режима.Как мне сделать полноэкранный режим работы.
Потому что, когда я нажимаю на полноэкранную кнопку для видео просмотра, я получаю сообщение об ошибке:
SecurityError: Error #2152: Full screen mode is not allowed.
at flash.display::Stage/set_displayState()
at flash.display::Stage/set displayState()
at spark.components::VideoPlayer/fullScreenButton_clickHandler()
Но полноэкранный вариант работает нормально, если я запускаю само приложение flex.
Мой HTML-код выглядит так:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<body onload="MM_preloadImages('assets/index_main/images/nav-features-over.gif','assets/index_main/images/nav-signup-over.gif','assets/index_main/images/nav-pricing-over.gif')">
<div align="center">
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="500" bgcolor="#C2E8F3" class="pricingBG"><div align="center">
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,1,0,0','width','1024','height','1850','src','cloud_tour','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','cloud_tour' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,1,0,0" width="1024" height="1850">
, а код Flex выглядит следующим образом:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
backgroundColor="#FFFFFF" backgroundGradientColors="[#FFFFFF, #FFFFFF]"
fontFamily="Arial" fontSize="13" width="1024" height="1850" verticalGap="20"
verticalScrollPolicy="off" horizontalScrollPolicy="off"
xmlns:controls="com.fxcomponentsWei.controls.*" xmlns:s="library://ns.adobe.com/flex/spark">
<mx:Script>
<![CDATA[
import mx.containers.Canvas;
private const VIDEO_SRC_MY_FILES:String = 'assets/index_main/videos/my_files.flv';
private const VIDEO_SRC_CALENDAR:String = 'assets/index_main/videos/calendar.flv';
private const VIDEO_SRC_PROFILE_EXPLORER:String = 'assets/index_main/videos/profile_explorer.flv';
private const VIDEO_SRC_GROUPS:String = 'assets/index_main/videos/groups.flv';
private function handlePlay(e:Event):void
{
var cvs:Canvas = e.currentTarget.parent.parent as Canvas;
var vid:VideoPlayer = cvs.getChildByName('vid') as VideoPlayer;
vid.enabled = true;
switch(e.currentTarget.data)
{ //assign vid source
case 'my_files':
vid.source = VIDEO_SRC_MY_FILES;
break;
case 'calendar':
vid.source = VIDEO_SRC_CALENDAR;
break;
case 'profile_explorer':
vid.source = VIDEO_SRC_PROFILE_EXPLORER;
break;
case 'groups':
vid.source = VIDEO_SRC_GROUPS;
break;
default:
throw new Error('invalid video request');
}
cvs.removeChild(e.currentTarget.parent); //remove play box button
}
]]>
</mx:Script>
<s:VideoDisplay name="test" id="blah" width="320" height="160"
source="assets/index_main/videos/my_files.flv"/>
<mx:Canvas width="500" height="300">
<s:VideoPlayer name="vid" width="100%" height="100%" autoPlay="true" autoRewind="true"
enabled="false"/>
<mx:Box backgroundColor="#FFFFFF" width="100%" height="100%" backgroundAlpha="0.5"
verticalAlign="middle" horizontalAlign="center">
<mx:Image source="assets/index_main/images/play-128x128.png" click="handlePlay(event)"
data="{'my_files'}" buttonMode="true" toolTip="click to play"/>
</mx:Box>
</mx:Canvas>
<mx:Text width="600">
<mx:htmlText>
<![CDATA[
<b>My Files</b>
Want the ability to access, share and manage files from wherever you happen to be, without having to invest in expensive technology or IT staff? Cloud makes it simple and affordable to store and manage all your digital content – from financial, creative and productivity documents to image, audio and video files – right from your laptop, your smartphone or any other web-enabled device.
]]>
</mx:htmlText>
</mx:Text>
<mx:Canvas width="500" height="300">
<s:VideoPlayer name="vid" width="100%" height="100%" autoPlay="true" autoRewind="true"
enabled="false"/>
<mx:Box backgroundColor="#FFFFFF" width="100%" height="100%" backgroundAlpha="0.5"
verticalAlign="middle" horizontalAlign="center">
<mx:Image source="assets/index_main/images/play-128x128.png" click="handlePlay(event)"
data="{'profile_explorer'}" buttonMode="true" toolTip="click to play"/>
</mx:Box>
</mx:Canvas>
<mx:Text width="600">
<mx:htmlText>
<![CDATA[
<b>Profile Explorer</b>
Connect other services to your profile, and keep in touch with all your friends in the Cloud and beyond. See what you're sharing with others, and what your friends are saying about you.
]]>
</mx:htmlText>
</mx:Text>
<mx:Canvas width="500" height="300">
<s:VideoPlayer name="vid" width="100%" height="100%" autoPlay="true" autoRewind="true"
enabled="false"/>
<mx:Box backgroundColor="#FFFFFF" width="100%" height="100%" backgroundAlpha="0.5"
verticalAlign="middle" horizontalAlign="center">
<mx:Image source="assets/index_main/images/play-128x128.png" click="handlePlay(event)"
data="{'calendar'}" buttonMode="true" toolTip="click to play"/>
</mx:Box>
</mx:Canvas>
<mx:Text width="600">
<mx:htmlText>
<![CDATA[
<b>Calendar</b>
Organizing your schedule shouldn't be a burden. With the Cloud Calendar, it's easy to keep track of life's important events all in one place. You can invite other people to events on your calendar. Guests can RSVP to your events by email or via Cloud Calendar or Access your calendar however and whenever you want by syncing events with Microsoft Outlook, Apple iCal, Mozilla Sunbird or your smartphone.
]]>
</mx:htmlText>
</mx:Text>
<mx:Canvas width="500" height="300">
<s:VideoPlayer name="vid" width="100%" height="100%" autoPlay="true" autoRewind="true"
enabled="false"/>
<mx:Box backgroundColor="#FFFFFF" width="100%" height="100%" backgroundAlpha="0.5"
verticalAlign="middle" horizontalAlign="center">
<mx:Image source="assets/index_main/images/play-128x128.png" click="handlePlay(event)"
data="{'groups'}" buttonMode="true" toolTip="click to play"/>
</mx:Box>
</mx:Canvas>
<mx:Text width="600">
<mx:htmlText>
<![CDATA[
<b>Groups</b>
Connect with the people you need to get the job done. Unlike other tools, Cloud Groups lets you work with anyone, whether they’re inside or outside the company firewall. Invite them into Cloud Groups to work together on projects, share files, assign tasks or catch up in real-time.
]]>
</mx:htmlText>
</mx:Text>
</mx:Application>
Спасибо и С уважением ~Z ~