I have a YouTube video embedded in my mobile webpage. On desktop, it plays properly. However, on mobile phone (emulated on Android), it stops after some time throwing an error.
When I debugged in console, following errors are generated:
Failed to load resource: net::ERR_FAILED
XMLHttpRequest cannot load
http://r13---sn-nx57yn7s.googlevideo.com/videoplayback?source=youtube&ipbit…s_redirect=yes&mm=30&ms=nxu&mt=1410325650&mv=u&range=0-65535&keepalive=yes
. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.youtube.com
' is therefore not allowed access.
The HTML I am using for the video is like this
<iframe id="video1" width="100%" height="100%" src="http://www.youtube.com/embed/PLOUfmig96M?&enablejsapi=1&hl=es_ES&rel=0&color1=0x2b405b&color2=0x6b8ab6
&fs=1&border=1&autoplay=1"></iframe>
Error Image

来源:https://stackoverflow.com/questions/25757846/youtube-player-stops-after-few-seconds-on-mobile