jquery youtube 插件 - IE 中的视频

发布于 2024-12-22 14:20:17 字数 1739 浏览 1 评论 0原文

昨天我发布了一个关于 jQuery YouTube 插件的问题。解决了这个问题后,我现在注意到使用此插件不会在 Internet Explorer 7 或 8 中加载视频。

我做了一些小调整并将代码放在 jsfiddle

我包括了 SWFObject,它说我需要它才能在 IE 中查看,但由于某种原因,它似乎没有加载视频。

有人有想法吗?

HTML

<div id="player"></div>
<div class="test">
     <p>Thank you for watching the video.</p>
     <p>Your Voucher Code is: <br /><br /><span>ABCDEFG</span></p>
</div>

JavaScript

jQuery(document).ready(function() {
  jQuery('.test').hide();
});

    jQuery("#player").tubeplayer({
    width: 600, // the width of the player
    height: 450, // the height of the player
    allowFullScreen: "true", // true by default, allow user to go full screen
    swfobjectURL: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
    loadSWFObject: true, // if you include swfobject, set to false
    initialVideo: "VIDEO_ID", // the video that is loaded into the player
    preferredQuality: "default",// preferred quality: default, small, medium, large, hd720
    onPlay: function(id){}, // after the play method is called
    autoPlay: true,
    onPause: function(){}, // after the pause method is called
    onStop: function(){}, // after the player is stopped
    onSeek: function(time){}, // after the video has been seeked to a defined point
    onMute: function(){}, // after the player is muted
    onUnMute: function(){}, // after the player is unmuted
    onPlayerEnded: function(){$('#player').hide(); $('.test').show(); }});

Yesterday I posted a question about a jQuery YouTube Plugin. Having fixed that problem, I now notice that using this plugin doesn't load the video in Internet Explorer 7 or 8.

I made some minor tweaks and put the code on jsfiddle.

I'm including the SWFObject, which it says I need to in order to view in IE, but for some reason, it doesn't seem to be loading the video.

Does anyone have an idea?

HTML

<div id="player"></div>
<div class="test">
     <p>Thank you for watching the video.</p>
     <p>Your Voucher Code is: <br /><br /><span>ABCDEFG</span></p>
</div>

JavaScript

jQuery(document).ready(function() {
  jQuery('.test').hide();
});

    jQuery("#player").tubeplayer({
    width: 600, // the width of the player
    height: 450, // the height of the player
    allowFullScreen: "true", // true by default, allow user to go full screen
    swfobjectURL: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
    loadSWFObject: true, // if you include swfobject, set to false
    initialVideo: "VIDEO_ID", // the video that is loaded into the player
    preferredQuality: "default",// preferred quality: default, small, medium, large, hd720
    onPlay: function(id){}, // after the play method is called
    autoPlay: true,
    onPause: function(){}, // after the pause method is called
    onStop: function(){}, // after the player is stopped
    onSeek: function(time){}, // after the video has been seeked to a defined point
    onMute: function(){}, // after the player is muted
    onUnMute: function(){}, // after the player is unmuted
    onPlayerEnded: function(){$('#player').hide(); $('.test').show(); }});

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

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

发布评论

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

评论(1

絕版丫頭 2024-12-29 14:20:18

好的,所以我添加了 SWFObject 2.1 并重新安装了 Flash 播放器。

现在可以在 IE7、IE8 和 IE9 中使用了,

感谢大家的帮助:)

Ok, so I included SWFObject 2.1 and re-installed Flash player.

This now works in IE7, IE8 and IE9

Thanks for everyone's help :)

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