Firefox“退出全屏,因为窗口插件专注于”

时间:2015-11-20 20:46:55

标签: javascript actionscript-3 flash firefox fullscreen

Firefox点击Flash后退出全屏模式。 你可以在我们的Facebook游戏上测试它:https://apps.facebook.com/upogame/ffbug.html

Firefox日志:

Exited full-screen because windowed plugin was focused.

全屏的Javascript代码:

if ((document.fullScreenElement && document.fullScreenElement !== null) ||    // alternative standard method
        (!document.mozFullScreen && !document.webkitIsFullScreen)) {
    if (document.documentElement.requestFullScreen) {
        document.documentElement.requestFullScreen();
    } else if (document.documentElement.mozRequestFullScreen) {
        document.documentElement.mozRequestFullScreen();
    } else if (document.documentElement.webkitRequestFullScreen) {
        document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
    }

} else {
    if (document.cancelFullScreen) {
        document.cancelFullScreen();
    } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
    } else if (document.webkitCancelFullScreen) {
        document.webkitCancelFullScreen();
    }
}

嵌入代码:

<script type="text/javascript">
    var swfVersionStr = "18.0.0";
    var xiSwfUrlStr = "playerProductInstall.swf";
    var flashvars = {};
    var params = {};
    params.quality = "high";
    params.bgcolor = "#B0E0FF";
    params.allowscriptaccess = "sameDomain";
    params.allowfullscreen = "true";
    params.allowFullScreenInteractive = "true";
    params.wmode = "direct";
    var attributes = {};
    attributes.id = "OOPPO";
    attributes.name = "OOPPO";
    attributes.align = "middle";
    swfobject.embedSWF(
        "secure_Ooppo.swf?"+"19", "flashContent",
        "100%", "100%",
        swfVersionStr, xiSwfUrlStr, 
        flashvars, params, attributes);
    swfobject.createCSS("#flashContent", "display:block; text-align:left;");
</script>

1 个答案:

答案 0 :(得分:1)

Firefox上针对窗口插件禁用了全屏,以防止网络钓鱼等安全问题。由于这个原因,报告并修复了This bug

在您的情况下,我相信您需要在swfobject上设置params.wmode ='transparent'或params.wmode ='opaque',以便全屏使用Firefox。