Support for Wistia embeds/recognising URLs with Wisita videos embedded


(Jake Hower) #1

Hi All.

I’m not a coder myself, so I can’t help with this one…

I’m a big user of Wistia for hosting videos. The stats/security/speed/sexiness of the player make it really awesome to use.

I’d love to be able to embed Wistia videos in posts. It would also be great for the videos to be recognised from the URL, similar to what is already the case with Youtube.

How hard would this feature be to add?


(Kane York) #2

Pretty sure this only involves writing a oneboxing class for it and adding it to the whitelist!


(Jeff Atwood) #3

Yep just whitelist the URL. That’s all you need to do.

Which reminds me @eviltrout and @Neil we REALLY REALLY REALLY need to get that onebox whitelist to be editable via the /admin settings. Tired of reading the same request every week, which boils down to “I don’t know how to work the whitelisting of URLs”


(Jake Hower) #4

Cool, thanks @codinghorror. I’m hosting with http://discoursehosting.com/ I’ll shoot them an email to see if they can add it in to the whitelist.


(Cesc Vilanova) #5

Hi @JakeHower. Could you solve this issue with Wistia?

I’m interested on the same feature.


(Adam) #6

Thanks @riking it cleared it up for me.

@Cesc_Vilanova this is how it works:

  1. Go to discourse “Settings”
  2. Left Menu; click “Onebox”
  3. In “onebox domains whitelist” enter domain “wistia.com
  4. Go to Wistia; Select a Video and Select “Inline Embed”
  5. In “Advanced Options” check “use oEmbed”
  6. Paste the “Embed Code” which is just a website address… Into the post
  7. Watch the video :smiley:


(Jesse Perry) #7

This is not working for me. Oddly, I was able to get a video to work in the past (I remember having to paste it several times until it actually worked). But I can’t get any to consistently work. Any ideas?

Also I was trying to get the pop-up embed to work, but that’s not working either (I’m loading the Javascript in via Admin > Customize). It just replaces the window with the Wistia video full-screen. That’s better than nothing, but it appears to not even notice the Wistia Javascript (even though it is loaded) and fall back to loading video in entire web browser frame.


(Jesse Perry) #8

I’m back, answering my own problem. @Hosker4u your instructions didn’t work for me, unfortunately, but this did:

  1. In Onebox whitelist settings, add https://[your_sub_domain].wistia.com/medias/ (not wistia.com because according to GitHub - discourse/onebox: A gem for turning URLs into website previews, Onebox does not support root URLs)
  2. Make sure the project in Wistia containing the video is unlocked
  3. Paste the URL of the video from Wistia to Discourse message box, and ta da!

I think this method will work the most consistently because Wistia social sharing requires the video to be unlocked, and since Onebox is using OpenGraph to display this, that’s probably why it wasn’t working for me before (and the root URL disqualifier).


Wistia embed link on Discourse post doesn't work for @message emails
(Jeff Atwood) #9

I am pretty sure root URLs are supported.


(Jesse Perry) #10

You’re right. Pasting in a URL that’s not root - Discourse sets it back as the root domain.

My recommendation to make sure the Wistia project is unlocked stands.


(Kane York) #11

To clarify: the thing that isn’t supported is embeddable content being present at the root URL.


(Shannon Rogers) #12

I’m curious if anyone knows of a way to get a Wistia embed to work if the video is locked. I run my membership site with all my protected videos with Wistia so 95% of my stuff there is locked. I white listed both the root and the subdomain as stated above and all I get is the link but no inline embed. Any work around suggestions?


(Mariel Matze) #13

Another question from a non-coder: how to adjust the size of a Wistia video embedded in a reply?

I can get my video to embed with the correct size (400x640) when it’s in a new post, but when I tried to reply to a post with a video, they pop up as 224x360.

Here are a couple screenshots: you can see in an earlier post the first video came out nice and big while in my reply to the same thread turned out much smaller. I’d like for them both to be 400x640.

Thanks in advance for tips you might be able to lend!


(Edgar Cerecerez) #14

Hello everyone, – embedding the videos (and having them play in the same page) doesn’t work after the update to discourse 1.9. I think it has to do with the upgrades to onebox. Any ideas on how to get this to work again? https://blog.discourse.org/2018/01/discourse-1-9-released/

@codinghorror I’m sure you’re busy, but if anyone in your team can provide guidance it would be much appreciated.


(Sam Saffron) #15

Can you post examples of what used to work and now does not?


(Edgar Cerecerez) #16

@sam

Sure. We use Wistia for video hosting. Before the upgrade (i’m guessing it’s the upgrade that cause the problem) when we post the video the onebox would make it a playable video from within the page:

the code snippet:
https://nortridge.wistia.com/medias/4q1w6nibe9?embedType=async&videoFoam=true&videoWidth=640


(Edgar Cerecerez) #17

Now, the same code snippet shows as:

and when clicked goes to the video instead of playing on the page.

** sorry about the two posts. community rules allow me to only post one image per reply.


(Sam Saffron) #18

@techAPJ can you investigate why/when this regressed?


(Jeff Atwood) #20

Per http://iframely.com/debug?uri=https%3A%2F%2Fnortridge.wistia.com%2Fmedias%2F4q1w6nibe9 it looks like OpenGraph is being prioritized over oEmbed.

It’s also saying two different conflicting things

  1. OpenGraph: this is an image with an URL
  2. oEmbed: this is a video embed

which one should “win”?


(Edgar Cerecerez) #21

The oEmbed which I’m guessing will allow it to interpret the link as a video and create the appropriate media representation? (a video playable within the post instead of a link).