# \[embed\] parent query string value was not specified

**URL:** <https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948>\
**Category:** API\
**Created:** [August 29, 2020, 10:24am UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948 "2020-08-29T10:24:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![smart\_boii](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@smart\_boii](https://discuss.dev.twitch.com/u/smart_boii)\
**Post date:** [August 29, 2020, 10:24am UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/1 "2020-08-29T10:24:48Z")

</div>

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/](https://dev.twitch.tv/docs/embed/video-and-clips/)

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [August 29, 2020, 10:58am UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/2 "2020-08-29T10:58:19Z")

</div>

```auto
    <script type="text/javascript">
      new Twitch.Embed("twitch-embed", {
        width: 854,
        height: 480,
        channel: "monstercat"
      });
    </script>

```

Should work fine, as if you specify no parent, the embed library will auto determine for you.

Otherwise there does not seem to be a fault with your code.

---

<div class="post-metadata">

**Author:** ![smart\_boii](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@smart\_boii](https://discuss.dev.twitch.com/u/smart_boii)\
**Post date:** [August 29, 2020, 11:07am UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/3 "2020-08-29T11:07:50Z")

</div>

I am still getting the same error. In my browser URL bar is the following:

```
file:///C:/Users/JC/Desktop/twitchplayer/main.html

```

Which is the path to my file. Am i doing everything correctly?

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [August 29, 2020, 11:23am UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/4 "2020-08-29T11:23:09Z")

</div>

You cannot use the embed on pages using the file protocol. It needs to be HTTP (localhost) or HTTPS (anywhere). You can run a local web server to serve the file and then access it via [http://localhost/](http://localhost/)…

---

<div class="post-metadata">

**Author:** ![smart\_boii](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@smart\_boii](https://discuss.dev.twitch.com/u/smart_boii)\
**Post date:** [August 29, 2020, 11:34am UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/5 "2020-08-29T11:34:05Z")

</div>

ok thank you

---

<div class="post-metadata">

**Author:** ![smart\_boii](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@smart\_boii](https://discuss.dev.twitch.com/u/smart_boii)\
**Post date:** [August 29, 2020, 11:55am UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/6 "2020-08-29T11:55:22Z")

</div>

Would it work with github hosting?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [August 29, 2020, 1:35pm UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/7 "2020-08-29T13:35:37Z")

</div>

> [@smart\_boii](#):
>
> Would it work with github hosting?

Yes, as it’s a website served over SSL

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [August 30, 2020, 1:39pm UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/8 "2020-08-30T13:39:30Z")

</div>

4 posts were merged into an existing topic: [The great big “I’m using WIX/SomeWebsiteMaking Tool and I don’t know how to fix my embed” thread](https://discuss.dev.twitch.com/t/the-great-big-im-using-wix-somewebsitemaking-tool-and-i-dont-know-how-to-fix-my-embed-thread/26297/323)

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [September 29, 2020, 1:39pm UTC](https://discuss.dev.twitch.com/t/embed-parent-query-string-value-was-not-specified/27948/9 "2020-09-29T13:39:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
