dev
dev

Reputation: 565

How to play google drive video in jwplayer?

I have been trying fro 2 days to play the googledrive video in jwplayer but no avail. I have watched video tutorials from youtube also tried so many links to do this task but still no success. This is what I am trying.

upload video(mp4) in the folder make the video and folder public get the folder id and video name and replace with this link https://googledrive.com/host/folderid/filename

but it is not working at all.any help?

Upvotes: 0

Views: 3657

Answers (3)

nicwillu
nicwillu

Reputation: 11

New 2022 Solution: Yes, you can! After a lot of fiddling I got it working. You can input a gdrive url for JW to upload, and even bypassing the virus scan popup.

How:

When you want to upload to JW via the API, use “fetch” method as you normally would. This is will be the format for the “download_url”:

Format: googleapis.com/drive/v3/files/FILEID?alt=media&key=APIKEY

Example: googleapis.com/drive/v3/files/acedkgjasd23hgsad?alt=media&key=yusx01plasdpyyyjasudf

The ?alt=media tells google that you are downloading this file. The API key is required for downloads 100mb+ (to bypass virus scan popup). The API key can be created in your Google Console by creating a new project, enabling google drive API (under API & Services), go to the project credentials and create a new api key.

Upvotes: 1

user9081669
user9081669

Reputation:

  1. You can use WordPress Plugin and Play With Video.js & JW Player Style (Skin)
  2. Shortcodes

Google Drive Video & Poster.

[GDPlayer gdrive="https://drive.google.com/file/d/1gNAt_8dBiLmvL9fLpSUQZZlh_ViNKA4l/view" poster="https://ingolin.com/example.png"]

Google Drive Video, Poster & subtitles

[GDPlayer gdrive="https://drive.google.com/file/d/1gNAt_8dBiLmvL9fLpSUQZZlh_ViNKA4l/view" poster="https://ingolin.com/example.png"][track kind="captions" src="https://ingolin.com/wp-content/subtitles.vtt" srclang="en" label="English" default="true"][/GDPlayer]

Demo

Video

Upvotes: 2

VC.One
VC.One

Reputation: 15871

Just provide this link as MP4 source :

http://docs.google.com/uc?id=VIDEO_ID

The VIDEO_ID itself is found in the part of your link as shown below:

https://drive.google.com/file/d/VIDEO_ID/view

(in your case VIDEO_ID begins "0BxqS" and ends with "xbEU")

Edit : (make sure you specify type: "mp4" so JW Player knows the data type).

jwplayer("player").setup ({

file:   "https://docs.google.com/uc?id=0BzIpsk3FR4R1NjlnTWVDOHB2MTQ",
type:   "mp4",
width:  640,
height: 360, 

});

Upvotes: 2

Related Questions