is there a way that i, in javascript, can force an to stop playing when other audio is playing such as an audio or video or youtube embed, and then start it again when it is no longer playing

Follow

@sterophonick Most likely not; sites can't access any data about other sites by design (they're isolated for security reasons) so there's not really a way for one site to know whether stuff is playing elsewhere.

It *is* possible to synchronize such information between different pages on the same site; I believe that's usually done through service workers. And if you're the one embedding the YT player on your own page, I think it has some events you can listen to too, though it's been ages since I've looked at that.

· · Web · 1 · 0 · 1

@joepie91 i have and embeds in my site. the youtube embeds are harder because of that though

@sterophonick @joepie91 i think the easiest way to do that would be to hide the yt player behind a button that would show the player and pause the music at the same time. that might be kinda clunky to use though

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.