Passing through rel=0 on YouTube embeddings

(Gustavo Niemeyer) #1

Hello there,

I see we pass through width and height on YouTube embeddings. Any chance we can also get the rel=0 parameter through, so that one may disable suggested videos at the end of the linked video? The previous suggestion early last year didn’t seem to get much traction, but it seems like a good one and in line with the idea of keeping things on topic (the suggestions are often pretty random). I’d even argue that it should be the default, but at least passing through would be great.

Other good candidates are start and end, which allow controlling what section of the video linked to is actually played. Seems pretty sensible to support that too.

Perhaps someone should go through the supported parameters and see if anything else is worth adding for the context of Discourse.


(Kane York) #2

The code you want is here: onebox/youtube_onebox.rb at master · discourse/onebox · GitHub

start & end are already supported.

(Gustavo Niemeyer) #3

Thanks. I’m tempted to just patch it to include rel=0 at all times in our distribution, as the whole point of embedding a video in a topic is precisely to let people stay in context while interacting with the conversation in the topic.

(Jeff Atwood) #4

@techAPJ low priority can you make sure this parameter survives when passed through on our end?

(Arpit Jalan) #6

Added support for rel=0 via:

Note that YouTube changed the behaviour for rel parameter since September 25, 2018:

After the change, you will not be able to disable related videos. Instead, if the rel parameter is set to 0 , related videos will come from the same channel as the video that was just played.

Embedding YouTube without recommended videos at the end?
(Jeff Atwood) closed #7