Video.js: How to add/Used Google Drive video in Video JS ?

Created on 12 Apr 2015  ·  19Comments  ·  Source: videojs/video.js

I want to use video stored in google drive in Video js . But In google drive, video links are given without extension .mp4. But They can be stream. Example : https://docs.google.com/file/d/0B-zKk5F6hm6rOXJicnBSOHIyd28/edit.

I do not know how to add on Videojs . But in some website , I found they used picasa video in Video.JS with resolution selector . Their used code:

I want to know how to use with google drive video with resolution selector like 360p, 480, 720p and 1080p.
Note : I am using wordpress .

Help me or Talk to me how to do it.

Most helpful comment

The method that works for me when getting file id's is:

  • Upload video file (for example)
  • Click on file to open it.
  • Click on the dots menu in the top right-hand corner
  • Click Open in new window
  • Copy the file id from the new window
  • Use the link in this format:

https://drive.google.com/uc?export=download&id=long-file-id-here

(Make sure the file is shared of course).

Edit: Unfortunately, I get an error with file sizes around 59MB:

VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported.

Does anyone know an alternative way of hosting video files that works well with Google Apps Script?

All 19 comments

If there's any way you can get a direct link to the asset, that's going to be ideal. Otherwise I'm fairly sure Google Drive will embed using the YouTube player.

But how some site are using picasa video ? They are also same as google drive video.

@mmcc , But how some site are using picasa video ? They are also same as google drive video.

You might want to try viewing their source to see how they're doing it. This is pretty specific to Google Drive / Picasa and not Video.js, so this tracker probably isn't your best bet in terms of answer.

Yo can modify the Google Drive URL to get a direct link - see e.g. http://www.labnol.org/internet/direct-links-for-google-drive/28356/

<source src="https://drive.google.com/uc?export=download&id=0B-zKk5F6hm6rOXJicnBSOHIyd28" type='video/mp4'>

Do we have any way to use google drive embed in VideoJS?
I do try to use this:
https://drive.google.com/uc?export=download&id=FILE_ID
But it have problem when file is big.
And I also try with.
https://googledrive.com/host/FILE_ID, however google will close this service.

So can use the embed iframe like this to play in VideoJs?

It would depend on whether google provides an API for those embeds. If yes a tech like videojs-youtube can be made, otherwise, you wouldn't be able to control it with the videojs controls.

Here the sample embed link which provide by google drive:

<iframe src="https://docs.google.com/file/d/FILD_ID/preview" width="640" height="480"></iframe>

So how can we use it in VideoJS?

I edited your message to code fence the iframe.
Unfortunately, just the iframe doesn't allow us to do anything. Does google provide a way to communicate with the player inside the iframe? For example, youtube has a js file you can load that lets you talk to the iframe.

You have to get mp4 link before videojs, demo: http://demo.getlinkdrive.com/videojs.php
Code get link mp4 google drive here: http://getlinkdrive.com/code-get-link-google-drive-ipv4-cap-nhat-12-2016/

May I know any _open source_ method that is able to get the link from Google Drive?
It seems to me the link provided from @yousef31 and @phambanhan is closed source...

The method that works for me when getting file id's is:

  • Upload video file (for example)
  • Click on file to open it.
  • Click on the dots menu in the top right-hand corner
  • Click Open in new window
  • Copy the file id from the new window
  • Use the link in this format:

https://drive.google.com/uc?export=download&id=long-file-id-here

(Make sure the file is shared of course).

Edit: Unfortunately, I get an error with file sizes around 59MB:

VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported.

Does anyone know an alternative way of hosting video files that works well with Google Apps Script?

it will give 360,480,720,1080(redirector link) size or embed youtube player?

Currently i use getlinkdrive api

I wonder if private files are capable to do so?

2017年2月6日 下午1:05 於 "Brandan White" notifications@github.com 寫道:

it will give 360,480,720,1080(redirector link) size or embed youtube
player?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/videojs/video.js/issues/2027#issuecomment-277587653,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABzIHdy-LGSPxPVA-UkWPV-VsFBPtKm-ks5rZqowgaJpZM4D_B8L
.

Hi all,

Just replace your G Drive video id=YOUR VIDEO ID

Hope this helps

Add:

Video

create your free google drive player here http://free-embed.com
make your player google drive freeeeeeeee :D

create your free google drive player here http://free-embed.com

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeonghwaYoo picture jeonghwaYoo  ·  3Comments

onigetoc picture onigetoc  ·  4Comments

borm picture borm  ·  3Comments

dingyaguang117 picture dingyaguang117  ·  4Comments

cshah123 picture cshah123  ·  4Comments