# Question about embedding YouTube video in website.

**URL:** <https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319>\
**Category:** Factual Questions\
**Created:** [June 27, 2006, 5:26am UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319 "2006-06-27T05:26:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)\
**Post date:** [June 27, 2006, 5:26am UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/1 "2006-06-27T05:26:37Z")

</div>

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:

```auto

<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.

---

<div class="post-metadata">

**Author:** ![diggleblop](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@diggleblop](https://boards.straightdope.com/u/diggleblop)\
**Post date:** [June 27, 2006, 5:39am UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/2 "2006-06-27T05:39:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)\
**Post date:** [June 27, 2006, 5:47am UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/3 "2006-06-27T05:47:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![diggleblop](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@diggleblop](https://boards.straightdope.com/u/diggleblop)\
**Post date:** [June 27, 2006, 5:54am UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/4 "2006-06-27T05:54:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)\
**Post date:** [June 27, 2006, 6:04am UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/5 "2006-06-27T06:04:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sage\_Rat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sage_rat/32/399_2.png) [@Sage\_Rat](https://boards.straightdope.com/u/Sage_Rat)\
**Post date:** [June 27, 2006, 8:12am UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/6 "2006-06-27T08:12:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)\
**Post date:** [June 27, 2006, 3:23pm UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/7 "2006-06-27T15:23:07Z")

</div>

> [@Sage Rat](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Excalibre](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@Excalibre](https://boards.straightdope.com/u/Excalibre)\
**Post date:** [June 27, 2006, 4:21pm UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/8 "2006-06-27T16:21:48Z")

</div>

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](http://mozilla.org) will have the answer.

---

<div class="post-metadata">

**Author:** ![mhendo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mhendo/32/3159_2.png) [@mhendo](https://boards.straightdope.com/u/mhendo)\
**Post date:** [June 27, 2006, 9:18pm UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/9 "2006-06-27T21:18:26Z")

</div>

> [@Excalibre](#):
>
> 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](http://mozilla.org) will have the answer.

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

---

<div class="post-metadata">

**Author:** ![Sage\_Rat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sage_rat/32/399_2.png) [@Sage\_Rat](https://boards.straightdope.com/u/Sage_Rat)\
**Post date:** [June 27, 2006, 10:54pm UTC](https://boards.straightdope.com/t/question-about-embedding-youtube-video-in-website/362319/10 "2006-06-27T22:54:44Z")

</div>

> [@mhendo](#):
>
> That sounds reasonable, but i’m still not sure it explains the rather different behaviour exhibited by the three diferent browsers.

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