[SOLVED]Tell me what I'm doing wrong please

Has anyone used Javascript to add the Twitch VOD embed script into their project/website?
Here’s a screenshot of my code. In the firefox console, the scripts are greyed out too. If more screenshots are needed to help, let me know. Thanks.

As per the docs https://dev.twitch.tv/docs/embed/video-and-clips#interactive-frames-for-live-streams-and-vods you’re missing the parent in the options.

Also you’ve defined a function, a, but aren’t actually calling it anywhere so it’s not going to do anything.

Can’t easily test as this is a picture. So I can’t copy paste to test your code

Is this up on a page somewhere?

The JS Lib auto determines and adds this if no parent is specified.

Edit: Using embed everywhere (which doesn’t need the ‘v’ prefix)


Using .player (older style)


Yeah i removed the function. And the docs say " Only required if your site is embedded on any domain(s) other than the one that instantiates the Twitch embed. Example parent parameter: ["streamernews.example.com", "embed.example.com"]"- but im on localhost right now im not embedding my site anywhere so do i put “http://localhost

It’s on my https://github.com/iSWATxJOKERi/CLIPD/blob/master/src/scripts/streams.js

i fixed it thanks @BarryCarlyon and @Dist for coming to the rescue. I removed the function and just placed them at the bottom after i appended the parent containers to the body. before the function being saved to the variable was looking for the div with id 2 but it wasnt in the document yet. Thanks again. And @Dist i haven’t put any parent yet and but it still works. Im asuming when i deploy this to heroku i put heroku as a parent but since im on localhost rn it doesnt need to have that filled yet