- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我遇到了这个问题,我没有任何情况报告为 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/
每当我尝试在我的应用程序中打开 Youtube 播放器时,总是会调用 onInitializationSuccess() 函数。但它显示一个空白屏幕。 首先出现这个错误: W/YouTubeAndro
我已将我的依赖项更改为 import com.android.support:appcompat-v7:23.0.1 和 com.android.support:design:23.0.1 但这并不能
我正在尝试在我的应用程序中播放 Youtube 视频,但失败并在屏幕上显示错误“初始化 YouTube 播放器时发生错误” 我已经使用 SHA-1 key 生成 API key ,我认为它已成功生成,
我遇到了这个问题,我没有任何情况报告为 20 次:我有 youtube jar,因为版本号是: list 版本:1.0 名称:com/google/android/youtube/player 规范标
我是一名优秀的程序员,十分优秀!