Is Android Youtube API Using Official Youtube App for playing video?(Android Youtube API 是否使用官方 Youtube 应用程序播放视频?)
问题描述
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) 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);
}
When i look inside YouTube app code i find a activity class
named 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)It didn't work on Android 2.1 ,why is it so ?
Please somebody explain this?
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.
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.
Regarding your last question - the YouTube API docs does mention it will be available on devices running Android 2.2 (Froyo)
这篇关于Android Youtube API 是否使用官方 Youtube 应用程序播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android Youtube API 是否使用官方 Youtube 应用程序播放视频?
基础教程推荐
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01