Embedding Google Drive Videos using HTML5 video

32,036

Solution 1

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

Replace "videoID" in the link with your video ID. (to find it - right click on the Google Drive video, get shareable link)

Solution 2

I wrote an answer to a similar question not long ago. It's a pretty straight-forward procedure and works on files of any size. If you have any questions, feel free to ask in the comments.

Share:
32,036
kpjVideo
Author by

kpjVideo

Updated on September 22, 2020

Comments

  • kpjVideo
    kpjVideo over 3 years

    I am searching for a way to embed Google Drive videos using the HTML5 <video> tag. The current option isn't exactly adequate for what I'd like to do with the player. The embedded link directly from Google Drive doesn't seem to allow you to remove the button that opens the video in a separate tab nor customize the appearance of the player. Are there any ways to get the actual file from a drive link and embed it into an HTML <video> tag?

    I'm aware of such "proxy player" scripts but they appear very sketchy and pricey. The old methods such as getting the download link no longer work nor does the /get_player method. Any insight would be much appreciated.

  • Mr. Boy
    Mr. Boy almost 5 years
    I see a player but no playable video in your example @pejey. Is it broke or is the video no longer valid?
  • pejey
    pejey almost 5 years
    I removed the video, sorry. Here is a new example - jsfiddle.net/xav8kufe
  • YTZ
    YTZ almost 5 years
    -1 Please note that this will only work with small files ( < 100 MB ). 1) Google Drive requires a confirm parameter if the file is > 100MB, which you can't know beforehand. 2) You're basically "downloading" the video into the player. The video player can break if user tries to seek further into the video.
  • Sayooj
    Sayooj over 4 years
    use this to convert Google drive link to direct downloadable link. It will work fine for files larger than 100MB if you provide your Google apiKey.
  • Razor
    Razor over 4 years
    As @YTZ mentioned, this method will only work for files <= 100MB. See my answer on this below for both Google Drive and Google Photos.
  • Gabriel Fernandez
    Gabriel Fernandez about 2 years
    this will not work, need access to the video