video black screen in next call on local media stop

138 views
Skip to first unread message

man...@phonon.in

unread,
Dec 31, 2014, 6:19:14 AM12/31/14
to eas...@googlegroups.com
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.

man...@phonon.in

unread,
Dec 31, 2014, 7:53:51 AM12/31/14
to eas...@googlegroups.com
I have one more question on the same:
When I check for closing media on my local machine it works fine with "easyrtc.closeLocalStream();".

When I deploy on server, it does not work sometimes and sometimes works.
The Application is deployed on "ssl - https". Will it have any impact for "easyrtc.closeLocalStream()" not working ?

Please suggest.

Eric Davies

unread,
Jan 13, 2015, 2:00:46 PM1/13/15
to eas...@googlegroups.com
In a quick test program, I find the easyrtc.closeLocalStream closes the media stream, the camera light goes out, etc. This is in the beta branch.

You are free to do the:
easyrtc.getLocalStream().getAudioTracks()[0].stop();
easyrtc.getLocalStream().getVideoTracks()[0].stop();

but bear in mind that easyrtc won't know that the media stream has been closed so unless you call easyrtc.closeLocalStream as well, you'll have an empty stream.

Axel Mendoza Pupo

unread,
Jun 4, 2015, 6:39:57 AM6/4/15
to eas...@googlegroups.com
Just to complete the answer, this works real ok for me. This are my steps to disconnect to be able to reconnect again without refreshing the page

easyrtc.leaveRoom(self.config.room);
easyrtc.disconnect();
document.getElementById('fullpage').style.display = "none";
easyrtc.getLocalStream().getAudioTracks()[0].stop();
easyrtc.getLocalStream().getVideoTracks()[0].stop();
easyrtc.localStream = null;
Reply all
Reply to author
Forward
0 new messages