【问题标题】:Getting exception when i use YoutubePlayer.loadVideo当我使用 YoutubePlayer.loadVideo 时出现异常
【发布时间】:2019-01-08 17:42:59
【问题描述】:

当我调用 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)

【问题讨论】:

  • 有人可以帮我解决上述问题吗?我观察到的是,当我点击我的视频时,它播放得很好。当我点击第二个视频时,我得到黑屏,从那里我没有得到任何视频正在工作,得到与上述相同的错误。

标签: android android-youtube-api


【解决方案1】:

我最近观察到,当我在活动之间导航时,“strVideoURL”为空。所以我们得到黑屏的原因。

在这里分享,因为这可能有助于找出他们的错误。

谢谢

【讨论】:

    猜你喜欢
    • 2014-12-07
    • 2016-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-15
    • 2015-02-05
    相关资源
    最近更新 更多