Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube embedded video: autoplay feature not working in iphone

I have a youtube embeded video link in HTML5 page, which I want to autoplay.

The following code works in browsers, but in iphone; its not working and needs an extra click.

<iframe type="text/html" width="125" height="100" src="http://www.youtube.com/embed/d_g0251EfB8?autoplay=1" frameborder="0"></iframe>

what to do

like image 895
Avisek Chakraborty Avatar asked Nov 15 '11 19:11

Avisek Chakraborty


People also ask

Why is my autoplay not working on YouTube iPhone?

AutoPlay may not work on YouTube due to corrupt cache/data of the browser or corrupt installation of the YouTube mobile application. Moreover, an outdated browser or misconfiguration of your browser like DRM settings, etc. may also cause the error under discussion.

How do I enable autoplay on embedded YouTube videos?

To make an embedded video autoplay, add "&autoplay=1" to the video's embed code right after the video ID (the series of letters that follows "embed/"). Embedded videos that are autoplayed don't increment video views.


2 Answers

It can't be done. For various reasons (including, but not limited to data usage), Apple doesn't allow auto-playing of videos.

See the accepted answer to this question.

like image 181
Mike Avatar answered Oct 28 '22 13:10

Mike


UPDATE :

iOS 10+ now allows auto-play on HTML5 < video> elements, just have to mute the audio on elements. Youtube will still not. Android is still SOL too, but hey, its a start!

SAMPLE:

<video autoplay muted>
  <source src="movie.mp4" type="video/mp4">
  Sadly, your browser does not support the video tag X_x 
</video>

INFO SOURCE: https://webkit.org/blog/6784/new-video-policies-for-ios/

like image 22
Lux.Capacitor Avatar answered Oct 28 '22 13:10

Lux.Capacitor