Stop Video in a modal after modal close

I have a video in a modal. How do I get the video to stop playing after the modal is closed? I can hear the audio still playing in the background.

Tried the bot, but I keep getting different code to type into the javascript section, and none of it works.

That’s not currently possible with the current versions of the Modal, however, I’ll take a look at this and see if we can get a fix for it in the next release :slight_smile:

1 Like

Thank you!

With the 2.0 beta, the sound from the video component does turn off when I close the modal, but then a few seconds later, the audio begins over.
Looping option is OFF. Almost there with a “cure” to stopping sound when modal is closed. The Create a Family Video tile opens a modal, the video plays. When I close the modal, the audio stops and a few seconds later, it starts again.
The Discover Your Family’s Heritage tile opens up a tile, the video plays, and when I close the modal, the audio stops.
Both modals are set up exactly the same. No known reason why this is happening.

https://elements.famhx.net/discovery/activities/

@ben Just FYI.

Bot had suggested this code to be place in the global template between the Body area to stop video play process once I close the modal. The “.modal-close-button” class is added to the modal close button in the Advanced section of the button. Seems to work, especially with with YouTube videos. If I have a .mp4 video file on the server, and link to that, then the video stops automatically without the code below.