Hey all
Maybe someone can shed some light on this for me, I've been stock for some time now.
We've created a popup feature that displays an article in an popup when user clicks a button.
This article can contain blocks with contrib-media components.
The popup has a close button that hides the article again. This button creates a problem with contrib-media components.
If the user clicks play on the media component and closes the popup afterwards, the video keep playing and you can still hear it in the background, even though it is no longer visible.
I want the close button to fire a function that runs through all media components in the article and pauses the video that is playing.
I've noticed that when you click play on a media component, any other media component on the page, that might be playing, pauses. Thus, only one media component is able to play at a time, which is nice.
Where can I find the code that pauses other media component, when user clicks play?
Would it be possible to reuse that code for my close button?
Any help much appreciated.
Thank you very much.
Henrik