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 播放器时出错"


基础教程推荐
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01