twitch

Interactive Embed Video Player

LIVE Streaming Video Player

Basic implementation:

<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="PLAYER_DIV_ID"></div>
<script type="text/javascript">
    var options = {
        width: 854,
        height: 480,
        channel: "monstercat", 
    };
    var player = new Twitch.Player("PLAYER_DIV_ID", options);
    player.setVolume(0.5);
</script>

With controls hidden:

<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="PLAYER_DIV_ID"></div>
<script type="text/javascript">
    var options = {
        width: 854,
        height: 480,
        channel: "monstercat", 
        controls: false,
    };
    var player = new Twitch.Player("PLAYER_DIV_ID", options);
    player.setVolume(0.5);
</script>

Recorded (not live) Video Player

<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="PLAYER_DIV_ID"></div>
<script type="text/javascript">
    var options = {
        width: 854,
        height: 480,
        video: "v53336925", 
    };
    var player = new Twitch.Player("PLAYER_DIV_ID", options);
    player.setVolume(0.5);
</script>

The above snippet will play the following video: twitch.tv/general_mittenz/v/53336925

Start with a Muted Player

<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="{PLAYER_DIV_ID}"></div>
<script type="text/javascript">
    var options = {
        width: 854,
        height: 480,
        channel: "{CHANNEL}"    
    };
    var player = new Twitch.Player("{PLAYER_DIV_ID}", options);
    player.setMuted(true);
</script>

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow