也是Android的Youtube API使用的官方YouTube应用程序,用于播放视频?也是、应用程序、官方、视频

2023-09-08 00:20:15 作者:懂事了

我用的Youtube API 为Android开发的应用程序。即使我创建的应用程序,它工作正常。我还是没能找出这个API确实

I used Youtube api for android to develop an app. Even though i create app and it works fine. Still i was not able to Find out what this api really do

1)当我在设备的Andr​​oid 2.2首次运行它。它迫使我下载新updtaes的 YouTube官方应用从谷歌Play商店。之后,它工作正常,并没有要求进一步updation或YouTube应用程序下载。那么,YouTube的API使用YouTube应用palying视频 通过将通过API codeI发现了一些东西。

1) When i run it on device android 2.2 for first time . It force me to download new updtaes for Official YouTube app from Google play store . After that it works fine and didn't ask for further updation or download of YouTube app . So is YouTube api uses Youtube app for palying video By going through the api code i found out something

public static Intent createVideoIntent(Activity paramActivity, 
String paramString1, String paramString2, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
{
   return a(newIntent("com.google.android.youtube.api.StandalonePlayerActivity.START").putExtra
        ("video_id", paramString2), paramActivity, paramString1, paramInt, paramBoolean1, paramBoolean2);
}

当我进去看看YouTube应用程序codeI找到活动类 StandalonePlayerActivity 。但是,在播放视频时使用UI容器由我设计的 com.google.android.youtube.player.YouTubePlayerView 是的Youtube API的一部分内。那么,什么是API和做上述活动类(StandalonePlayerActivity),什么是它的作用?

When i look inside YouTube app code i find a activity classnamed StandalonePlayerActivity. But the video is playing inside the UI container designed by me using com.google.android.youtube.player.YouTubePlayerView which is a part of Youtube api . So what is api doing with the above activity class(StandalonePlayerActivity), what is its role?

2)它没有在Android 2.1的工作,为什么会这样?

2)It didn't work on Android 2.1 ,why is it so ?

请人解释一下吗?

推荐答案

YouTube的API用于YouTube的播放添加到您的应用程序。这意味着你可以将您的应用程序的界面中嵌入YouTube视频。是的,它需要安装的YouTube客户端官方,因为那是将会给您的播放code和播放视频的能力。但你并不需要运行它,视频将是你的应用程序中。

The YouTube API is used to add YouTube playback to your app. Which means you will be able to embed a YouTube video within the interface of your app. Yes, it does need the official YouTube client to be installed, since that's what will be giving you the playback code, and the ability to play videos. But you don't need to run it, the video will be within your app.

我没有检查,但它是合乎逻辑的假设 com.google.android.youtube.player.YouTubePlayerView 在YouTube的官方应用程序实现了一个视图,即在使用YouTube API,它会被渲染视频您的应用程序将被注入。就这么简单。

I haven't checked, but it's logical to assume that com.google.android.youtube.player.YouTubePlayerView is a View implemented in the YouTube official app, that will be injected in your app using the YouTube API, which will be rendering the video. Simple as that.

关于你的最后一个问题 - 在的YouTube API文档未提及这将是可用在运行Android 2.2(升级Froyo)设备

Regarding your last question - the YouTube API docs does mention it will be available on devices running Android 2.2 (Froyo)