I'm embedding a live-stream in an iFrame that is inside of a react-native WebView. I'm positive that the WebView stops being rendered when the component unmounts, and I have it set up as follows:
{ showingStream ? (
<View
style={{
backgroundColor: colors.black,
height: viewHeight,
}}
>
// WebView inside of here
</View>
) : null }
The issue is that, when showingStream is set to false
, and the component stops being rendered, which is definitely happening, the audio continues to play. I can see the audio stream in the iOS music dropdown.
Is there any way to end the audio when the WebView stops rendering?
I've even considering trying to play a short audio byte that overrides the iOS audio and then ends.
Any help would be much appreciated.