java.io.IOException: setDataSource failed.: status

2019-04-18 02:36发布

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?

1条回答
冷血范
2楼-- · 2019-04-18 03:14

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

<uses-permission android:name="android.permission.INTERNET" />
查看更多
登录 后发表回答