您的位置:首页 > 其它

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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  VideoView 全屏播放