Skip to content

Instantly share code, notes, and snippets.

@tommeagher
Created March 6, 2012 22:01
Show Gist options
  • Save tommeagher/1989209 to your computer and use it in GitHub Desktop.
Save tommeagher/1989209 to your computer and use it in GitHub Desktop.
Code for YouTube bug
I’m building my first Timeline-Setter timeline for a features project that’s running next week. I’m trying to embed YouTube videos in the timeline events.
If I try to use this embed code for YouTube’s iframe, it acts strangely.
Here’s the code:
<iframe width="420" height="315" src="http://www.youtube.com/embed/X31GQTS7C1c" frameborder="0" allowfullscreen></iframe>
In this case, if I click to the next item, the audio continues playing. When I click back to the video, it’s a blank screen and won’t give me any commands to stop the audio.
If I use the old YouTube embed code:
<object width="420" height="315"><param name="movie" value="http://www.youtube.com/v/X31GQTS7C1c?version=3&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/X31GQTS7C1c?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>
It works fine. But it’s flash, which I’m reluctant to use to avoid leaving iPad readers in the cold.
Do you know, what can I do to get the regular YouTube iframe to work?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment