Share

youtube thumb Don't you just hate it when you visit somebody's blog, see an embedded Youtube video, play it, and find that the player is missing the full screen button.

Yeah, this one: youtube fullscreen button.

Well, I hate it too, so please, try not to be that guy. I realize sometimes you copy the embed code wrong or, on a larger scale, you add the wrong embed code to your generic template.

Not a problem. If your Youtube embeds are missing this button, here is how you can easily fix it.

The Problem

Here's an example video that doesn't have the button (it's really good too, if you haven't seen it yet):

The fullscreen button is nowhere to be found because by default the Youtube player doesn't include it and the embed code is missing the correct pieces.

Here is the embed code for the video above without the full screen button:

<object width="425" height="344">
  <param
    name="movie"
    value="http://www.youtube.com/v/sdUUx5FdySs&hl=en_US">
  </param>
  <param
    name="allowscriptaccess"
    value="always">
  </param>
  <embed
    src="http://www.youtube.com/v/sdUUx5FdySs&hl=en_US"
    type="application/x-shockwave-flash"
    allowscriptaccess="always"
    width="425"
    height="344">
  </embed>
</object>

The Solution

Modify the code by adding the following:

  • put this after the last <param> and before the <embed>: <param name="allowFullScreen" value="true"></param>
  • add this after any parameter to <embed>: allowfullscreen="true"
  • append this to both the "value" parameter of the <param> tag with the name="movie" as well as the src parameter of the <embed> tag: &fs=1

The first 2 parameters give Flash access to go full screen. The last one instructs the Youtube player to add the full screen button.

Here is the final embed code:

<object width="425" height="344">
  <param
    name="movie"
    value="http://www.youtube.com/v/sdUUx5FdySs&hl=en_US&fs=1">
  </param>
  <param
    name="allowscriptaccess"
    value="always">
  </param>
  <param
    name="allowFullScreen"
    value="true">
  </param>
  <embed
    src="http://www.youtube.com/v/sdUUx5FdySs&hl=en_US&fs=1"
    type="application/x-shockwave-flash"
    allowscriptaccess="always"
    allowfullscreen="true"
    width="425"
    height="344">
  </embed>
</object>

Voila!

By the way, if you are wondering why you have to include both the object and embed tags, duplicating parameters left and right, well, it's to satisfy both IE and other browsers. Firefox, for example, uses the embed part, while IE uses the object one.

● ● ●

Artem Russakovskii is a San Francisco programmer, blogger, and future millionaire (that last part is in the works). Follow Artem on Twitter (@ArtemR) or subscribe to the RSS feed.

In the meantime, if you found this article useful, feel free to buy me a cup of coffee below.


  • Share/Bookmark

5 Responses to “Are Your Youtube Video Embeds Missing The Full Screen Button? Here Is How To Fix It”

    4 Comments:
  1. kobi says:

    Hey!

    I tried this solution with some youtube videos embedded in my site (hosted by google sites) and it doesn't work…
    any idea why it doesn't generate the Fullscreen button?…

    thank's in advance,
    Kobi.

  2. truffotti says:

    Hi Artem,

    I tried to apply your solution to a YouTube custom player that doesn't show the full screen button (the one with thumbnails on the right-hand side) I embedded in my blog, like this:

    Well it looks like I am not allowed to post the code I used.

    I also added: name="allowscriptaccess" and allowscriptaccess="always" as they were not in the embed code.

    It didn't work.

    Any suggestion on how to generate a full screen button on a YouTube custom player?

    Many thanks!

  3. alex says:

    &fs=1 to value , src fields made it work.

  4. 1 Ping:
  5. [...] Are Your Youtube Video Embeds Missing The Full Screen Button? Here Is How To Fix It (beerpla.net) [...]

Leave a Reply