How To Play Mp4 Videos Stored On Assets Folder On Android 1.5?
Ineed to play a short MP4 video on my android app I'm searching info about how to load mp4 videos but i can't find the way to do it on Android 1.5. My app sould be compatible from
Solution 1:
You could put the video in the raw folder instead and construct a URI like this:
android.resource://[package]/[resource_id]
android.resource://[package]/[res type]/[res name]
For example:
UrivideoUri= Uri.parse("android:resource://com.my.package/"+R.raw.myVideo);
mVideoView.setVideoURI(videoUri);
Solution 2:
Have a look at page 314 of Mark's Busy Coder's guide to Android: http://commonsware.com/Android/Android-1_0-CC.pdf
There is an example there on how to get something from the asset folder.
Also, make sure that the codec is H.264 (not H.264 AVC). I don't think AVC was supported in 1.5. See: http://developer.android.com/guide/appendix/media-formats.html
Happy coding!
Post a Comment for "How To Play Mp4 Videos Stored On Assets Folder On Android 1.5?"