开发者

How to force playing a video in fullscreen?

I need to know how it's possible to force playing a video in fullscreen mode?

Fullscreen is in most of the cases a function by ActionScript and is triggerd w开发者_Python百科ith a user action, like mouse click or double click.

The other way is to force playing a video in the mobile devices native player, like youtube does. I have no clue how this approach is realized.

Hope to understand this thing a bit more clearer with your support.

chris


you can tell the Flash stage to go to fullscreen view with this command:

stage.displayState = "fullScreen";

It will work in standalone mode only.

To make it work in the browsers you have to pass the "allowFullScreen" parameter with a "true" value to Flash.

To go fullscreen in mobile devices I believe you have to use the

FSCommand("fullscreen", "true"); method call.

If you are using SWFObject the you can add the allowFullScreen param easily.

SWFObject -2:

<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "400", "400", "8", "#336699");
   so.addParam("wmode", "opaque");
   so.addParam("allowScriptAccess", "sameDomain");
   so.addParam("allowFullScreen", "true");
   so.write("flashcontent");
</script>

SWFObject 2+:

<script type="text/javascript">
var wl = new Object();
wl.flashvars = {};
wl.params = {
    allowScriptAccess: "sameDomain",
    allowFullScreen: "true",
    wmode: "opaque"
};
wl.attributes = {};

swfobject.embedSWF("movie.swf", "flashcontent", "400", "400", "8", "swf/expressInstall.swf", wl.flashvars, wl.params, wl.attributes);
</script>

I hope it helps, good luck Rob

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜