Ok so I am building myself a website and would like to embed the twitch player that includes everything. I am trying to follow the instructions for “Embedding Everything” (https://dev.twitch.tv/docs/embed/everything) and I am trying to test locally by just running my html file from the file directory but I keep getting the parent not specified in my chrome console.
I am not sure what I am missing:
<!-- Add a placeholder for the Twitch embed -->
<div id="twitch-embed"></div>
<!-- Load the Twitch embed script -->
<script src="https://embed.twitch.tv/embed/v1.js"></script>
<!--
Create a Twitch.Embed object that will render
within the "twitch-embed" root element.
-->
<script type="text/javascript">
var embed = new Twitch.Embed("twitch-embed", {
width: 854,
height: 480,
channel: "hottahdy",
layout: "video-with-chat",
autoplay: true,
muted: true
});
embed.addEventListener(Twitch.Embed.VIDEO_READY, () => {
var player = embed.getPlayer();
player.play();
});
</script>