在Android TV中使用Youtube API [英] Use Youtube API in Android TV

查看:175
本文介绍了在Android TV中使用Youtube API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Android TV APP中播放youtube视频. 我也在开发Android手机/平板电脑APP,并且能够使用Youtube Android API播放视频. 但是,当我尝试在Android TV上使用相同的API时,却​​出现了错误消息(除非您更新YouTube,否则此应用程序将无法运行"),但是我的youtube已更新.

我在YouTube Android中发现了问题播放器API问题跟踪器,这是我在这里面临的相同问题,因此我想知道是否有人可以解决方案,或者想知道其他版本的API可能有效.我正在使用YouTube Player Android API v1.2.2.

我知道我可以通过Intent打开youtube,但是我需要使用YouTube API来显示视频.

解决方案

我与您有相同的理解. YouTube API仅适用于智能手机YouTube应用,不适用于Android TV YouTube应用. 我认为,如果您打算发布Android TV应用程序,那么除了Intent之外,您现在无法使用YouTube Player Android API.因为您应该期望用户安装Android TV YouTube应用.

作为参考

  • 总结了YouTube Android Player API的当前行为此处.
  • 源代码,该代码使用YouTube Intent在Android TV中播放YouTube视频.

I want to play youtube videos in my Android TV APP. I am also working on a Android phone/tablet APP and I was able to use Youtube Android API to play videos. But when I try to use the same API on Android TV it gives me an error ("This app won't work unless you update the YouTube"), but my youtube is updated.

I found this issue in the YouTube Android Player API issue tracker, it is the same problem that I am facing here, so I want to know if someone have a solution, or know another version of the API that may work. I am using YouTube Player Android API v1.2.2.

I know that I can open youtube via Intent, but I need to use the YouTube API to show videos.

解决方案

I have the same understanding with you. YouTube API works only smartphone YouTube app and not for Android TV YouTube app. I think if you are thinking of publishing Android TV app, you cannot use YouTube Player Android API except Intent for now. Because you should expect user installs Android TV YouTube app.

For reference,

  • Current behavior of YouTube Android Player API is summarized here.
  • Source code which uses YouTube Intent to play YouTube video in Android TV.

这篇关于在Android TV中使用Youtube API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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