Just encountered this on one of my sites. Confirmed the issue on try.discourse.org. 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
The opengraph tags for that link look like this:
<meta property="og:video" content="https://video.google.com/get_player?docid=0BwkewGYgOeyIVWhRY2pjTi1LQmM&ps=docs&partnerid=30&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
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?
Is this still an issue?
Just tested on try: 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.
Any suggested fix for this issue?
Use something other than Google drive to host videos, since it isnât designed as a video hosting service? Try that to start with.
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.
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.
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?
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 like so
https://example.com <-- spaces in front also work
One workaround is to whitelist https://drive.google.com/
on Discourse settings:
Then embed video player iframe:
Then just paste it inside the topic in a new paragraph:
Take a look at this video explanation:
<iframe src="https://drive.google.com/file/d/[hash]/preview" width="640" height="360" frameborder="0"></iframe>
Is this fixed?
Looks likeâŠnope! Just ran into this same issue.
Per this post an embed does work if a) I whitelist the 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, 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:
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.
We should fix this @techAPJ â it does not need to be a video player just ânot brokenâ
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:
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: