3
votes

We use iframe to embed YouTube video to our web site.

I embedded <iframe id='player' src="https://www.youtube.com/embed/my-youtube-video-id" frameborder="0" allowfullscreen></iframe>, to my site. The code works fine in most browsers, but not IE8 both Windows 7 or Windows XP (I haven't tested yet, but IE9 may have same problem). The video box just displays as black content.

And I also captured an JavaScript error from IE8

Message: Expected identifier, string or number
Line: 8
Char: 79
Code: 0
URI: http://www.youtube.com/embed/my-youtube-video-id

Then I opened the page generated by YouTube, the codes around that position is yt.setConfig({'POST_MESSAGE_ORIGIN': "*",'EVENT_ID': "my-youtube-video-id",});, char 79 is my-youtube-video-id. I remember IE would not like to take a JSON ended with a comma, is that so?

2

2 Answers

5
votes

I'm having the same issue. This is a bug recently introduced by youtube which affects IE version 7, and IE version 8 compatibility mode. It looks like there may be a few workarounds but probably the safest answer is to fall back to the older object/embed code.

See this thread for more info:

http://productforums.google.com/forum/#!topic/youtube/05jaHASZ1Mo

1
votes

I had the same problem and i solved this using the following Steps.

  1. Download and Install Latest adobe Flash player from http://get.adobe.com/flashplayer/

  2. Click on " Tools - compatability View setting - check the first two check boxes (include update sites lists from microsoft and Display intranet sites in compatability view)

thats all

Muhammad Amjad iqbal Pakistan 00923009124562