Tuesday, July 11, 2017

Play Google Drive Video in JW Player And Get Direct Link For Google Drive Video

1 comment

I want to PLay google drive videos in JW player in my website .I know it is possible because a lot of websites doing this e.g fmovies

Is there any API or piece of code through which i can achieve this URL for google drive video https://redirector.googlevideo.com/videoplayback?id=4d0be5bc491e2dd7&itag=18&source=webdrive&requiressl=yes&ttl=transient&pl=21&mime=video/mp4&ipbits=0&sparams=api,expire,id,ip,ipbits,itag,mime,mm,mn,ms,mv,pl,requiressl,source,ttl&api=FsxSHTiLgbCln6EzpdilVgW6JQxNqam8I5YPHEFLs3E=&cms_redirect=yes&expire=1499015322&ip=37.187.148.42&mm=30&mn=sn-25ge7ney&ms=nxu&mt=1499000741&mv=m&signature=658276E5F00AAFD155876EC75453507DE10DDEDB.7FAD65986F21E14B5FAFB6E145252310F86A10B6&key=cms1&app=storage

I already tried juicy API but its not working for me

4 Answers

Answers 1

If you just want to stream a video from Google drive then this can be done - you can see a working example here:

You can see exactly how it is coded by right clicking and inspecting in your browser

<video controls="controls" style="margin-bottom:20px;width:590px">              <source src="https://drive.google.com/uc?export=download&amp;id=0B0JMGMGgxp9WMEdWb1hyQUhlOWs" type="video/mp4">  </video> 

To create a signed URL for Google cloud storage programatically you need to follow their instructions at the link below - I have not copied or summarised them here as, if the similar AWS mechanism is anything to go by, the approach can change often and it is best to always check the latest official documentation:

Answers 2

It's easy

  1. Upload your video

  2. Make video sharable to public

  3. Open the link and inspect the video you'll find the video tag from where you can take the video file link.

Answers 3

You can try this Perl script to get the direct download link. If you want to play it in JWPlayer, you'll have to run the script from the server to get the link, then insert that link into the HTML.

https://circulosmeos.wordpress.com/2014/04/12/google-drive-direct-download-of-big-files/

Files hosted at Google Drive service can be shared publicly. Nevertheless, if they’re too big, Google pages advice that “Google Drive can’t scan this file for viruses” and ask the user for confirmation in order to proceed with the download.

If for any reason you’re trying to do an unattended download of the file or downloading it on a resource-limited environment, this will prevent direct use of the link.

Here is the script

https://github.com/circulosmeos/gdown.pl

However, the script downloads the file to the filesystem, so you'll have to modify it so on the last URL re-direct, you save the final URL instead of downloading it.

Answers 4

Just an idea: You don't need JW player or PHP, I's all baked into browsers (HTML5) these days. Here's an example of how to do it (with Google's Material Design UI). Just plain old HTML/CSS/JS.

https://github.com/rhroyston/mdl-audio

If You Enjoyed This, Take 5 Seconds To Share It

1 comment: