FullscreenVideoView
クラスを使用してそれを行うことができます。その小さなライブラリ プロジェクトです。それはgradleです:
compile 'com.github.rtoshiro.fullscreenvideoview:fullscreenvideoview:1.1.0'
その手順は次のとおりです。
あなたのVideoView
xmlはこのようなものです
<com.github.rtoshiro.view.video.FullscreenVideoLayout
android:id="@+id/videoview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
activity で、次の方法で初期化します。
FullscreenVideoLayout videoLayout;
videoLayout = (FullscreenVideoLayout) findViewById(R.id.videoview);
videoLayout.setActivity(this);
Uri videoUri = Uri.parse("YOUR_VIDEO_URL");
try {
videoLayout.setVideoURI(videoUri);
} catch (IOException e) {
e.printStackTrace();
}
それでおしまい。ハッピーコーディング:)
もっと知りたい場合は、ここにアクセスしてください