开发者

Android Video View - Fails to Load file from SD Card

开发者 https://www.devze.com 2022-12-29 00:09 出处:网络
I have an activity that uses 开发者_Go百科VideoView and MediaController. I have a .mp4 file. When I put the file in res/raw folder, I can play the video using Uri.parse(\"android.resource://&lt

I have an activity that uses 开发者_Go百科VideoView and MediaController.

I have a .mp4 file.

  1. When I put the file in res/raw folder, I can play the video using Uri.parse("android.resource://<package>/" + R.raw.id_video)

  2. However, when I put the same file in the filesystem, it plays properly. I use videoView.setVideoPath("/sdcard/myfile.mp4");

What is the problem?


can u try videoview.setVideoPath("sdcard/myfile.mp4);

one question.. are u using the same video view to play the video from raw folder as well?

0

精彩评论

暂无评论...
验证码 换一张
取 消