I want to play a video from my assets or raw folder

前端 未结 6 1827
别那么骄傲
别那么骄傲 2020-12-05 05:55

I want to play a video from my assets or raw folder in my app in Android using VideoView I am getting the error as video cannot be played please anyone give me

6条回答
  •  失恋的感觉
    2020-12-05 06:06

    You must include the package name in the uri:

      Uri uri = Uri.parse("android.resource://[package]/raw/video")
    

    or

      Uri uri = Uri.parse("android.resource://[package]/"+R.raw.video);
    

    Also, check out these examples.

提交回复
热议问题