I have an app where I need to display youtube content. It works fine for iOS, but Android has a problem.
The webView loads a local html file which embeds a youtube video in an iframe.
As mentioned above, the webView works fine on iOS. It also works fine on a Google Nexus 7 running Android 4.2.
The webView doesn’t show the video on a Galaxy S running Android 2.3.
However, If I load the same html file (see below) in the stock browser on the Galaxy S, the video is shown without a problem, so I suspect there’s a glitch in the current implementation of the webView for Android.
Note: I’ve disabled browser plugins on the Galaxy S since I don’t want the Flash version to be played. (It doesn’t really matter though since enabling flash didn’t make the video play anyway)
Any thoughts?
I’ve stripped down the html file and hardcoded a sample video below.
\<!DOCTYPE html\> \<html\> \<body style="padding:0px; margin:0px; width:100%; height:100%;"\> \<iframe id="dynamicvideo" seamless style="width:100%; height:100%"\>\</iframe\> \<script type="text/javascript"\> window.frames["dynamicvideo"].document.location.href = "http://www.youtube.com/embed/u1zgFlCw8Aw" \</script\> \</body\> \</html\>