Playing .MP4 video from raw resource folder

前端 未结 1 1673
自闭症患者
自闭症患者 2021-01-20 01:03

I\'ve seen a number of similar questions, but so far I\'ve not been able to get anything working.

I\'m trying to playback a video (.MP4) from the res/raw folder and

1条回答
  •  孤街浪徒
    2021-01-20 01:43

    I was having the same trouble, tried everything too, agree it should be easier... and documented. Just fixed by passing VideoView.setVideoUri a string with the android.resource protocol, as described here. The first option doesn't work for me, but the second does:
    Uri uri = Uri.parse("android.resource://[package]/"+R.raw.[video_resid]);
    Hopefully works for you too.

    0 讨论(0)
提交回复
热议问题