WebView and HTML5 <video>
Posted
by
brian moore
on Stack Overflow
See other posts from Stack Overflow
or by brian moore
Published on 2010-09-28T16:49:24Z
Indexed on
2011/01/09
4:53 UTC
Read the original article
Hit count: 258
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.
© Stack Overflow or respective owner