不公开的youtube视频的视频链接 [英] Video link of unlisted youtube video

查看:996
本文介绍了不公开的youtube视频的视频链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Android应用程序,该应用程序可以流式传输并显示几个视频.我认为不是将视频存储在服务器上,而是以不公开的方式将它们上传到youtube,并从youtube获取它们是一个好主意.取得视频后,我想在默认的Android视频播放器中显示它们,而不是在youtube应用或网络视图中显示它们.

I am developing an android application that streams and shows a couple of videos. Instead of storing videos on my server, I thought uploading them to youtube as unlisted, and getting them from youtube is a great idea. After getting the video, I want to show them in default android video player, not in youtube app or web view.

将视频放入服务器(例如www.mysite.com/video.mp4)时,我没有任何问题,但是有什么方法可以获取youtube视频的网址?

I don't have any problem when I put videos in my server (for example www.mysite.com/video.mp4), but is there any way to get the url of a youtube video?

推荐答案

您可以使用YouTube数据API v3上传视频:

You can upload the videos using the YouTube Data API v3:

https://developers.google.com/youtube/v3/docs/视频/插入

并将 status.privacyStatus 设置为未列出

然后,您可以使用YouTube Android Player API在自己的Android应用中添加视频播放器

Then you can use the YouTube Android Player API to include the Video Player on your own Android App

https://developers.google.com/youtube/android/player/

要播放视频,您只需要视频ID,而无需完整的网址.

To play a video, you only need the video ID, not the full url..

例如:

player.loadVideo("wKJ9KzGQq0w");

这篇关于不公开的youtube视频的视频链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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