Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

React-Native WebView iFrame audio persists even after component is unmounted

$
0
0

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.


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>