I am working on easyrtc video application.
I was trying to disconnect media when call completes after the call.
I tried with below options:
1. easyrtc.closeLocalStream();
- When I tried with this the behavior is like it doesn't always close the webcam. Sometimes it does sometimes not.
2. easyrtc.getLocalStream().stop();
- This worked nicely but facing black screen issue for immediately received next call. Once the first call ended I am not realoding the page and the next call is received to same user so the black screen appeared.
3. I found one solution from google search like:
call below functions on local stream.
getAudioTracks()[0].stop();
getVideoTracks()[0].stop();
So I called it on easyrtc local media as below:
easyrtc.getLocalStream().getAudioTracks()[0].stop();
easyrtc.getLocalStream().getVideoTracks()[0].stop();
But I am not sure how efficient this form is.
Please suggest.