Google 云端硬盘 - 视频流 [英] Google Drive - Video Streaming

查看:30
本文介绍了Google 云端硬盘 - 视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google 云端硬盘视频流如何工作?它在内部如何流式传输视频,是否使用基于 HTTP 的流式传输或其他协议?我对此很陌生,我想知道 Google Drive 是否可以用作演示服务器来获取视频流并显示在网页上.如果有人能给我提供这方面的信息,那将非常有帮助.

How does Google Drive video streaming work ? Internally how does it stream the video, does it use HTTP based streaming or other protocols? I am very new to this, and I was wondering if Google Drive could be used as a demo server to just get a stream of video and display on the webpage. If anyone could give me information about this, it would be very helpful.

推荐答案

好的,我刚刚设法让这个工作如下 -

OK, I've just managed to get this working as follows -

在谷歌驱动器中,我将视频文件放在一个公开共享的文件夹中,然后右键单击该文件并选择共享 > 共享..

In google drive I placed the video file in a publicly shared folder then rightclick the file and select share > share..

Google 然后给了我一个分享链接,看起来像

Google then gives me a link to share that looks like

https://docs.google.com/file/d/0B4BsAbG4atWHQzVfLUU3UnhhZTA/edit?usp=sharing

我已经从 URL 中删除了我猜测的文件 ID -

I've cut what I guessed to be the file ID from the URL -

0B4BsAbG4atWHQzVfLUU3UnhhZTA

并将其添加到 metal7 的 url 以创建源标签的 src 属性

And added it to metal7's url to create a src attribute for a source tag

<source src="https://drive.google.com/uc?export=download&id=0B4BsAbG4atWHQzVfLUU3UnhhZTA" type='video/webm'/>

现在我有一个使用以下 html 的视频.

Now I've got a video working with the following html.

<html>
<head>
    <title>Video Test</title>
</head>
<body>
    <video controls="controls">
        <source src="https://drive.google.com/uc?export=download&id=0B4BsAbG4atWHQzVfLUU3UnhhZTA" type='video/webm'/>
    </video>
</body>
</html>

很多人似乎建议创建一个 API 应用程序来获取文件 ID,但看起来您很容易猜到.也就是说,我有兴趣从谷歌那里看到一些适当的文档 - 我想在生产中使用它,但我觉得我需要做更多的阅读才能有信心.

A lot of people seem to be suggesting creating an API app in order to get the file ID, but it looks like you can guess it pretty easy. That said, I'd be interested to see some proper documentation from google on it - I want to use this in production, but feel like I need to do more reading to be confident.

更新

我已经阅读了更多内容,但恐怕该视频只能在登录 Google 帐户的浏览器上播放.我花了很多时间试图解决这个问题(包括使用 api 构建一个谷歌驱动器应用程序),恐怕看起来没有办法解决它.

I've done a bit more reading and I'm afraid the video will only play on browsers that are logged into a google account. I spent a lot of time trying to get around this (inc building a google drive app with the api), I'm afraid it looks like there's no way round it.

除非您知道所有用户都将通过 google 进行身份验证,否则不要使用 google drive 提供 html 格式的视频.

Don't use google drive to serve up video in html unless you know all your users will be authenticated with google.

这篇关于Google 云端硬盘 - 视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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