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 播放器时出错"
基础教程推荐
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- Android Volley - 如何动画图像加载? 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
