无法加载现代控件 UI.升级到最新版本的 Android YouTube API

Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API(无法加载现代控件 UI.升级到最新版本的 Android YouTube API)

本文介绍了无法加载现代控件 UI.升级到最新版本的 Android YouTube API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Android Youtube API.一切正常,除了当我扩展 AppCompatActivity 时.YoutubePlayer 的 UI 看起来很糟糕.我尝试了 YoutubePlayerFragmentYoutubePlayerSupportFragment.没有任何效果.
logcat如下:

I'm trying to use Android Youtube API. Everything works ok excepts that when I extends AppCompatActivity. The UI of YoutubePlayer looks so bad. I tried both of YoutubePlayerFragment and YoutubePlayerSupportFragment. Nothing works.
The logcat is like below:

W/YouTubeAndroidPlayerAPI: Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API.

我已经更新了最新的 youtube api 1.2.2.但它仍然无法正常工作.
奇怪的是,如果我扩展 FragmentActivityActivity,它可以工作.
请帮忙.提前致谢.

I already updated the latest youtube api 1.2.2. But It's still not working.
The weird thing is that If I extend FragmentActivity or Activity, It works.
Please helps. Thanks in advance.

推荐答案

对我来说,问题是我只能播放一次视频,但之后 YouTubePlayer 无法播放任何视频,我希望还有很多其他人谁也面临与 YouTubeAndroidPlayerAPI 类似的问题.我认为最新的 youtube 应用(版本 10.37.58)和 YouTubeAndroidPlayerAPI 1.2.1 不兼容.

For me the issue is that I am able to play the video only once but after that YouTubePlayer doesn't play any video and I hope there are many other people who are also facing similar issues with the YouTubeAndroidPlayerAPI. I think the latest youtube app (version 10.37.58) and YouTubeAndroidPlayerAPI 1.2.1 are not compatible.

据我所知,您目前唯一可以解决此问题的方法是将设备上安装的 youtube 应用降级到 10.36.52 或更低版本.(可以从apk镜像获取)

To best of my knowledge the only thing you can do currently to solve this problem is downgrade your youtube app installed on the device to 10.36.52 or below. (you can get it from apk mirror)

我在使用 YouTubeAndroidPlayerAPI 时注意到的是,在 youtube 版本 10.36.52 中,它会抛出警告消息无法加载现代控件 UI.升级到最新版本的 Android YouTube API."每次我尝试播放视频时都在 logcat 上,但其他工作正常.对于 10.35.53 及以下版本,不会引发此类警告消息.

From what I have noticed while working with YouTubeAndroidPlayerAPI is that with the youtube version 10.36.52 it throws warning messages "Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API." on the logcat everytime I try to play a video but otherwise works fine. And with version 10.35.53 and below no such warning message is thrown.

原因:我不确定,但我认为这与 YouTubeAndroidPlayerAPI 1.2.1 中的 YoutubePlayerSupport 片段的巨大内存泄漏问题有关,该片段广为人知并在 google data api 问题跟踪器中报告.它终于在上个月的 9 月 1 日得到修复(至少这是目前的状态),在它被报道一年后(惊讶地看到谷歌花了这么长时间).然而,谷歌尚未推出带有修复程序的新版 YouTubeAndroidPlayerAPI.所以也许他们在 9 月份修复了 youtube 应用程序中的内存问题,这在某种程度上破坏了 YouTubeAndroidPlayerAPI 1.2.1 的功能(因为 YouTubeAndroidPlayerAPI 直接依赖于 youtube 应用程序才能工作).

Reason: I am not sure but I think this has something to do with the huge memory leak issue with the YoutubePlayerSupport fragment in YouTubeAndroidPlayerAPI 1.2.1 which was widely known and reported in google data api issue tracker. It was finally fixed last month on 1st September (at least that's what the current status says) after a year since it was reported (surprised to see what took google so long). However google hasn't rolled out the new version of YouTubeAndroidPlayerAPI with the fix yet. So maybe they fixed that memory issue in the youtube app in September which some how broke the functionality of YouTubeAndroidPlayerAPI 1.2.1 in some way (since YouTubeAndroidPlayerAPI directly depends on the youtube app to work).

这篇关于无法加载现代控件 UI.升级到最新版本的 Android YouTube API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:无法加载现代控件 UI.升级到最新版本的 Android YouTube API

基础教程推荐