How to embed videos from Google drive to webpage?

40,922

You need to use the Google Drive Embed option. This is the URL you are looking for: https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview

<html>
<head>
</head>
<body>
<iframe width="100%" height="100%" src="https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview"></iframe>
</body>
</html>

You can make it autoplay by appending ?autoplay=1 to the URL so it is now https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview?autoplay=1.

Share:
40,922
Dr Confuse
Author by

Dr Confuse

Updated on July 17, 2022

Comments

  • Dr Confuse
    Dr Confuse almost 2 years

    I'm trying to load a video on a web page and for YouTube embed code it works. However, when I replace the src in the code with a Google Drive Link of a video (with sharing turned on), nothing comes up. I mean, there is no error but its blank. Why does nothing come up here? How can I get this Google drive video to also to load on my webpage? I dont want to have to paste the url manually in chrome.

    THIS DOES NOTHING:

    <html>
    <head>
    </head>
    <body>
    <iframe width="100%" height="100%" src="https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/view?usp=sharing"></iframe>
    </body>
    </html>
    

    The YouTube version works perfectly:

    <html>
    <head>
    </head>
    <body>
    <iframe width="100%" height="100%" src="https://www.youtube.com/embed/UTt33udwRw0" frameborder="0" allowfullscreen></iframe>
    </body>
    </html>
    

    How do I get the video from Google drive to play on my web page like how the YouTube video plays? If it cant be directly embedded - what alternatives can be used to get the video to appear - iframe is clearly not working, there must be some alternatives.

    Also, anyone know how to make it autoplay?

    Thanks

  • Dr Confuse
    Dr Confuse over 7 years
    Hey frog, that worked. Where did you find this, I couldn't find the embed option in my G Drive anywhere. Thanks man.
  • robere2
    robere2 over 7 years
    In the top right, click on the little 3 vertical dots and then click "Embed item..."
  • robere2
    robere2 over 7 years
    Also, you can make it autoplay by appending ?autoplay=1 to the url so it is now https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaouk‌​xH5p3Yg/preview?auto‌​play=1. Editing this into my main post, didn't see you ask how to do that the first time.
  • Dr Confuse
    Dr Confuse over 7 years
    Yeah I got the autoplay thing but the embed option is really weird. Not able to find it at all.
  • Dr Confuse
    Dr Confuse over 7 years
    Can you share a screenshot or something?
  • Dr Confuse
    Dr Confuse over 7 years
    I was checking it directly from drive. Need to open the video in new tab or use the sharing link in another tab and check the menu there. Got it. Thanks for being awesome Bugfroggy!!
  • Tahir Yasin
    Tahir Yasin about 7 years
    Embed code is not working in FireFox 52.0.2 (32-bit) . Any solution?
  • Harry
    Harry almost 6 years
    I just wanted to add - under the three dots - you need to click on "open new tab" and then you will see an additional three dots and one of the items is "Embed item" this is where you will find the link you can embed!
  • Earlee
    Earlee about 5 years
    autoplay gets stuck in forever loading
  • B''H Bi'ezras -- Boruch Hashem
    B''H Bi'ezras -- Boruch Hashem about 5 years
    Hi do you know how to do this using a link like youtube.googleapis.com/embed/…
  • pinkp
    pinkp over 4 years
    Are there any other parameters you can add? Change control colours or add a thumbnail to the start before play?
  • Maahi Bhat
    Maahi Bhat over 2 years
    this is not working, I am providing my working solution below