4

I've been working on an embedded youtube video on a page. Works fine on desktop browsers. However, on android-chrome, the embedded video won't play when you touch on the red play button on the center. It does play fine when you touch just outside the play button, which is weird.

My client also reports the same thing on ipad's browser.

Weird, because the red play button does not work even on this demo from google: https://developers.google.com/youtube/youtube_player_demo

I tested it on my android phone (HTC one), and on the desktop google chrome's mobile emulation feature.

Does anyone know any way to fix this? Thanks.

Bibokid
  • 285
  • 2
  • 9

2 Answers2

7

there is another solution if you want to enable controls you should use ps=docs like this :

<iframe class="youtube-player" type="text/html" width="100%" height="338" src="http://www.youtube.com/embed/VIDEO-ID?ps=docs&controls=1" frameborder="0" allowfullscreen></iframe>

i have tested it ... it works!!

i hope this will help.

mortb
  • 106
  • 1
  • this seems to make play button work, thank you. Unfortunately when I do that (using youtube iframe api) my video becomes smaller than its content area where it should play. Any ideas? When phone goes to sleep and I open the app again, video is 100% as it should be. hmm.. – trainoasis Oct 08 '14 at 08:35
  • is there any documentation about ps=docs anywhere? Where did you find about it? I did not find anything as of yet ... – trainoasis Oct 08 '14 at 10:34
2

i agree with you .. i think there is a problem with youtube mobile player which i had lately .. But there is a temporary solution for that in which you have to make the player controls hidden like this:

<iframe class="youtube-player" type="text/html"  width="100%" height="338" src="http://www.youtube.com/embed/VIDEO-ID?autoplay=0&showinfo=0&controls=0" frameborder="0" allowfullscreen></iframe>

in this case we made controls=0

i hope this will help.

mortb
  • 106
  • 1
  • Thanks for this. Unfortunately, we needed the controls, but others may find this fix helpful for now. – Bibokid Oct 02 '14 at 01:05