Twitch.tv, commonly known as Twitch, is a video-streaming service for gamers, and you can embed a stream into your site adding the [twitchtv] shortcode into a post or page.
The most basic form of the shortcode requires only the URL parameter, and looks like this:
[twitchtv url="https://www.twitch.tv/paperbat/"]
Where paperbat
is your Twitch username.
Add this to a Shortcode block to show the currently active stream (if there is one) or a highlight automatically chosen by Twitch.
In order to show a specific video (an archived stream) find the link to that video by viewing the video and copying the URL from the address bar of your browser, or by clicking the Share button and copying from the Video Link field.
The link will look like https://www.twitch.tv/videos/323486192
The number at the end of that link is what you need; append it to the channel URL in the format username/v/videoID
. The shortcode will look like this:
[twitchtv url="https://www.twitch.tv/paperbat/v/323486192"]
You can add a shortcode to any page or post using a shortcode block.
You can also add additional parameters to customize the appearance:
- height – defaults to 378 pixels
- width – defaults to 620 pixels
- autoplay – defaults to true
- muted – defaults to false
- time – Start at a given time (videos only). Use this format: time=”1h2m3s”
A more advanced shortcode would look something like:
[twitchtv url="https://www.twitch.tv/paperbat" width="400" height="244" autoplay="false" muted="true"]