0
私は、アクティビティでビデオを再生するための正しいVideoURIを持っています。Android:VideoViewとIntent.ACTION_VIEWの違い
Uri videoUri = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(videoUri, "video/*");
startActivity(intent);
これは、全画面でビデオを再生します。
VideoViewウィジェットを使用してこの動画を再生しようとしていますが、動画を読み込めません。
mVideoView = (VideoView)findViewById(R.id.video_view);
mVideoView.setVideoURI(videoUri);
mVideoView.requestFocus();
mVideoView.start();
ビデオファイルは、sdcard/Movies/my_video.mp4にあります。
私はlogcatが与えるVideoViewを使用して実行します。..
W/VideoView: Unable to open content: file:///storage/emulated/0/Movies/my_video.mp4
java.io.FileNotFoundException: /storage/emulated/0/Movies/my_video.mp4 (Permission denied)
どれが素晴らしいことだ役立ちます。 ありがとうございます。