通过谷歌驱动器api恢复视频网址,以在html5播放器中流式传输视频 [英] Recover video url through google drive api in order to stream the video in an html5 player
问题描述
你知道,如果谷歌驱动API提供一个绝对的网址到视频按顺序使用html5播放器流式传输视频? 解决方案
答案将非常类似于这是嵌入图片的。
因此,基本上要获得可嵌入视频的URL,您必须:
获取文件元数据的示例为这里。
如果您的文件已被公开共享,则该URL将可直接访问。如果该文件未公开,您将不得不使用OAuth 2.0授权对该URL的请求。
问题:该URL只能暂时运行。所以它不适用于每个用例。
I see that google drive use a flash player in order to stream uploaded video.
Do you know if google drive api provide an absolute url to the video in order to use an html5 player to stream the video?
The answer will be very similar to this one for embedding images.
So basically to get the URL of the embeddable video you will have to:
- In a Drive application you get the ID of the file through a URL parameter when the user clicks on a file and opens it with your app.
- Query the file metadata using the Drive API and the ID of the file: the file metadata returned is a JSON object containing a bunch of info.
- In the File metadata there is an attribute called "downloadURL" which gives a URL to the actual file.
Samples to get a file metadata are here.
The URL will be directly accessible if your file has been shared publicly. If the file is not public you will have to use OAuth 2.0 to authorize requests to that URL.
Problem: That URL only works momentarily. So it's not usable for every use-case.
这篇关于通过谷歌驱动器api恢复视频网址,以在html5播放器中流式传输视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!