android - java.io.IOException : setDataSource failed.:状态=0x80000000

标签 android media-player live-wallpaper surfaceholder

我正在尝试在 Activity 中使用媒体播放器播放 url:

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

一切正常。我用来在 WallpaperService@onSurfaceCreated 中将其设置为动态壁纸的代码相同,它给了我以下错误日志

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)......

如果我使用本地视频 uri 设置动态壁纸..它工作正常。

这里有什么想法/建议吗?

最佳答案

您记得将此权限添加到您的 list 文件吗?

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

关于android - java.io.IOException : setDataSource failed.:状态=0x80000000,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13156980/

相关文章:

android - 我的 Android 应用程序如何根据条件以两种 View 之一打开?

android - ChangeBounds 安卓过渡

带有 AVSEEK_FLAG_ANY 的 ffmpeg av_seek_frame 会导致灰屏

android - 如何通过中心裁剪和适合宽度/高度来适应动态壁纸中的视频?

用户点击 "set wallpaper"时Android动态壁纸预览启动activity

android - React Native 自定义字体适用于 IOS 但不适用于 Android

Android 媒体流错误? java.io.FileNotFoundException : No content provider :http://

kotlin - MediaButtonReceiver.buildMediaButtonPendingIntent() 给出目标 S+(版本 31 及更高版本)需要 FLAG_IMMUTABLE 或

android - 如何在动态壁纸上渲染 OpenGL(太难了!)?

Android 9 - 无法编排多个堆叠的 VideoView 对象 SM-G950U