10

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

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
      }
    });
  }

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

edit: It is working fine with IE10 by the way

Marc Ster
  • 2,276
  • 6
  • 33
  • 63

2 Answers2

7

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.

Ibrahim Ulukaya
  • 12,767
  • 1
  • 33
  • 36
-2

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";
Andy Brudtkuhl
  • 3,652
  • 3
  • 27
  • 31