easyrtc.closeLocalMediaStream() doesn't seem to work every time

106 views
Skip to first unread message

Angel Todorov

unread,
Jul 26, 2015, 6:55:54 AM7/26/15
to EasyRTC
Hi there,
I have a following issue in my easyrtc based platform - I have Single Page Application (SPA) platform. It could be used for text chat and / or video/audio talks. 
Since I don't want to keep video / audio open all the time, I decided to utilize both easyrtc.initMediaSource / easyrtc.closeLocalMediaStream() methods, meaning - when the user decides to make a video / audio call to peer, I call initMediaSource and if media is successfully utilized, call is made. When call is ended, I call closeLocalMediaStream, to turn of video / audio.
It seems however, that even when I call closeLocalMediaStream, my video / audio resources keep open. The only working solution is to refresh the page (by F5), but I don't consider that as working for production...

Any ideas how to overcome the issue?

Best Regards,
Angel

Eric Davies

unread,
Jul 26, 2015, 4:32:17 PM7/26/15
to EasyRTC, angel.a...@gmail.com
I've just spent some time playing with the issue. 

If I create a local media stream, I can close it and the camera resource is freed up properly (little light on my laptop shuts off).
If I use the local media stream in a call, end the call, and then close the local media stream, the camera resource is not freed up.
I've tried grabbing all the media streams from the peer connection, stopping their media tracks and stopping the media streams, but all that did was kill the locally display media stream sooner, the camera resource was not freed up.

My belief adding the media stream to the peer connection makes a clone that we can't access. In short, I think it's a webrtc bug and not something we can fix. I'm happy to be proven wrong though :-).
Reply all
Reply to author
Forward
0 new messages