Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive - Video Streaming

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.

like image 978
metal7 Avatar asked Aug 28 '13 03:08

metal7


People also ask

Can I stream video from Google Drive?

You can easily share a video on Google Drive with other users. If you share a video with a user on Google Drive, they must have the appropriate permissions set up to watch or download it. You can share a video on Google Drive with a specific person, anyone with a sharing link, or even the general public.

Can I stream MP4 from Google Drive?

Google Drive has a built-in MP4 video player that works on all devices including computer, Android, iPhone, and iPad. All you need to do is to install the Google Drive app on these devices or use the web interface to watch and play MP4 in Google Drive.

How do I enable Google Drive streaming?

Open Google Drive and select "Download Drive File Stream for Windows" under Settings. Select the "Download for Windows" blue button. The DriveFileStream.exe is now in Downloads and can be used to install File Stream. Execute (Open) the file.


2 Answers

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 then gives me a link to share that looks like

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

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

0B4BsAbG4atWHQzVfLUU3UnhhZTA

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'/>

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>

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.

UPDATE

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.

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

like image 78
Aidan Ewen Avatar answered Dec 07 '22 10:12

Aidan Ewen


Use the URL like this:

https://googledrive.com/host/{YOUR_VIDEO_ID}

e.g. https://googledrive.com/host/01bLAblaBla01BlaBLaBlaBLaBLA

It's works with HTML5 (video tag) and other like videojs, and more...

like image 37
seq Avatar answered Dec 07 '22 09:12

seq