mconf / bbb-mobile-sdk

MIT License
6 stars 9 forks source link

fix(audio): do not set MediaStreamTrack.enabled if readyState == ended #715

Closed prlanzarin closed 2 months ago

prlanzarin commented 2 months ago

Android's WebRTC implementation throws if MediaStreamTrack.enabled is altered while no native tracks are bound to it, and react-native-webrtc doesn't really catch the error == crash.

Check MediaStreamTrack.readyState before altering MediaStreamTrack.enabled in the hopes of circumventing that crash. If this does not fix the issue, it might be related to the asynchronous cleanup of the input stream's tracks (check onAudioExit) - next step would be to remove that specific cleanup and leave it to the PC.close routine only.

closes: https://github.com/mconf/bbb-mobile-sdk/issues/716