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.
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.
As of Aug. 2014, I can stream video (mp4 or webm) from GDrive to many devices (Nexus7, MacBook Air, iPad Air, Windows PC) using any modern browser (Chrome, Firefox, Safari) *without* being logged into a Google account. I play the videos in an HTML5 video element.
– devdankeAug 11 '14 at 08:38
@devdanke You can do it by just replace your video file id in last of this url given below;
https://drive.google.com/uc?export=download&id=
– Saeed AfzalMar 06 '15 at 01:55
1
Well, if the video file is bigger than the virus scan limit (~25MB) a warning about the file not being scanned therefore may contain virus will be returned instead of the correct video file. This prevents the browser from playing correctly.
– Johnson StewardAug 03 '17 at 06:59
@seq - this with audio tag doesn't work for me can you please take a look at my question here : http://stackoverflow.com/questions/41904057/html5-website-hosted-on-hostinger-playing-an-audio-file-in-google-drive thanks
– Kukula MulaJan 27 '17 at 22:32
Probably Google disabled this opportunity. I had to buy web hosting service. It was almost two years ago.
– seqOct 24 '18 at 20:25
4
None of the these solutions work anymore. This works. The viewer does not need to be logged into their Google account to view the video.
Get the shareable link to your video by clicking on the video in your Google drive, and click on that paper clip-like icon in the top link
Turn link sharing on
Open the link
In the video, click on the three dots icon on the upper right, and then click on 'Embed item'. You'll then have the code you can put into your HTML. It'll look something like this:
Internally when viewed in Google Drive's web page viewer, Google Drive streams videos over HTTPS/443. There is only one connection made for the video itself and that connection is kept open as long as the video is being streamed from Google Drive to the client.
Google Drive uses an HTTP CONNECT call. Headers look like this:
CONNECT r3---sn-p5qlsu68.c.docs.google.com:443 HTTP/1.1
Host: r3---sn-p5qlsu68.c.docs.google.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36
We can access the video like this in HTML5- . The file-id is available from Google Drive when we click on share video. The file should be shared in order to access the stream.
– metal7Aug 28 '13 at 04:55
Also I was able to rerieve a link like https://r5---sn-a5meknel.c.docs.google.com/videoplayback?expire=1553697376&ei=IFKbXNqvOZXaugXlirXIAg&ip=76.90.101.113&cp=QVNKVUdfVlNVR1hOOmxfX2NzM2dmclZmcWQ0U1hDaDZqVVhhUGRhMm5VX1BsaU1qTDVLV2NfVTc&id=993b57952e128cec&itag=59&source=webdrive&requiressl=yes&mm=30&mn=sn-a5meknel&ms=nxu&mv=u&pl=20&ttl=transient&susc=dr&driveid=1Cyuh41yNfYZU_zL-MHLf_EPJCYnlT7oJ&app=explorer&mime=video/mp4&...(etc) but when I try to open it in another browser I get a 403 error, any ideas?
– B''H Bi'ezras -- Boruch HashemMar 27 '19 at 10:42
1
I did some tests myself, and the video is streamable (over HTTP) to public clients so long as the file is shared publicly on Google Drive.
The get the file to play using regular HTTP streaming, you can use the HTML5 video tag like so:
I don't think this method is working anymore unfortunately. On their webpage you linked to, the video doesn't play. And when I test with my own video, its not working for me in chrome.
– bmiskieFeb 12 '18 at 21:37