Youtube iframe API not working in Internet Explorer (11)

Since my Youtube API code did not work, I decided to start from the beginning and tried the sample code from https://developers.google.com/youtube/iframe_api_reference?hl=de

So, I just built in the player, which should pause after 6 seconds. This is an excerpt from the sample player code.

var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '390', width: '640', videoId: 'M7lc1UVf-VE', events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); } 

It works in firefox, chrome and safari, but not in Internet Explorer (my version is 11). Auto play does not work, and pause after 6 seconds. So I think that already and onstatechange is not working. I thought the api should work IE7 + Is there another solution? Thanks you

edit: it works fine with IE10 by the way

+8
youtube-api
source share
2 answers

I was able to reproduce at http://jsfiddle.net/77PJB/3/ .

 function onPlayerReady(event) { event.target.playVideo(); } 

I filed it internally. You can write it to the public error tracker , if it is not already registered, to be notified after fixing it.

+5
source share

I ran into the same issue when YouTube Player API events did not fire in IE.

I fixed it by downloading the source via 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"; 
-one
source share

All Articles