Sunday, June 30, 2013

[android help] MediaPlayer(16454): Unable to to create media player


MediaPlayer(16454): Unable to to create media player


android - MediaPlayer(16454): Unable to to create media player - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















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


























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.























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.























default






.

stackoverflow.comm



No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...