Jump to content

W3School's YouTube embed method crashing IE?


L.Adlon

Recommended Posts

Hello again...

 

So, I used the <iframe> method of embedding YouTube videos on a webpage, and that worked great offline, but now I'm testing my site online, and I've got problems.

 

Works just great in Firefox, but Internet Explorer is giving me all kinds of grief.

 

The YouTube interface and the thumbnail/still video image seems to appear fine, and when I click the video thumbnail/image, it seems to start loading (if that grey bar I'm seeing on the otherwise black frame is the loading bar)... but then it just sits there, and eventually IE will say that the site is not responding.

 

<sarcasm> Golly, I love embedding video more than anything in the world! </scarcasm>

 

Any theories as to what is happening?

 

I only need that one line of code, right?

<iframe width="640" height="480" src="http://www.youtube.com/watch?v=yN1p8BLLO9s?hl=en_US&version=3&rel=0"></iframe> 

There's no support files needed or anything, right?

 

 

[Additional note] I just tried using the Try It page from w3schools (of their YouTube video code), and it too did the same thing... Interface and frame appear... You click on it, and the screen goes black, and nothing else happens. The <embed> method (as opposed to <iframe> one) didn't even show the interface or frame... just a white screen with a square icon in the top left corner. Something getting blocked?

Edited by L.Adlon
Link to comment
Share on other sites

Which doctype and browser? html5 should work as it now supports embed for IE newer version, while other doctypes and IE older versions would use a mixture of object with embed within it, so IE would use <object>, while other browsers use <embed>.

Link to comment
Share on other sites

Internet Explorer is giving me the trouble. Firefox works fine. Haven't got it tested on Safari yet.

 

The DOCTYPE is 4.01.

 

Does the <iframe> method only work with HTML5?

 

I was considering using the <embed> method that w3schools also suggests on that page, but I'd assume that it wouldn't work in IE that way.

 

The method that YouTube itself offers doesn't work. The w3schools <iframe> method works fine with Firefox, even at HTML4.01. Just IE that is giving me trouble.

Link to comment
Share on other sites

I just tried iframe in IE10-11 and it works, anything below IE10 won't work, apparently it is a security setting for activeX being disabled that prevent youtube playback in IE9, and it seems youtube no longer support IE6,7 and probably 8 by now.

Link to comment
Share on other sites

Odd... I'm using IE11 to test it. Even the w3schools Try It samples weren't working on it.

 

Granted, I'm not using IE11, so nothing has been set up on it. Maybe some setting is off. I was getting bombarded by alert messages and stuff, about cookies, activeX, etc.

 

The initial 'link' seems to work, since the interface and still image show up.

 

I was reading an interesting thread (although old... post from 2008-2013), where they were trying to get it to work as well. The earlier posts were complaining that even after 8-9 years, IE still wasn't properly supporting HTML4.

 

After a lot of experimentation (and finding solutions that would then not work in other versions, etc), they came up with this:

 

 

<object width="346" height="280" type="application/x-shockwave-flash" data="http://www.youtube.com/watch?v=redacted"><param name="movie" value="http://www.youtube.com/watch?v=redacted"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param></object>

 

A later post revealed that one of the solutions that previously worked, now didn't... and that including something like the 'movie' attribute back into it made it work again. Ugh...

 

We can rebuild a human heart, but we can't get a simple method to embed a video without redundant code or multiple formats.

 

 

I'll have to get one of my friends who actually uses IE to give it a test.

 

Are there still a lot of people using IE these days? I imagine it would be less, if it wasn't the default/included browser in Windows (and a lot of people don't know about or how to install alternates).

Link to comment
Share on other sites

I just found these. Any thoughts on them?

<object width="346" height="280" type="application/x-shockwave-flash" data="http://www.youtube.com/watch?v=redacted"><param name="movie" value="http://www.youtube.com/watch?v=redacted"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param></object>

...and this one that is supposedly 'valid' when you run it through a validator:

<div>  <object    type="application/x-shockwave-flash"    data="http://www.youtube.com/watch?v=J_DV9b0x7v4"    width="425"    height="355">    <param name="movie" value="http://www.youtube.com/watch?v=J_DV9b0x7v4">  </object></div>

(Again, I'm asking from a HTML4 page standpoint)

Edited by L.Adlon
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...