jquery youtube 插件 - IE 中的视频
昨天我发布了一个关于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,所以我添加了 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 :)