javascript - 使用 JavaScript + html5 在 Win8 商店应用程序中使用 Flash

标签 javascript html flash windows-8 windows-store-apps

我使用 JavaScript + html5 来创建 Win8 商店应用程序。我需要在我的应用程序中打开 .swf 文件。 Swf 文件在启动时从我们的服务器下载。启动后swf文件是本地的。我想知道是否可以在应用程序中嵌入闪光灯控件?我尝试过,但似乎不起作用...(也尝试过 iframe) 我尝试通过以下代码在 Metro IE 中打开 swf 文件:

> var file = 'flashobject.html';
>             Windows.ApplicationModel.Package.current.installedLocation.getFileAsync(file).then(function
> (file) {
>                 var options = new Windows.System.LauncherOptions();
>                 options.displayApplicationPicker = true;
> 
>                 Windows.System.Launcher.launchFileAsync(file, options).then(function (success) {
>                     if (success) {
>                         // Yay!
>                         console.log('Success');
>                     } else {
>                         // FROWN :(
>                         console.log('Failure');
>                     }
>                 });
>             });

此 HTML 代码:

    <body>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
            <param name="autoplay" value="false">
            <param name="movie" value="candles_Pp.swf">
            <object class="iehide" type="application/x-shockwave-flash" data="flashobject_files/candles_.swf">
                <param name="controller" value="true">
                <param name="autoplay" value="false">   
                <param name="pluginurl" value="http://get.adobe.com/flashplayer/">          
                <a href="http://www.yourwebskills.com/files/examples/candles_Pp.swf">Your browser is not able to handle this media here so use this link to play the file in an external application </a>
            </object>
        </object>
</body>

有没有办法打开swf文件,也许有任何API可以在启动时将swf转换为html。

最佳答案

用于渲染用 javascript 编写的 Win8 应用商店应用程序的 IE10 模拟器不支持任何插件。您需要将 swf 转换为可接受的 HTML5 video 格式 (.mp4) 并使用 HTML5 video 标记播放视频。

关于javascript - 使用 JavaScript + html5 在 Win8 商店应用程序中使用 Flash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14232364/

相关文章:

javascript - WebAudio setTargetAtTime : formula to convert-time constant to seconds

javascript - 从图像拖放到另一个图像上

php - 当用户更新文本框值时更新 mysql

php - 链接样式表中缺少 CSS 元素

javascript - 链接 JS 和 jQuery 文件

php - 在 PHP Web 应用程序中从网络摄像头读取条形码

javascript - Android - 向服务器询问新版本的应用程序?

html - 枚举和 View 集成的 Rails 替代品

flash - 我想显示格式为 (4x2) 的二次方程

flash - 执行时grails在 View 中显示Flash消息