Video link of unlisted youtube video

狂风中的少年 提交于 2019-12-08 12:25:38

问题


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.

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?


回答1:


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

https://developers.google.com/youtube/v3/docs/videos/insert

And setting the status.privacyStatus as unlisted

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/

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

eg:

player.loadVideo("wKJ9KzGQq0w");


来源:https://stackoverflow.com/questions/16430530/video-link-of-unlisted-youtube-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!