Hello, I am playing audios in an ionic app with cordova media plugin.
so, when users navigate a way from the audio page, I want the audio to stop because it’s causing an unexpected behaviour that allows users to play multiple audios at the same time thereby causing overlap of audios .
My general answer to “how do I fiddle with anything involving page B from page A” is “don’t”, in order to preserve separation of concerns.
Therefore, the problem then becomes “how do I manage a resource so that both page A and page B can interact with it?”, and the simplest answer would be to put it in a service that is injected by both pages.