gpt4 book ai didi

android - 准备失败 0x1 Android

转载 作者:行者123 更新时间:2023-11-30 03:21:23 26 4
gpt4 key购买 nike

我有一个正在尝试加载的 wvm 文件,但它在准备时总是失败并出现 IO 异常。

如果我尝试在同一台设备上的 VLC 播放器中运行相同的 url,它将正常播放。

这是我的 MediaPlayer 代码

    mPlayer = MediaPlayer.create(context, Uri.parse(file_url));

if(mPlayer != null){
mPlayer.setSurface(s);
mPlayer.setOnCompletionListener(this);
mPlayer.setOnErrorListener(this);
mPlayer.setOnInfoListener(this);
mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);

video_prepared = true;
if(got_initial_media_hit) {
OnEvent(PLAYER_EVENT.load);
}
}
else {
OnError(PLAYER_ERRORS.player_not_loaded, "");
}

这是我遇到的错误

09-29 14:48:56.314: E/MediaPlayer(18209): error (1, -1)
09-29 14:48:56.334: D/MediaPlayer(18209): create failed:
09-29 14:48:56.334: D/MediaPlayer(18209): java.io.IOException: Prepare failed.: status=0x1
09-29 14:48:56.334: D/MediaPlayer(18209): at android.media.MediaPlayer.prepare(Native Method)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.media.MediaPlayer.create(MediaPlayer.java:792)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.media.MediaPlayer.create(MediaPlayer.java:769)
09-29 14:48:56.334: D/MediaPlayer(18209): at com.tvinci.sdk.player.DefaultPlayer.initPlayer(DefaultPlayer.java:247)
09-29 14:48:56.334: D/MediaPlayer(18209): at com.tvinci.sdk.player.DefaultPlayer.onSurfaceTextureAvailable(DefaultPlayer.java:287)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.TextureView.getHardwareLayer(TextureView.java:385)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12804)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12880)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.draw(View.java:13657)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12833)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12880)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.draw(View.java:13657)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12833)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12880)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.draw(View.java:13657)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12833)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12880)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.draw(View.java:13657)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.draw(View.java:13947)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.widget.FrameLayout.draw(FrameLayout.java:467)
09-29 14:48:56.334: D/MediaPlayer(18209): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2224)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12838)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.View.getDisplayList(View.java:12880)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1411)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1359)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2367)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2239)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1872)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.Choreographer.doFrame(Choreographer.java:532)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.os.Handler.handleCallback(Handler.java:730)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.os.Handler.dispatchMessage(Handler.java:92)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.os.Looper.loop(Looper.java:137)
09-29 14:48:56.334: D/MediaPlayer(18209): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-29 14:48:56.334: D/MediaPlayer(18209): at java.lang.reflect.Method.invokeNative(Native Method)
09-29 14:48:56.334: D/MediaPlayer(18209): at java.lang.reflect.Method.invoke(Method.java:525)
09-29 14:48:56.334: D/MediaPlayer(18209): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-29 14:48:56.334: D/MediaPlayer(18209): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-29 14:48:56.334: D/MediaPlayer(18209): at dalvik.system.NativeStart.main(Native Method)

它可以是什么?谢谢

编辑:

如果我改用 VideoView,它就像一个魅力。有什么想法吗?

最佳答案

关于这个 Create 函数,我遇到了几个问题。

第一个,似乎 Java 必须知道文件的类型,因此您必须在文件路径的开头写上“file://”。参见 this answers .

然后,稍后,我将我的文件路径附加到 FilesDir.AbsolutePath 中,但它们之间缺少一个“/”。

所以这个错误确实与 Create 函数有关,而不是之后发生的事情。所以看看你的第一行。祝你好运。

关于android - 准备失败 0x1 Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19077764/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com