android webview 通过html5播放在线视频 切换大屏
时间:2014-08-20 22:41:33
收藏:0
阅读:669
1、添加网络访问权限
<uses-permission android:name="android.permission.INTERNET" />
developer官方文档关于html5支持视频播放描述如下:In order to support inline HTML5 video in your application, you need to have hardware acceleration turned on, and set a WebChromeClient
.
For full screen support, implementations of onShowCustomView(View,
WebChromeClient.CustomViewCallback)
and onHideCustomView()
are
required, getVideoLoadingProgressView()
is
optional.
1)开启硬件加速
2)重写WebChromeClient的onShowCustomView(View,
WebChromeClient.CustomViewCallback)
和onHideCustomView()
通过onShowcustomView对大屏的布局进行加载,隐藏小屏布局;在onHideCustomeView中退出全屏播放,重新显示小屏布局
参考:
http://developer.android.com/reference/android/webkit/WebView.html
android webview 通过html5播放在线视频 切换大屏,布布扣,bubuko.com
原文:http://blog.csdn.net/actsai/article/details/38711735
评论(0)