Youtube Iframe API not working in Internet Explorer (11)

前端 未结 2 2009
后悔当初
后悔当初 2020-12-19 01:44

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

相关标签:
2条回答
  • 2020-12-19 01:53

    I ran into this same issue where YouTube Player API events would not fire on IE.

    I fixed it by loading the source over SSL.

    Before (Worked in Chrome, FF, Safari... NOT IE 10/11)

    var tag = document.createElement('script');
    tag.src = "http://www.youtube.com/iframe_api";
    

    After (Works in IE10+)

    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    
    0 讨论(0)
  • 2020-12-19 01:58

    I was able to reproduce in 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.

    0 讨论(0)
提交回复
热议问题