Skip to content Skip to sidebar Skip to footer

How To Give Assets Folder Path For Playing Mp4 Video?

How to Give Assets Folder Path for Playing mp4 video? I am Using Following Code for that. Please Help me. String stringPath = 'file:///android_asset/sample.mp4'; mediaPlayer.setAu

Solution 1:

Move the .mp4 file to raw/ folder. Then, replace your string with this:

StringstringPath="android.resource://[your_package_name]/raw/sample"

Solution 2:

Please specify your location is in the sd card or in the internal storage. If it is in the sd card then it will be:

StringstringPath="/sdcard/android_asset/sample.mp4";

Solution 3:

You have to do something like this

mediaPlayer.setDataSource(AndroidVideoPlayer.this, Uri
        .parse("android.resource://com.arthisoft.tempforvideo2/R.raw.sample"));

Post a Comment for "How To Give Assets Folder Path For Playing Mp4 Video?"