java.io.IOException: setDataSource failed.: status=0x80000000

CoDe picture CoDe · Oct 31, 2012 · Viewed 20.8k times · Source

I am trying to play url using media player in activity using:

mediaPlayer = MediaPlayer.create(getApplicationContext(),
Uri.parse("http://www.pocketjourney.com/downloads/pj/video/famous.3gp"),
holder);

It's working fine. Same code I use to set it as an live wallpaper in @onSurfaceCreated in WallpaperService, it's giving me following error log

D/MediaPlayer( 4128): create failed: D/MediaPlayer( 4128):
java.io.IOException: setDataSource failed.: status=0x80000000
D/MediaPlayer( 4128):   at
android.media.MediaPlayer._setDataSource(Native Method) D/MediaPlayer(
4128):  at
android.media.MediaPlayer.setDataSource(MediaPlayer.java:844)D/MediaPlayer( 4128): at
android.media.MediaPlayer.setDataSource(MediaPlayer.java:806)......

If I use local video uri to set live wallpaper..it working fine.

Any idea/suggestion over here?

Answer

Quyen Nguyen Tuan picture Quyen Nguyen Tuan · Feb 22, 2013

Do you remember to add this permission to your manifest file?

<uses-permission android:name="android.permission.INTERNET" />