Skip to content

Instantly share code, notes, and snippets.

@midu
Created May 3, 2011 17:47
Show Gist options
  • Save midu/953816 to your computer and use it in GitHub Desktop.
Save midu/953816 to your computer and use it in GitHub Desktop.
Browsers Randomness
<!-- Embedding flash -->
<!--
Let's say you want to include a youtube video.
The classic code is something like that:
-->
<object width="560" height="349">
<param name="movie" value="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true"></embed>
</object>
<!-- lol Safari -->
<!--
Safari won't let you use closing tags for param embed, because that's not how html5 manages it.
But it will work... Unless you didn't install the flashplayer (yet?) Safari will know there's a plugin missing but won't help you finding which one it is (and even less get it for you).
That's cool because removing the closing tags will work on all the usual browsers
-->
<object width="560" height="349">
<param name="movie" value="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0">
<param name="allowFullScreen" value="true">
<param name="allowscriptaccess" value="always">
<embed src="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true">
</object>
<!-- relol Safari -->
<!--
Wait, it still doesn't work? Add type="application/x-shockwave-flash" to the object tag!
-->
<object width="560" height="349" type="application/x-shockwave-flash">
<param name="movie" value="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0">
<param name="allowFullScreen" value="true">
<param name="allowscriptaccess" value="always">
<embed src="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true">
</object>
<!-- lol IE (7-8) -->
<!--
Now a look on IE dev tool will show you that there's something quite wrong.
For some reason, it auto add the attribute altHtml (http://www.findmeat.org/tutorials/javascript/x578105.htm) to the object tag. Not a big deal, but it puts the content of the object tag in the altHtml which is not very useful.
Note that not specifying the type will work (probably because it defaults to text/html).
You can just specify a value to the altHtml attribute and it will work.
-->
<object width="560" height="349" type="application/x-shockwave-flash" altHtml="lol you don't have the flash player, are you an iPhone?">
<param name="movie" value="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0">
<param name="allowFullScreen" value="true">
<param name="allowscriptaccess" value="always">
<embed src="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true">
</object>
<!--
And since you have login modals, you want to set the param wmonde to transparent (or opaque, or whatever that is not the default value). so it can overlay the video.
-->
<object width="560" height="349" type="application/x-shockwave-flash" altHtml="lol you don't have the flash player, are you an iPhone?">
<param name="movie" value="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0">
<param name="allowFullScreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="wmode" value="transparent">
<embed src="https://www.youtube-nocookie.com/v/QFCSXr6qnv4?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true">
</object>
<!--
Note that none of these ``bugs'' will prevent your video from playing or being included. It's just cool to know what's going on behind the scenes.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment