embed twitch

Solutions on MaxInterview for embed twitch by the best coders in the world

showing results for - "embed twitch"
Lionel
25 Mar 2020
1<!-- to paste into your html website-->
2    <div id="twitch-embed"></div>
3    <script src="https://embed.twitch.tv/embed/v1.js"></script>
4    <script type="text/javascript">
5      var embed = new Twitch.Embed("twitch-embed", {
6        width: 854,
7        height: 480,
8        channel: "monstercat",
9        layout: "video",
10        autoplay: false,
11        parent: ["embed.example.com", "othersite.example.com"]
12      });
13      embed.addEventListener(Twitch.Embed.VIDEO_READY, () => {
14        var player = embed.getPlayer();
15        player.play();
16      });
17    </script>