android - 当我使用 YoutubePlayer.loadVideo 时出现异常
问题描述
当我调用 YoutubePlayer.loadVideo() 方法时出现异常。
以下是我正在使用的代码:
onInitializedListener=new YouTubePlayer.OnInitializedListener()
{
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult result) {
Log.d("onInitializationFailure","Unable to load");
}
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) {
//player.loadVideo(strVideoURL);
player.cueVideo(strVideoURL,1);
}
};
以下是我在 androidstudio 中遇到的异常(由于此异常,它只显示空白黑屏,之后我也无法调用任何其他视频):
01-08 23:00:11.868 32736-3385/? E/YouTubeAndroidPlayerAPI: Failed to construct CronetEngine. Using fallback Java implementation.
java.lang.IllegalStateException: Disk cache storage path already in use
at org.chromium.net.impl.CronetUrlRequestContext.<init>(SourceFile:49)
at awpo.a(SourceFile:5)
at awkn.a(SourceFile:18)
at vot.a(SourceFile:24)
at vov.get(SourceFile:16)
at autw.get(SourceFile:9)
at lfx.M(SourceFile:140)
at lfh.get(SourceFile:4)
at vrf.c(SourceFile:78)
at vrf.run(SourceFile:27)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at vgy.run(SourceFile:12)
at java.lang.Thread.run(Thread.java:764)
解决方案
我最近观察到当我在活动之间导航时得到空的“strVideoURL”。所以我们得到黑屏的原因。
在这里分享,因为这可能有助于了解他们的错误。
谢谢
推荐阅读
- java - 维护与服务器端服务的套接字连接对于向桌面应用程序发送通知是否不利?
- java - 仅在提交搜索后显示 Recyclerview
- python - 如何自定义pythonic损失函数并在keras中使用更长的y_true来计算?
- azure-timeseries-insights - 对复合时间序列 ID 建模
- c++ - 模板化概念作为 C++20 中的编译时接口
- php - 引导程序 4,列表组,搜索所有但显示有限行
- python - python - 使用具有相同索引的另一个数据框替换数据框中的值
- python - 计算字符串中的公式
- java - Java 11 HttpClient 间歇性挂起
- unix - 数据阶段挑战