Adham
Adham

Reputation: 64844

MediaPlayer(16454): Unable to to create media player

I got this error:

06-28 09:32:24.266: E/MediaPlayer(16454): Unable to to create media player
06-28 09:32:24.338: W/VideoView(16454): Unable to open content: /data/data/com.laroche/cache/intro.mp4
06-28 09:32:24.338: W/VideoView(16454): java.io.IOException: setDataSourceFD failed.: status=0x80000000
06-28 09:32:24.338: W/VideoView(16454):     at android.media.MediaPlayer.setDataSource(Native Method)
06-28 09:32:24.338: W/VideoView(16454):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:976)
06-28 09:32:24.338: W/VideoView(16454):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:955)
06-28 09:32:24.338: W/VideoView(16454):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:918)
06-28 09:32:24.338: W/VideoView(16454):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:870)
06-28 09:32:24.338: W/VideoView(16454):     at android.widget.VideoView.openVideo(VideoView.java:236)
06-28 09:32:24.338: W/VideoView(16454):     at android.widget.VideoView.access$2000(VideoView.java:52)
06-28 09:32:24.338: W/VideoView(16454):     at android.widget.VideoView$6.surfaceCreated(VideoView.java:490)

when using the following code :

String cacheDir = getApplicationContext().getCacheDir().getAbsolutePath();
Log.d("video path",cacheDir+"/intro.mp4");
vvIntro.setVideoPath(cacheDir+"/intro.mp4");
vvIntro.start();

I want to play a video stored in cache folder

Upvotes: 2

Views: 3219

Answers (2)

Yakiv Mospan
Yakiv Mospan

Reputation: 8224

Maybe MediaPlayer requires MODE_WORLD_READABLE for your Intro file. Try to save it in none PRIVE mode.

Or you forgot to add permission for READING internal storage.

Upvotes: 1

intrepidkarthi
intrepidkarthi

Reputation: 3102

First check your file permission. And try without the .mp4 extension if there is no other file on the same name otherwise try with a .3gp file similarly without extension.

Upvotes: 0

Related Questions