开发者

android videoview set path

开发者 https://www.devze.com 2023-02-05 09:45 出处:网络
i\'m trying to play a video through videoview , the video file i put in the res/raw directory. so i tried this:

i'm trying to play a video through videoview , the video file i put in the

res/raw directory.

so i tried this :

Uri uri = Uri.parse("android.resource://"+this.getApplicationContext().getPackageName()+"logo.mp4");
        splashVideo.setVideoURI(uri);

but it can't play开发者_JAVA百科 , could someone tell me , how should i set my file path in uri??


I believe instead of logo.mp4 you should be using R.raw.logo

You probably need to add a slash after the package name as well.


i also i found my answer.

it is :

mp4 can not be played on emulator , when i use GT-P1000 run my application ,

it worked fine........Orz

thx all

0

精彩评论

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