Onebox embedding twitch highlights

(Daytona) #1


This topic is for help with embedding a highlight.

I have enabled embedding flash video with onebox and whitelisted the following domains: and

Highlights are not quite as simple to embed as the actual streams. Streams can be embedded by adding /embed to the url like so:

For highlights, Twitch tells you to take some html object from the share button and it looks like this:

<object bgcolor="#000000" data="" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="channel=lumfish&amp;auto_play=false&amp;start_volume=25&amp;videoId=c6492662&amp;device_id=0702ea9cee15a4a4" /></object><br /><a href="" style="padding:2px 0px 4px; display:block; width: 320px; font-weight:normal; font-size:10px; text-decoration:underline;">Watch live video from Lumfish on Twitch</a>

Out of this object, I’ve crafted a url which does successfully contain just the video part of the highlight, but it does not embed magically like youtube videos:

Can I embed this with the onebox feature of discourse some how? Is there a special onebox syntax to follow?

Thanks for your help and hopefully this helps someone else in the future.


(Jeff Atwood) #2

You would probably need to make a pull request modifying the oneboxer to achieve this.

(Daytona) #3

I’m reading the readme at onebox/ at master · discourse/onebox · GitHub

Do you mean to whitelist the URL with Onebox::Engine::WhitelistedGenericOnebox

Or would I have to make a new engine with the 6 step process?

(Jeff Atwood) #4

You can check to see if that page generates sane oEmbed or Open Graph tags via online checkers.

(Marcin Rataj) #5

Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed does not return promising results:

I just checked and both OpenGraph and oEmbed return an autoplay of, which is clearly a bug on twitch side (we want embed of a specific recording).

I guess it could be fixed by creating custom onebox that replaces<user>/c/<video_id> with code from share button.

(Kane York) #6

I think that a new engine is required to fix the VOD links.