VideoView-全屏播放
2016-07-17 20:40
246 查看
布局文件:
全屏代码:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <VideoView android:id="@+id/vv_video" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerInParent="true"/> </RelativeLayout>
全屏代码:
vv_video为VideoView
RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP); layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT); layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); vv_video.setLayoutParams(layoutParams);
相关文章推荐
- Android自定义播放器控件VideoView
- Android编程使WebView支持HTML5 Video全屏播放的解决方法
- 可以滑动的视频播放器(VideoView)
- mplayer 命令——全屏播放
- Android开发中遇到的问题(一)——自定义videoview设置视频大小,实现上下黑边
- Android中Fragment使用VideoView会出现只有声音没有图像的问题
- 打造私人在线视频播放器,就是这么简单................
- android视频播放(VideoView和MediaController)
- Add SurfaceView flash a black screen(动态添加SurfaceView导致黑一下屏)
- Android播放网络视频截图
- 关于Android VideoView seekTo不准确的问题
- Android中播放MP4文件
- Android - 标准VideoView播放示例
- videoview 横竖屏切换
- [Android基础] VideoView
- Android使用videoview播放res/raw下的视频
- Android视频播放(一)
- Android 视频播放的三种方法
- Android 播放视频的四种方法
- getDuration()获取媒体总长度值为-1