开发者

WebView with YouTube inside ScrollView on Honeycomb

I have WebView with embedded Youtube player. It has to be inside ScrollView as it is a part of an article user can scroll. Now with hardware acceleration disabled WebView displays only black rectangles. With acceleration enabled I can see the image, but with scrolling WebView flickers or partially disappears. I'm using the most recent SDK, ASUS eeePad with Android 3.2 and ACER Iconia with Android 3.1. I'm enabling JavaScript and plugins, and I'm embedding YouTube with the following code:

<iframe class=\"youtube-player\" type=\"text/html\" width=\"" + width +
"\" height=\"" + height + "\" src=\"http://www.youtube.com/embed/" + id +
"\" frameborder=\"0\">

Here's the screenshot :

WebView with YouTube inside ScrollView on Honeycomb

http://imageshack.u开发者_如何学运维s/photo/my-images/651/iconiayoutube.png/

Any ideas, how I can make it work?


I doubt <iframe> tag belong to HTML5 . If it's so , then it will support from android version 4.1 only

Try to use <Video> or <Object> tag instead of it

Also try to set Webchrome Client or WebViewClient for the webview

NOTE: Since Emulators are virtual devices testing of online streaming of Video and Audio will not yield any result. So test always in Devices

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜