ibm123
ibm123

Reputation: 1254

Load video file from Assets folder to VideoView

I'm using VideoView and MediaController attached to it i know how to load a video from the raw folder and how to load a url but i'm unable to load a local file that sits in the Assets folder

i saw some way to do it with a MediaPlayer and SurfaceView, but i'm seeking a way to do so without changing the all activity and layout

Thanks

Upvotes: 2

Views: 1365

Answers (2)

Vikram
Vikram

Reputation: 8333

try using the function getAssets().open("videofile")

Upvotes: 1

Vyacheslav Shylkin
Vyacheslav Shylkin

Reputation: 9791

Try

Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw....);
videoView.setVideoURI(uri);

Upvotes: 0

Related Questions