无法使用 YouTube Android Player API 播放某些 Youtube 视频 [英] Unable to play some Youtube videos using YouTube Android Player API

查看:21
本文介绍了无法使用 YouTube Android Player API 播放某些 Youtube 视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,此视频无法使用 Youtube 播放器 API 播放:https://www.youtube.com/watch?v=OLK1efdt3n8(来自搜索响应的其他视频正常)

For example this video can't be played with Youtube player API : https://www.youtube.com/watch?v=OLK1efdt3n8 (other videos from search response works ok)

我收到以下消息:

09-25 17:18:50.226  24280-24280/com.mypackagename W/YouTubeAndroidPlayerAPI﹕ Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API.
09-25 17:19:05.911  24280-24280/com.mypackagename E/YoutubePlayerFragment﹕ video error : INTERNAL_ERROR

YouTubePlayer API 版本:1.2.1(最新)

YouTubePlayer API version : 1.2.1 (latest)

设备上的 YouTube 应用是最新的并且可以播放此视频

YouTube app on device is up to date and able to play this video

视频参数:videoEmbeddable=true videoSyndicated=true

推荐答案

对我来说,问题是我只能播放一次视频,但之后 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).

这篇关于无法使用 YouTube Android Player API 播放某些 Youtube 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆