我需要在web视图播放YouTube视频,但是当我加载的URL整个移动版YouTube页面加载。我想只有一名球员还是有办法嵌入在web视图的视频,就像在IOS。可能吗?用iframe标签录像不加载,它说,发生了错误。 谢谢你。
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.
使用code在您的来源为web视图显示的嵌入式视频:
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>
您可以找到的URL SRC-标签,如果你到了YouTube网站,点击共享 - >嵌入。 但是,为什么你使用的WebView?在那里,你要玩视频在Flash。而Android VideoView也可以流YouTube视频。
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.