Forem Creators and Builders

Jon Bulava
Jon Bulava

Posted on

Adding more embed types to the Twitch liquid tag

Is your feature request related to a problem? Please describe.

The problem I'd like to solve with this request is embedding Twitch videos to accompany tutorials or other educational content (i.e. Highlights). Currently, the Twitch liquid tag only supports Clips, which are videos that can only be 60 seconds.

Describe the solution you'd like

The functionality of the existing Twitch liquid tag could be expanded to include other video types such as past broadcasts and Highlights.

Option 1: In its simplest form, the tag could context switch based on the parameter. In other words, the video embed is used when the parameter is numeric and the Clip embed is used when the parameter is all letters. Examples:

  • {% twitch 813873786 %} assumes a video embed
  • {% twitch ClumsyPrettiestOilLitFam %} assumes a Clip embed

Option 2: The above would not work for channel embeds, which could be all numbers, all letters, or alphanumeric. This could be supported if an optional parameter could be provided to force a specific embed type. The format could be {% twitch <id> [clip|video|channel] %}. Examples:

  • {% twitch ClumsyPrettiestOilLitFam %} and {% twitch ClumsyPrettiestOilLitFam clip %} would be the same if a parameter with all letters is assumed to be a Clip
  • {% twitch 813873786 %} and {% twitch 813873786 video %} would be the same if a parameter with all numbers is assumed to be a video
  • {% twitch bluelava channel %} would force the channel embed

Describe alternatives you've considered

At the moment, my only alternative seems to be linking out of so a reader can view the video, but this takes you out of the context of the post.

Additional context

I lead Developer Advocacy at Twitch :-) Let me know how I can help with this potential feature and/or other Twitch embed ideas. Embedding documentation can be found here.

Discussion (0)