Question about embedding YouTube video in website.

Foir each of its videos, YouTube offers a link that you can copy and paste in order to embed that video in an html page.

The link looks like this:


<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/xWIM5xikQ6o"></param>
<embed src="http://www.youtube.com/v/xWIM5xikQ6o" 
type="application/x-shockwave-flash" width="425" 
height="350"></embed></object>

I pasted this code into an html page, and then opened the page on my computer, but when i did so the video didn’t play. The player is visible, embedded in the page, and the buttons are there to play the video, but it won’t play.

Yet when i upload the same webpage to my university webspace it plays fine.

Is there something i’m missing here? Does embedded video like this actually have to be on a server in order to play? I expected that, when i opened it on my computer, it would still stream the video.

Any help would be most appreciated.

Did you open the page in a web browser or something like a dreamweaver preview page?

I opened it in Firefox, which is my regular browser.

And it worked fine from the page that was loaded on the university webspace, but not from the local html file on my computer.

Hmm, odd. It has to be something within your browser settings. Did you try a different browser? I mean, because as long as your connected to the net and you open a browser, it should work. Unless I’m misunderstanding something here.

Curiouser and curiouser.

It works fine in Internet Explorer.

It doesn’t work at all in Opera. Won’t even show the embedded video player.

And it continues to behave the same in Firefox, showing the video player but refusing to stream the video.

I tried emptying my cache, but that didn’t help (not surew why it should really, but i thought it was worth a try).

I can only assume that it’s something to do with the way that the different browsers deal with embedded content, but i’m damned if i know what the problem is.

Might be some sort of security thing. Running it local might give it permissions that it wouldn’t have if it was running on another computer (for instance, the embedded object might be able to read/write your hard drive.)

Just speculation though.

That sounds reasonable, but i’m still not sure it explains the rather different behaviour exhibited by the three diferent browsers.

I’ve noticed something very similar with Firefox and Javascripts that I linked to from a page. It didn’t make a difference whether the script was local or on a server; Firefox simply wouldn’t access it unless it got the page itself off the server - I had to keep uploading stuff to my webspace and then testing because I couldn’t test at all with local copies.

It didn’t occur to me that this might be Firefox-specific, but I bet it’s basically the same thing. Weird quirk on the part of Firefox. Maybe one of the help forums at mozilla.org will have the answer.

Yeah, maybe i’ll give the Mozilla forums a go. It’s getting rather frustrating.

Becase different developers prioritise different potential security risks differently. So where as one might say, “Eh, might as well allow it” another might not.