I came across to the strange phenomenon that freezing happens when calling getUserMedia(facemode: user...) in iOS, and that network connection disconnect. This happens only if you choose front camera. The back camera works perfectly. And, first calling for front camera is no problem. I'm using janus-gateway as WEBRTC SFU. Does anyone know how to solve it(deleting strange freezing)? This happens in Xcode device release mode(not in device debug mode)
I have also experienced this issue and have traced it into the Objective-C getUserMedia call. It seems to happen even without a peer connection and can be reproduced just with the getUserMediaCall when trying to swap cameras.
From what I saw, it happened every second-time calling getUserMedia. (every even call, but not odd)
I've got the same issue :-(
Even call may triggers this freezing. But, I'm not sure of it, because sometimes not happen. In order to delete this, I insert the fake getUserMedia. This may solves this problem. But, it is not the good solution..
We could fix this by doing the following:
localStream.getTracks().forEach((t) => {
localStream.removeTrack(t);
});
localStream.release();
Nice! This solves this problem perfectly!
hello , where should i write this code :
localStream.getTracks().forEach((t) => {
localStream.removeTrack(t);
});
localStream.release();
@lenglengiOS you need to save such reference (localStream, you get it after getUserMedia) somewhere and do that cleanup in a phase where makes sense, e.g before toggling camera, or when leaving "room" so that next getUserMedia is fast...
In my case I reproduced 8seconds (iphoneSE) constant freeze from second getUserMedia compared to first one which is less than one second. I checked with instruments and no CPU/Mem pike in that interval, finally I found this issue :)
Most helpful comment
We could fix this by doing the following: