Gilad Novik
Gilad Novik

Reputation: 4604

Embedding a youtube video in HTML on Android only has sound, no video

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...

Upvotes: 0

Views: 1937

Answers (1)

edwardtyl
edwardtyl

Reputation: 282

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"

Upvotes: 1

Related Questions