Youtube Iframe API 在 Internet Explorer 中不起作用 (11) [英] Youtube Iframe API not working in Internet Explorer (11)
问题描述
由于我的 Youtube API 代码不起作用,我决定从头开始尝试 中的示例代码https://developers.google.com/youtube/iframe_api_reference?hl=de
Since my Youtube API code did not work i´ve decided to start from the beginning and tried the example code from https://developers.google.com/youtube/iframe_api_reference?hl=de
所以我只是嵌入了应该在 6 秒后暂停的播放器.. 这是示例播放器代码的摘录
So i just embedded the player which should pause after 6 seconds.. This is an excerpt of the example player code
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: 'M7lc1UVf-VE',
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
它可以在 firefox、chrome 和 safari 中运行,但不能在 Internet Explorer 中运行(我的版本是 11).自动播放不起作用,以及 6 秒后暂停.所以我猜 onready 和 onstatechange 不工作.. 我认为 api 应该工作 IE7+ 有解决方案吗?谢谢
It is working in firefox,chrome and safari, but not in Internet Explorer (my version is 11). The autoplay doesn´t work, as well as the pausing after 6 seconds. So i guess onready and onstatechange isn´t working.. I thought the api should work IE7+ Is there a solution yet? Thank you
顺便说一下,它在 IE10 上运行良好
edit: It is working fine with IE10 by the way
推荐答案
我能够在 http://jsfiddle.net/中重现77PJB/3/.
function onPlayerReady(event) {
event.target.playVideo();
}
我在内部提交了此文件.您可以在公共问题跟踪器中归档如果尚未提交,将在修复后通知.
I filed this internally. You can file it in public issue tracker if it's not filed already, to be notified once it's fixed.
这篇关于Youtube Iframe API 在 Internet Explorer 中不起作用 (11)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!