2

I would like to play a HTML5 video back to the user directly in the native android video player.

My current setup takes way too much effort to get into the native video player: Currently I have a WebView with an embedded HTML5 video (such as a Youtube or Vimeo HTML5, not flash, embed). The user has to hit play on the video, and then hit the fullscreen button (on far right in the picture below)

enter image description here

Then it opens in the native player which looks like this:

enter image description here

The native player is a View is a much better experience for video playback. (I believe it is a VideoView? though maybe it is different in newer versions of Android. It is a View within my Activity so provides extra control. See this post for more info.)

I'm looking for a graceful way of directly launching into this experience instead of having to load the embed in a WebView and then leaving it to the user to tap the full screen button.

Any ideas?

Thanks!

Community
  • 1
  • 1
cottonBallPaws
  • 21,220
  • 37
  • 123
  • 171
  • 1
    Refer [Here](http://stackoverflow.com/a/11118002/792232) to play you tube video – Abhi Nov 20 '12 at 04:09
  • Could you provide code for how you are doing the above? I'm trying to get a Vimeo embed to play fullscreen but it's stubbornly refusing. – steemcb Mar 25 '13 at 12:58
  • @steemcb it is a little tricky, but check out the answers here http://stackoverflow.com/questions/3815090/webview-and-html5-video/4637739 – cottonBallPaws Mar 25 '13 at 19:41
  • @littleFluffyKitty I can't seem to get the onShowCustomView event to fire. Are you using an iframe embed? Any help much appreciated! – steemcb Mar 26 '13 at 13:04
  • @sttemcb I use this for iframe as well as just straight html5 videos. What API level are you on? There are two variants of onShowCustomView, if you are targeting 14+ make sure you override this one as well: http://developer.android.com/reference/android/webkit/WebChromeClient.html#onShowCustomView%28android.view.View,%20int,%20android.webkit.WebChromeClient.CustomViewCallback%29 – cottonBallPaws Mar 26 '13 at 14:07
  • @littleFluffyKitty Still nothing, if you have a moment could you stick up a gist so I can see where I might be going wrong? Would be much appreciated. – steemcb Mar 26 '13 at 15:31
  • @littleFluffyKitty Actually never mind, turns out the view hierarchy I was placing the webview in was causing an issue somewhere. I stripped it back and am now getting the callbacks. Thanks for your help! – steemcb Mar 26 '13 at 17:13
  • @steemcb glad to hear it – cottonBallPaws Mar 26 '13 at 19:24

0 Answers0