javascript - 如何从 javascript 检查 flash 对象是否处于全屏模式

标签 javascript flash fullscreen

我需要从 javascript 检查给定的 flash 对象是否处于全屏模式。我知道有 stage.displayState 属性,但如何使用 GetVariable 访问它?还是有其他方法?

谢谢。

附言如果您知道如何使用任何其他语言来做到这一点,那也没关系。

最佳答案

您可能需要在 AS 中添加一个可以从 JS 层调用的函数:

// In your AS code
import flash.external.ExternalInterface;
import flash.display.StageDisplayState;

// Register a function you can call from JS
ExternalInterface.addCallback("isFullScreen", _isFullScreen);

// Returns true if fullscreen
private function _isFullScreen() :Boolean {
    return stage.displayState === StageDisplayState.FULL_SCREEN:
};

那么,你应该可以从 JS 中调用它了:

// Get a reference to the object element, change
// 'flashcontent' to the ID of your .swf in the DOM
var o = document.getElementById('flashcontent'),
    // Figure out it the player is in fullscreen mode
    isFullScreen = o.isFullScreen();
// Do something with isFullScreen value

外部接口(interface)文档 here ,舞台展示状态here .

希望对您有所帮助。干杯!

关于javascript - 如何从 javascript 检查 flash 对象是否处于全屏模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7794221/

相关文章:

javascript - PHP trait 的 nodejs 等价物是什么

javascript - MUI - 如何以命令式/编程方式打开对话框

javascript - 在 Chrome 中弹出期间不会出现蓝色菜单

Flash 开发 - 发布

node.js - 2021年Flash生命周期终止后,带有Flash Player的Electron App

javascript - 在ie9中上传得到js错误: SCRIPT5007: Object expected

javascript - 网页游戏编程使用什么语言

ios - 移动 safari 主屏幕应用程序 - 在新窗口/标签中链接

javascript - 加载 Youtube 视频时随机化时不会全屏显示

css - mediaelement.js -> 更大的按钮?