SWFObject 1.5 .write(“identifier”) 在 Internet Explorer 中不起作用

发布于 2024-10-22 02:47:47 字数 674 浏览 0 评论 0原文

我正在使用 swfobject 1.5 使用 .write("indexplayer") 在我的页面上放置一个shoutcast播放器,但它在 Internet Explorer 8 中不起作用。我环顾四周,得到的唯一信息发现它是尝试将 defer="defer" 添加到 script 标记,但这不起作用。

这是我当前的代码:

<div id="indexplayer">
    <div id="player_error">FLASH / JAVASCRIPT ERROR</div>
</div>
<script type="text/javascript">
    var so = new SWFObject("/flash/scplayer.swf", "flashplayer", "280", "26", "8", "#171717");
    so.addParam("flashvars", "basic_variables_to_connect_to_shoutcast_server");
    so.addParam("wmode", "window");
    so.addParam("scale", "noscale");
    so.write("indexplayer");
</script>

I'm using swfobject 1.5 to place a shoutcast player on my page using .write("indexplayer") but it doesn't work in Internet Explorer 8. I've looked around and the only information I found on it was to try adding defer="defer" to the script tag, but this didn't work.

This is my current code:

<div id="indexplayer">
    <div id="player_error">FLASH / JAVASCRIPT ERROR</div>
</div>
<script type="text/javascript">
    var so = new SWFObject("/flash/scplayer.swf", "flashplayer", "280", "26", "8", "#171717");
    so.addParam("flashvars", "basic_variables_to_connect_to_shoutcast_server");
    so.addParam("wmode", "window");
    so.addParam("scale", "noscale");
    so.write("indexplayer");
</script>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幽梦紫曦~ 2024-10-29 02:47:47

我使用 2.2 版本并执行以下操作,在每个浏览器中都可以正常工作:

var flashvars = {
        file: 'PATH TO FILE IF THERE IS A FILE',
        autostart: true
    };
    var params = {
        allowfullscreen: true,
        allowscriptaccess: 'always',
        wmode: 'transparent'
    };
    var attributes = {};
    swfobject.embedSWF("/flash/scplayer.swf", 'ID OF THE ELEMENT TO RENDER FLASH IN', WIDTH_OF_THE_FLASH, HEIGHT_OF_THE_FLASH, "9.0.0", false, flashvars, params, attributes);

I use version 2.2 and do the following, works fine in every browser:

var flashvars = {
        file: 'PATH TO FILE IF THERE IS A FILE',
        autostart: true
    };
    var params = {
        allowfullscreen: true,
        allowscriptaccess: 'always',
        wmode: 'transparent'
    };
    var attributes = {};
    swfobject.embedSWF("/flash/scplayer.swf", 'ID OF THE ELEMENT TO RENDER FLASH IN', WIDTH_OF_THE_FLASH, HEIGHT_OF_THE_FLASH, "9.0.0", false, flashvars, params, attributes);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文