0

I have an Android app where the content is being displayed inside an embedded web control. Sometimes the content has embedded youtube videos, but they don't show - you can only hear the sound. I've looked at Google's official documentation and cannot see anything wrong with my code. To embed the video, I'm using the following piece of html (where I replace VIDEO_ID with the actual id of the video):

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

Any help is appreciated...

Gilad Novik
  • 4,546
  • 4
  • 41
  • 58

1 Answers1

1

Try this page:
Youtube embed video not working in android 4+ (Ice cream sandwich,Jelly Bean)
some quotes:
"Got it working. I had to add webView.setWebChromeClient(new WebChromeClient(){}); and webView.getSettings().setJavaScriptEnabled(true); for it to work properly. Did not need the class or type."
and
" <iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0"></iframe>
Source: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

Gonna need this: Force HTML5 youtube video

Also see: https://developers.google.com/youtube/player_parameters"

Amir Dora.
  • 2,831
  • 4
  • 40
  • 61
edwardtyl
  • 284
  • 4
  • 12