WebView and HTML5 <video>
|September 28, 2010||Posted by forumadmin under TechQns||
I’m piecing together a cheapo app that amongst other things “frames” some of our websites… Pretty simple with the WebViewClient… until I hit the video.
The video is done as HTML5 elements, and these work fine and dandy on Chrome, iPhones, and now that we fixed the encoding issues it works great on Android… in the native browser.
Now the rub: WebView doesn’t like it. At all. I can click on the poster image, and nothing happens.
Googling, I found http://www.codelark.com/2010/05/12/android-viewing-video-from-embedded-webview/ which is close, but seems to be based on a ‘link’ (as in a href…) instead of a video element. (onDownloadListener does not appear to get invoked on video elements…)
I also see references to overriding onShowCustomView, but that seems to not get called on video elements… nor does shouldOverrideUrlLoading..
I would rather not get into “pull xml from the server, reformat it in the app”.. by keeping the story layout on the server, I can control the content a bit better without forcing people to keep updating an app. So if I can convince WebView to handle tags like the native browser, that would be best.
I’m clearly missing something obvious.. but I have no clue what.
|Asked By – brian moore||Read Answers|