Recently when visiting my blog (at least with some browsers) the embedded YouTube videos would start playing themselves automatically. Worse, since by default the front page holds the latest 10 posts, and since a lot of the posts contain embedded video clips I like, this meant that all the clips would start playing at once. Not cool!
I seem to have solved the problem, and since I’m not the only person dealing with it, here’s how to prevent the autoplay problem when embedding YouTube videos on a website:
When you look at a given video on the YouTube site, you’ll usually see below it a set of tabs. (You might not realize they’re tabs, but they are.) They’re on the same row as the thumbs-up and thumbs-down “like” links, and they include these entries:
About Share Add to
If you click on
Share you’ll get a short link to the video in question that you can copy and paste into an email (or wherever you like), something like this: http://youtu.be/AgwAywJlo1M
But there’s also another set of tabs here that gives you other options:
Share this video Embed Email Video call
Embed, and you’ll get a box containing some HTML code.
Immediately below the box you’ll see some options, notably including one that lets you set the video size. Once you have these options the way you want, copy the HTML from the box into your blog entry or other web content. (The details depend on how you edit your website.)
Once you’ve done that you’re ready to turn off autoplay. Here’s how. Inside the copied HTML you’ll see a piece that looks something like this:
The string of gibberish (AgwAywJlo1M in this example) is YouTube’s internal identifier for the video in question. To stop the video from playing automatically, you’ll need to add one of two things just before the closing quotation mark. If the closing quotation mark comes immediately after the gibberish with nothing in between, insert “?autoplay=0″ — like this:
But if the gibberish already has a “?” after it, you need to insert “&autoplay=0″ instead, as in
That’s basically it. It’s annoying and shouldn’t be necessary, but it’s not too awful.