저는 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"/>
이 OrientationChange
이벤트에