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

那年仲夏 提交于 2019-12-22 01:25:12

问题


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:


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

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


来源:https://stackoverflow.com/questions/13156980/java-io-ioexception-setdatasource-failed-status-0x80000000

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!