# Google Drive video link does not embed video

**URL:** https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719
**Category:** Bug
**Created:** [22 Março , 2017 23:19 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719 "2017-03-22T23:19:31Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [22 Março , 2017 23:19 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/1 "2017-03-22T23:19:31Z")

</div>

Just encountered this on one of my sites. Confirmed the issue on [try.discourse.org](https://try.discourse.org/t/testing-google-drive-video/657). When the following link is added to a post, instead of displaying a video player, it causes a file download!.  
`https://drive.google.com/file/d/0BwkewGYgOeyIVWhRY2pjTi1LQmM/view?usp=sharing`

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [22 Março , 2017 23:32 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/2 "2017-03-22T23:32:14Z")

</div>

The opengraph tags for that link look like this:

```plaintext
<meta property="og:video" content="https://video.google.com/get_player?docid=0BwkewGYgOeyIVWhRY2pjTi1LQmM&amp;ps=docs&amp;partnerid=30&amp;cc_load_policy=1">
<meta property="og:video:type" content="application/x-shockwave-flash">

```

So google is supplying an flash format video 🙄

The current “generic onebox” behavior is to assume it’s an html embed, unless it’s an MP4 embed:

[https://github.com/discourse/onebox/blob/master/lib/onebox/engine/whitelisted\_generic\_onebox.rb#L292](https://github.com/discourse/onebox/blob/master/lib/onebox/engine/whitelisted_generic_onebox.rb#L292)

Personally I don’t think Onebox should add logic for flash embeds, they’re not gonna be around much longer anyway. Probably worth just adding a check for video:type=flash, and not oneboxing things that try to use flash.  
If that’s the correct course of action I can make a PR?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11 Novembro , 2017 10:31 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/3 "2017-11-11T10:31:54Z")

</div>

Is this still an issue?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [11 Novembro , 2017 16:08 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/4 "2017-11-11T16:08:22Z")

</div>

Just tested on try: [https://try.discourse.org/t/testing-google-drive-video-links/876](https://try.discourse.org/t/testing-google-drive-video-links/876). It doesn’t appear to cause a download anymore, but the video player produced doesn’t work.

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/3/93e43908ce1215a522a03bea95c9b5dcdd16ed38.jpg)

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [6 Dezembro , 2017 14:03 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/5 "2017-12-06T14:03:13Z")

</div>

Any suggested fix for this issue?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7 Dezembro , 2017 23:48 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/9 "2017-12-07T23:48:23Z")

</div>

Use something other than Google drive to host videos, since it isn’t designed as a video hosting service? Try that to start with.

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [8 Dezembro , 2017 00:24 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/10 "2017-12-08T00:24:11Z")

</div>

Thanks, not a crisis. Just something a user posting ran into so was trying to figure it out and also report it here. Appreciate the response.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8 Dezembro , 2017 00:30 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/11 "2017-12-08T00:30:09Z")

</div>

Regardless you should be able to link to the video and someone could click through to view it. That seems like a perfectly fine workaround.

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [8 Dezembro , 2017 02:54 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/12 "2017-12-08T02:54:01Z")

</div>

I must have missed something. What workaround are you referring to? In the current state is a user posts a link with a video on google drive it show up like the screenshot above and one can’t click the play button.

Are you saying that’s a workaround to make it play and clickable?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8 Dezembro , 2017 05:53 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/13 "2017-12-08T05:53:23Z")

</div>

To prevent oneboxing, simply type any character in front of, or after, the link. Then you have a plain link that can be clicked in the browser like any other link.

like so [https://example.com](https://example.com)

[https://example.com](https://example.com) like so

```
 https://example.com <-- spaces in front also work

```

---

<div class="post-metadata">

### Author: ![marcelocarneiro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcelocarneiro/32/101832_2.png) [@marcelocarneiro](https://meta.discourse.org/u/marcelocarneiro)
#### Post date: [30 Outubro , 2018 14:31 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/14 "2018-10-30T14:31:33Z")

</div>

One workaround is to whitelist `https://drive.google.com/` on Discourse settings:

 ![biz%202018-10-30%2011-29-05](https://global.discourse-cdn.com/meta/original/3X/d/c/dc0737e685131113f22315f51d926791c8d27f97.jpeg)

Then embed video player iframe:

 ![mp4](https://global.discourse-cdn.com/meta/original/3X/b/c/bc7c00cb79a988d24a31c6b5ee56ef47ef6c17c6.gif)

Then just paste it inside the topic in a new paragraph:

```plaintext
Take a look at this video explanation:

<iframe src="https://drive.google.com/file/d/[hash]/preview" width="640" height="360" frameborder="0"></iframe>

```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [14 Novembro , 2018 14:04 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/15 "2018-11-14T14:04:43Z")

</div>

Is this fixed?

[https://drive.google.com/file/d/0BwkewGYgOeyIVWhRY2pjTi1LQmM/view](https://drive.google.com/file/d/0BwkewGYgOeyIVWhRY2pjTi1LQmM/view)

---

<div class="post-metadata">

### Author: ![bts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bts/32/184556_2.png) [@bts](https://meta.discourse.org/u/bts)
#### Post date: [9 Abril , 2019 16:57 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/16 "2019-04-09T16:57:16Z")

</div>

Looks like…nope! Just ran into this same issue.

Per [this post](https://meta.discourse.org/t/oneboxing-google-drive-videos-does-not-work/36896/18) an embed does work if a) I whitelist the [drive.google.com](http://drive.google.com) source domain AND b) I paste in the complete iframe HTML rather than the raw Google Drive URL.

However I think the main issue here is that as user wouldn’t necessarily think to grab the embed code rather than just copying and pasting the URL the same way you would a YouTube link.

(Yes _I_ realize that Google Drive is a very different service than YouTube…but when you click play on a video in Google Drive, the video plays in what looks exactly like the YouTube player, so I think understandable that an average user might assume they’d work similarly!)

Also an issue that, [as mentioned here](https://meta.discourse.org/t/oneboxing-google-drive-videos-does-not-work/36896/14), the video _appears_ to display in the preview (actual thumbnail shows at least), but upon posting just shows the tiny blank non-functional preview. For example:

 ![20%20PM](https://global.discourse-cdn.com/meta/original/3X/f/d/fd3ccebbd0e33234ad08be004dc6399f2edf6257.jpeg)

If it’s not possible to get these embeds to work (with onebox as opposed to iframe workaround), I’d suggest it might be worth adding an exception to just not onebox them at all.

Regardless of technical cause, this weird _looks-like-an-embedded-player-but-actually-non-functional-little-box-that-isn’t-even-clickable_ I think is worse than just defaulting to a totally un-oneboxed link.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [10 Abril , 2019 04:02 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/17 "2019-04-10T04:02:42Z")

</div>

We should fix this @techAPJ – it does not need to be a video player just “not broken” 🛠

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [10 Abril , 2019 05:42 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/19 "2019-04-10T05:42:12Z")

</div>

I am working on a new onebox engine to onebox Google Drive files. Right now here is how we see Google Drive links in preview:

 ![Annotation%202019-04-10%20110633](https://global.discourse-cdn.com/meta/original/3X/6/e/6eb3e74e1ad4bf77afa7cbf5c79f660d2fbdd330.jpeg)

The video preview doesn’t work once the post is created and the pdf and zip files doesn’t get oneboxed at all.

Here is how it will look after having google drive onebox engine in action:

 ![Screenshot%20from%202019-04-10%2011-11-18](https://global.discourse-cdn.com/meta/original/3X/3/d/3dd7ddcd8e8c7405a44c2fb05eac1c5712a5b35c.png)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [10 Abril , 2019 08:56 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/20 "2019-04-10T08:56:39Z")

</div>

Okay, this is now [done](https://github.com/discourse/onebox/commit/79033b8520ad06606f87f69b3579cae0e6761fff). Demos:

Video file:

[https://drive.google.com/file/d/0BwkewGYgOeyIVWhRY2pjTi1LQmM/view?1](https://drive.google.com/file/d/0BwkewGYgOeyIVWhRY2pjTi1LQmM/view?1)

Zip file:

> **[sample.zip](https://drive.google.com/file/d/1nkIvNe313jjfHtbUuRKKF0DfOp-eYL2i/view?usp=sharing)**
>
> Google Drive file.

Documents (text/pdf file):

> **[test.txt](https://drive.google.com/file/d/1FgMt06wENEUfC6_-1tImXaNCH7vM9QsA/view?usp=sharing)**
>
> Awesome description here! 😎

.

> **[pdf-sample.pdf](https://drive.google.com/file/d/1M5gClHuKjD7m-bFnJqDX4siAyVkN4U0c/view?usp=sharing)**
>
> Sample PDF file.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [11 Abril , 2019 03:19 UTC](https://meta.discourse.org/t/google-drive-video-link-does-not-embed-video/59719/21 "2019-04-11T03:19:16Z")

</div>


