Sure.
check out this link first;
Embed Video API
The first option is the Iframe, as it says, this is uninteractive. This is not what we want.
We want to interact with it, since having 10 streams open on a page will eat internet and slow down a lot
So then we have the interactive Embed. Great!
As you can see, it consists of javascript functions (denoted by script tags)
I’ll explain quickly what happens here.
<script src= "http://player.twitch.tv/js/embed/v1.js"></script>
“installs” the script on the page, the browser will load this
<div id="{PLAYER_DIV_ID}"></div>
The div were the player will be in. In our example we will call this “MainPlayer”
<script type="text/javascript">... </script>
This indicates we are writing our own script inbetween the tags.
var options = { width: 854, height: 480, channel: "{CHANNEL}", //video: "{VIDEO_ID}" };
This creates a variable called options with The settings as given.
{CHANNEL} would be the channel name.
example: channel: "Spectre_X7",
var player = new Twitch.Player("{PLAYER_DIV_ID}", options);
Here we create a new twitch player. this is basically the object that shows the stream.
Replace {PLAYER_DIV_ID} with the name of the div.
Below this on the API link, it will give you all commands you can use on the javascript object.
I will give you a simple example here:
jsfiddle example
NOTE: this does not work on JSFiddle, it doesn’t accept non https scripts, but if you copy this to a local page you’ll see it works. Also; you probably need something to deal with offline streams.
It’s just an example of how you could swap them out.