4

I need to play youtube video in the webview,but when I load the URL the entire youtube mobile page is loaded. I want only a player or a way to embed the video in the webview, like in IOS. Is it possible? With the iframe tag the video doesn't load, it say that an error occurred. Thanks.

Sachin D
  • 1,370
  • 7
  • 29
  • 42
Andrea Mario Lufino
  • 7,921
  • 12
  • 47
  • 78

1 Answers1

3

Use the Code to display an embedded Video in your Source for the WebView:

<iframe width="560" height="315" src="http://www.youtube.com/embed/...." frameborder="0" allowfullscreen></iframe>

You can find the URL for the src-Tag if you got to the Youtube Website and click on share -> embed.

But why do you use WebView? There you have to play the Videos in Flash. The Android VideoView can also stream Youtube Videos.

Thommy
  • 5,070
  • 2
  • 28
  • 51