且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

播放视频全屏

更新时间:2023-12-06 13:29:16

播放视频到全屏模式无需任何编码

No need to do any coding for playing video to full screen mode

在包含视频视图的 xml 上应用以下布局格式,它肯定会以全屏模式播放视频.因为它正在运行我的.

Apply the following layout format over the xml containing the videoview it will for sure will play the video in full screen mode. as it is running mine.

 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent" >
   <VideoView android:id="@+id/myvideoview"
             android:layout_width="fill_parent"
             android:layout_alignParentRight="true"
             android:layout_alignParentLeft="true"
             android:layout_alignParentTop="true"
             android:layout_alignParentBottom="true"
             android:layout_height="fill_parent">
    </VideoView>
 </RelativeLayout>

加上添加 mediacontroller 也会为您提供要使用的控制器.

Plus adding the mediacontroller will also give you the controller to use.