Android YouTube API“初始化 YouTube 播放器时出错" [英] Android YouTube API "An error occurred while initializing YouTube player"

查看:23
本文介绍了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 播放器时出错"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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