I have a interaction where when users click on an icon it changes the video embed from none (hidden) to Flex and vice versa. Ive set it to autoplay and works beautifully but when I close it the video is still playing in the background and i can hear the audio.
How do I add a script to each of the Embed so that the video plays and pauses depending on its Layout status or visibility?
I have no coding knowledge but I followed a youtube video and copied its code and it works on one of the embed! (it even pauses when i scroll away which is a function that i didnt need but is cool hehe), but I have 3 of these video popups and when i copy and paste this code to the others they dont work. So I need a new solution or a way to make this solution work with the other embeds.
Search Youtube for PixelGeeks video on auto-playing (and stoping the playback) of videos on scroll. Not exactly what you’re looking for but will give you the pieces to make yours work.
Sorry, I couldn’t quickly find the link otherwise I’d post it here