显示来自特定频道的 Youtube 视频

Displaying Youtube Videos From Specific Channel(显示来自特定频道的 Youtube 视频)

本文介绍了显示来自特定频道的 Youtube 视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 youtube 频道并在那里上传了一些视频.频道是公开的,现在我想通过频道 URL 在我的 android 应用程序中显示所有上传的视频,即:https://www.youtube.com/channel/UCjD0Dhs3o7UiUQdZpSBADAA

I have created a youtube channel and uploaded few videos there. Channel is public, now i want to display those all uploaded videos in my android app through channel URL which is: https://www.youtube.com/channel/UCjD0Dhs3o7UiUQdZpSBADAA

我也做了一些研究,但我得到了通过硬编码 id 显示视频的教程,而不是来自频道,例如:https://github.com/youtube/yt-android-player

I have also done some research but i am getting tutorial to display videos by hardcoded ids not from channel for example: https://github.com/youtube/yt-android-player

任何人指导我这可能吗?我真的很感谢你在这件事上的帮助.

Any one guide me is it possible? i would really appreciate your help in matter.

谢谢!

推荐答案

在阅读了不同的 Youtube api 之后,我发现以下步骤可以在您的 Android 应用中使用 Youtube 频道视频.

After reading different Youtube apis i found following steps to consume Youtube Channel Videos in your Android app.

1) 在您的 Google 帐户中创建一个应用程序2) 启用 youtube 服务3)然后您将获得开发者密钥

1) Create an application in your Google Account 2) Enable youtube services 3) and then you will get developer key

使用该开发者密钥进行 api 调用.

use that developer key to make api calls.

4)

String url = "https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&id=UCjD0Dhs3o7UiUQdZpSBADAA&key=" + DeveloperKey.DEVELOPER_KEY;

使用上述 URL 中的频道 ID 和开发者密钥来获取您频道下的视频列表.

Use cannel id in above URL along with developer key to get list of videos under your channel.

5) 您将获得每个视频的基本信息,但您仍然无法在您的 android 视频播放器中播放该视频,您必须拥有 RTSP 网址

5) You will get basic information of each video but still you cannot play that video in your android video player in order to do that you must have RTSP url

您可以通过将视频 ID 传递给 http://gdata.youtube.com/feeds/mobile/videos/1FJHYqE0RDg

and that url you can obtain by passing video id to http://gdata.youtube.com/feeds/mobile/videos/1FJHYqE0RDg

就是这样.

这篇关于显示来自特定频道的 Youtube 视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:显示来自特定频道的 Youtube 视频