我正在使用videoview和示例代碼從全網的YouTube/rtmp實時視頻應用程序工作,所以秋天我有應用程序工作,但我面臨一個問題當我改變方向時,實時視頻旋轉並展開良好,但它並沒有進入一個完整的全屏幕,我如何設置一種方式,只有當我進入橫向模式時才能進入完整的全屏幕?全屏Videoview不會隱藏菜單欄在旋轉過程中
我的主要活動。
progressdialog = ProgressDialog.show(this, "", " Cargando vídeo por favor espere...", true);
progressdialog.setCancelable(true);
final VideoView vidView = (VideoView)findViewById(R.id.video_view);
String vidAddress = "http://videourl/playlist.m3u8";
Uri vidUri = Uri.parse(vidAddress);
vidView.setVideoURI(vidUri);
MediaController vidControl = new MediaController(this);
vidControl.setAnchorView(vidView);
vidView.setMediaController(vidControl);
vidView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer arg0) {
progressdialog.dismiss();
vidView.start();
}
});
主要XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" >
<GridView
android:id="@+id/list_playlist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/video_view"
android:layout_margin="5sp"
android:gravity="center"
android:numColumns="2"
android:scrollbars="none" >
</GridView>
<RelativeLayout
android:id="@+id/layout_ad"
android:layout_width="match_parent"
android:layout_height="50sp"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal" >
</RelativeLayout>
<VideoView
android:id="@+id/video_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"/>