Android YouTube API quot;An error occurred while initializing YouTube playerquot;(Android YouTube API“初始化 YouTube 播放器时出错)
问题描述
我有一个安卓应用,可以播放 youtube 视频.我正在使用最新的 YouTube API (1.2.1).我在 android 版本 4.0.4、4.3、4.4.4 或 5.0 内的几台设备上试用它,它运行良好(在每台设备上都是 YouTube 应用程序版本 10.-.但在一台设备上,android 4.0.4 和 YouTube 在哪里应用程序版本 4.4.11 它不起作用并出现错误初始化 YouTube 播放器时发生错误".在文档中,YouTube 应用程序的最低要求版本是 4.2.16.所以我不知道,在哪里问题.
I have an android app, which allows to play youtube video. I am using the latest YouTube API (1.2.1). I try it on a several devices within android version 4.0.4, 4.3, 4.4.4 or 5.0 and it works perfect (on every device is YouTube app version 10.-. But on one device, where is android 4.0.4 and YouTube app version 4.4.11 it does not work and get an error "An error occurred while initializing YouTube player". In documentation is written, that the minimal required version of YouTube app is 4.2.16. So I don't know, where is the problem.
有人有什么想法,出了什么问题或我该如何解决?
Does somebody have an idea, what is wrong or how can I fix it?
非常感谢...
推荐答案
由于包可见性过滤
有限的应用可见性会影响提供其他应用信息的方法的返回结果,例如 queryIntentActivities()、getPackageInfo() 和 getInstalledApplications().有限的可见性也会影响与其他应用的显式交互,例如启动另一个应用的服务.
The limited app visibility affects the return results of methods that give information about other apps, such as queryIntentActivities(), getPackageInfo(), and getInstalledApplications(). The limited visibility also affects explicit interactions with other apps, such as starting another app's service.
更多信息:https://developer.android.com/training/package-visibility
将以下代码行添加到您的 AndroidManifest.xml 文件中
Add the below lines of code into your AndroidManifest.xml file
<queries>
<intent>
<action android:name="com.google.android.youtube.api.service.START" />
</intent>
</queries>
这篇关于Android YouTube API“初始化 YouTube 播放器时出错"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android YouTube API“初始化 YouTube 播放器时出错"


基础教程推荐
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- Android文本颜色不会改变颜色 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
- 如何使用 YouTube API V3? 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01