7

I've recently run into an issue when embedding a video with standard iframe embed code and adding autoplay=1 like this:

<iframe width="420" height="315" src="http://www.youtube.com/embed/Le4kjAIcj4k?rel=0&amp;autoplay=1" frameborder="0" allowfullscreen></iframe>

The results when testing:

  • autoplay works both on desktop and mobile if the Flash-version of the player is loaded (if Flash is present & no HTML5-beta participation cookie is present)
  • it works in the HTML5-version on the Desktop as well
  • but does not autoplay in the HTML5 mobile version (tested on Android 4.1.2 with both Firefox Mobile and Chrome on this page, on Android you need to make sure you don't have flash).

Is this a known issue? Any workaround?

2
  • If we look at the behavior on the mobile client, it can perhaps lead us to an assumption about why this is the case ... while the HTML5-version on the Desktop plays through a youtube-skinned player, in Chrome mobile it plays through the browser's default HTML5 player. One might posit, therefore, that Youtube is specifically ignoring HTML5 autoplay in the mobile browser until they can create their own client. Of course this is just a guess ...
    – jlmcdonald
    Feb 19, 2013 at 20:56
  • My guess originally was that these were implementations of the YouTube Android API (cfr. apiblog.youtube.com/2012/12/…) in Chrome and Firefox for Android, but I can find no confirmation what-so-ever that this indeed is the case.
    – futtta
    Feb 20, 2013 at 7:19

1 Answer 1

9
+100

When you use the <iframe> Player in a browser that has Flash disabled, playback is handled via HTML5 <video> tags.

Apple explicitly prohibits autoplaying media in <video> tags in iOS Safari.

This is also the case for at least recent versions the default Android Browser or in Chrome. I'd strongly suspect that Android Firefox has the same restriction.

2
  • Thanks Jeff! Although I perfectly understand the reason (avoiding large amounts of data being transmitted over the wire unless a user initiated that action), it is frustrating that this breaks (part) of the YouTube API. Are there any workarounds available (for developers) or being worked on (by YouTube) to "fix" this?
    – futtta
    Feb 22, 2013 at 9:36
  • Apple will allow you to enable autoplay in iOS when the playback happens in a UIWebView within a packaged application (developer.apple.com/library/ios/#documentation/uikit/reference/…), but not for a random webpage opened in Safari. I'm not aware of any similar exception for Android packaged applications. Feb 22, 2013 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.