swfobject 不工作?

发布于 2024-10-17 10:59:35 字数 715 浏览 6 评论 0原文

嘿伙计们, 我想知道我做错了什么。

index.html

<script src="swfobject/swfobject.js"type="text/javascript"></script>

<div class="post">
    <script type="text/javascript">

        var params = { allowScriptAccess: "always" };
        var atts = { id: "myytplayer" };
        swfobject.embedSWF("http://www.youtube.com/e/GfugtAWxooU?enablejsapi=1&playerapiid=ytplayer",
                           "ytapiplayer", "425", "356", "8", null, null, params, atts);

      </script>
</div>

我的 swfobject 文件夹与我的 index.html 位于同一目录中。为什么我什么也看不到。我已经在线测试过(不仅仅是本地)。 http://jsfiddle.net/RsJbv/

谢谢

hey guys,
i wonder what i'm doing wrong.

index.html

<script src="swfobject/swfobject.js"type="text/javascript"></script>

<div class="post">
    <script type="text/javascript">

        var params = { allowScriptAccess: "always" };
        var atts = { id: "myytplayer" };
        swfobject.embedSWF("http://www.youtube.com/e/GfugtAWxooU?enablejsapi=1&playerapiid=ytplayer",
                           "ytapiplayer", "425", "356", "8", null, null, params, atts);

      </script>
</div>

my swfobject folder is in the same directory as my index.html. Why can't i see anything. I've already tested in online (not just local). http://jsfiddle.net/RsJbv/

thank you

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

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

发布评论

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

评论(1

听风吹 2024-10-24 10:59:35

您正在通过 swfobject 动态嵌入 YouTube 视频。您需要一个 id 为 ytapiplayer 的元素来“包装”视频。基本上,您必须告诉 swfobject 在哪里加载 swf => http://jsfiddle.net/steweb/czEF9/

swfobject.embedSWF("SWFURL","elementID", "width", "height", "8", null, null, params, atts);

elementID 是 DOM 元素的 id (它必须存在);)

You are dynamically embedding a youtube video by swfobject. You need an element with id ytapiplayer that will "wrap" the video. Basically, you have to say to swfobject where to load the swf => http://jsfiddle.net/steweb/czEF9/

swfobject.embedSWF("SWFURL","elementID", "width", "height", "8", null, null, params, atts);

elementID is the id of your DOM element (it MUST exists) ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文