I am trying to embed a twitch stream in a page and view it locally. I am using code straight from the twitch API documentation except I changed the parent query string to ‘localhost’. The code I am using is this:
<html>
<body>
<!-- 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">
new Twitch.Embed("twitch-embed", {
width: 854,
height: 480,
channel: "monstercat",
parent: ["localhost"]
});
</script>
</body>
</html>
In my console in see this error:
Twitch embed error message:
[NoParent] parent query string value was not specified
Docs: https://dev.twitch.tv/docs/embed/video-and-clips/