Streaming live at 10am (PST)

How to stop a youtube video with Javascript?

Hello.

I tried different solutions that I found around here in the forum, but none of them work.

I basically have my youtube video inside a video component, not even a youtube component, and I have an X button that hides the container with an animation, but the video keeps playing no matter what.

How can I stop that video when I hide the container?

I tried some javascript solutions but something must be wrong on them because none work.

I don’t post a public link to the website because it’s under NDA, but keep in mind that any website would be the same, I just want a solution to stop the video with a javascript function.

Thanks!

Hello @Juangea
Have you tried this How to Control YouTube's Video Player with JavaScript - Tutorialzine ?

Hi @jptrinh

No, I have not tried that, but that means I have basically to manually integrate the video myself.

What I’m trying to do is to stop the video that is being implemented using the youtube webflow component :slight_smile:

Thanks for the link thought :slight_smile: