Show Live Stream on Community Website

Hello,

I’m working on a game community site and they want a couple of twitch integration features. 1) to be able to show on the home page a live stream of their channel. 2) to show related streams.

What is the best way to go about this?

Thanks!

  1. The easiest way to show a live stream on a website is

Of course swapping channel_name for the name of the channel. For example, my channel is “barrycarlyon” so I would put the following (including some dimension and border attributes)

<iframe src="http://twitch.tv/barrycarlyon/embed" frameborder="0" seamless height="378" width="620"></iframe>

You can also embed chat. Change embed to chat.

Of course you will want to set the dimensions of the iframe. And this doesn’t perform any sort of checks to see if the stream is live or not (for example on page load, check if the stream is live, if so render the video iframe, if not render something else)

  1. In response to your second question. If depends on what your definition of related is.
    You could use the Twitch Search API to select some streams based of some your streams current meta data (title/game etc). Or you can have a known list of streams to iterate thru. And display accordingly.
    I don’t have enough information to suggest anything further
  1. Wow it’s that easy. Nice!

  2. I’ll check the Search API. I might have to combine both results from search and from the known list.

Thanks for the info! :smile:

No problem. If you need any help we are here to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.