Skip to content

Instantly share code, notes, and snippets.

@richcollins
Created August 11, 2011 19:13
Show Gist options
  • Save richcollins/1140488 to your computer and use it in GitHub Desktop.
Save richcollins/1140488 to your computer and use it in GitHub Desktop.
**I will paypal $200 to anyone that can solve this for me**
I'm trying to get an Android WebView to play a video inline. On iOS you can just use webkit-playsinline in your video tag. Not so on Android. I followed the examples provided in these 2 answers:
http://stackoverflow.com/questions/3815090/webview-and-html5-video
http://stackoverflow.com/questions/4989738/how-to-play-a-video-in-a-webview-with-android
Using these techniques I can get the video to play only on the second time that I start the WebViewActivity. It doesn't work the first time and it doesn't work again after the second time. _You have to run this on a device, video won't play back at all in the emulator._ You can download the Android project here:
http://cl.ly/3G27270k0B3J3Q380i0T
You can see the source for the WebViewActivity here:
https://gist.github.com/8762e2678816898bfbb6
It appears that the problem lies with onShowCustomView not being called. It is called when the video appears but isn't called when it doesn't. Even when it doesn't appear, the video in the html emits events, it just never appears on the screen.
It's very simple (2 Activities & a small html file) and should be an easy $200 for anyone familiar with this problem.
@mihaipaun
Copy link

Did you find a solution for this, out of curiosity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment