gpt4 book ai didi

com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.x 处的 android.os.DeadObjectException

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:10:31 25 4
gpt4 key购买 nike

我遇到了这个问题,我没有任何情况报告为 20 次:我有 youtube jar,因为版本号是:

list 版本:1.0

名称:com/google/android/youtube/player

规范标题:YouTube Android Player API

规范-版本:1.2.2

规范-供应商:谷歌公司

创建者:1.8.0-google-v7 (Google Inc.)

Fatal Exception: java.lang.IllegalStateException: android.os.DeadObjectException
at com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.x(SourceFile:209)
at hwe.w(SourceFile:305)
at abpk.onTransact(SourceFile:228)
at android.os.Binder.transact(Binder.java:361)
at com.google.android.youtube.player.internal.d$a$a.r(Unknown Source)
at com.google.android.youtube.player.internal.s.h(Unknown Source)
at com.google.android.youtube.player.YouTubePlayerView.e(Unknown Source)
at com.google.android.youtube.player.YouTubeBaseActivity.onSaveInstanceState(Unknown Source)
at android.app.Activity.performSaveInstanceState(Activity.java:1238)
at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1223)
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3175)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3234)
at android.app.ActivityThread.access$1100(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1223)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by android.os.DeadObjectException
at android.os.BinderProxy.transact(Binder.java)
at com.google.android.apps.youtube.embeddedplayer.service.service.jar.IApiPlayerService$Stub$Proxy.k(SourceFile:289)
at com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.x(SourceFile:207)
at hwe.w(SourceFile:305)
at abpk.onTransact(SourceFile:228)
at android.os.Binder.transact(Binder.java:361)
at com.google.android.youtube.player.internal.d$a$a.r(Unknown Source)
at com.google.android.youtube.player.internal.s.h(Unknown Source)
at com.google.android.youtube.player.YouTubePlayerView.e(Unknown Source)
at com.google.android.youtube.player.YouTubeBaseActivity.onSaveInstanceState(Unknown Source)
at android.app.Activity.performSaveInstanceState(Activity.java:1238)
at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1223)
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3175)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3234)
at android.app.ActivityThread.access$1100(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1223)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(NativeStart.java)

最佳答案

这是 YouTube 播放器的内部问题,将在下一个版本中解决,您可以在此处跟踪问题:

https://issuetracker.google.com/issues/35172585

如果 YoutubePlayer 已发布,则会发生此异常

根据Youtube SDK documentation关于错误:

public static final YouTubePlayer.ErrorReason UNEXPECTED_SERVICE_DISCONNECTION

Playback has been canceled and the player has been released due to an unexpected disconnection from the YouTube API service. Any further calls to this player instance will result in errors, a new player instance must be created to re-enable playback.

因此,为避免此异常,您已调用(如 youtubePlayer.loadVideo()cueVideo()getCurrentTimeMillis() 等.) 在 try catch block 中捕获 IllegalStateException 异常。

要创建 YoutubePlayer 的新实例,只需调用 catch block 中的 initialize() 方法即可。

例子:

 if (youtubePlayer != null) {
try {
youtubePlayer.loadVideo(videoId);
} catch (IllegalStateException e) {
initialize(API_KEY, this);
}
}

这对我来说效果很好

关于com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.x 处的 android.os.DeadObjectException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44215998/

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