Webcam still on in browser after destroying session

511 views
Skip to first unread message

Beka Iglesias López

unread,
Jul 29, 2020, 10:09:52 AM7/29/20
to meetecho-janus
Hello,

I was setting up four webRTC emission (angular and videoroom plugin) which rtp_forwarder and streaming plugin four mount-points. It works like a charm. I was trying to receive and record the flux via gstreamer pipeline and this works really nice too (in video case and screen-sharing case as well).

I have realized that my webcam is still active after destroying session. The session is destroyed but my webcam is still active  (light on in browser). I was trying the unpublish request before destroying the session. In my browser console, I can see unpublish event ok, hangup event, webRTC stuff is down now. Stopping local streams tracks. So, the emission is stopping fine but my webcam is still with light on in browser. It only seems disconnected completely after closing the tab. The same with screen-sharing. Everything works fine: mute video and unpublish video works fine etcetc unless the disconnection from the browser. My janus version is 10.0.2. Am I missing some necessary request or something? Any idea? I have never found something like that in another webRTC frameworks and I am curious about what is going on.

Thanks in advance,



--
Beka Iglesias
Software Engineering Group
Fundació i2CAT
Gran Capità, 2-4, Nexus I, 2a planta, Barcelona

Brian Burt

unread,
Jul 29, 2020, 10:43:46 AM7/29/20
to Beka Iglesias López, meetecho-janus
Odd. Which browser and OS are you using?  Have you tried other WebRTC video/demo websites do they yield the expected light off when closed?  

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/CAOjJR%3Db4%3DKPs9MHaLawAPC0x5RwuGtrFrJLNSPOBNLNSS7fefA%40mail.gmail.com.


--

Brian Burt
Chief Visioneer (Founder & CEO)

+1 415 727 1820 direct+mobile
+1 877 414 1515 customer support
VoiceVoice and MaestroConference

Technology for Conversations that Engage Every Voice.

Customers:  the Obama, Clinton, Sanders campaigns; Airbnb, the World Bank, Stanford University, NextDoor, Uber the Sierra Club and MoveOn, Rackspace, and Nestle,
among thousands of organizations and thought leaders globally.

Why?  Social conferencing combines the power of facilitated small group conversations which engage voices in parallel at tremendous scale, with tools for live crowdsourcing, collaboration and relationship-building, and actionable commitments.  Conversations for Action.

What's your mission, and where do conversations fit in?

Beka Iglesias López

unread,
Jul 29, 2020, 5:10:21 PM7/29/20
to br...@brian-burt.com, meetecho-janus
I am trying Firefox, Chromium and Opera in Debian. But it happens in another OS for another people as well.
Yeps, I always got light off when closed (with different frameworks). I am trying to understand if it's something related to janus 10.0.2 version
or maybe some function or request after unpublish request and session destroyed that I can be missing...

Lorenzo Miniero

unread,
Jul 30, 2020, 2:30:28 AM7/30/20
to meetecho-janus
Janus has nothing to do with that. Cameras being on or off means MediaStreamTrack, which is a client side or browser thing. Check the JavaScript code.

L.


Il giorno mercoledì 29 luglio 2020 23:10:21 UTC+2, Beka Iglesias López ha scritto:
I am trying Firefox, Chromium and Opera in Debian. But it happens in another OS for another people as well.
Yeps, I always got light off when closed (with different frameworks). I am trying to understand if it's something related to janus 10.0.2 version
or maybe some function or request after unpublish request and session destroyed that I can be missing...

El mié., 29 jul. 2020 a las 16:43, Brian Burt (<brian...@gmail.com>) escribió:
Odd. Which browser and OS are you using?  Have you tried other WebRTC video/demo websites do they yield the expected light off when closed?  

On Wed, Jul 29, 2020 at 7:09 AM Beka Iglesias López <beka.i...@i2cat.net> wrote:
Hello,

I was setting up four webRTC emission (angular and videoroom plugin) which rtp_forwarder and streaming plugin four mount-points. It works like a charm. I was trying to receive and record the flux via gstreamer pipeline and this works really nice too (in video case and screen-sharing case as well).

I have realized that my webcam is still active after destroying session. The session is destroyed but my webcam is still active  (light on in browser). I was trying the unpublish request before destroying the session. In my browser console, I can see unpublish event ok, hangup event, webRTC stuff is down now. Stopping local streams tracks. So, the emission is stopping fine but my webcam is still with light on in browser. It only seems disconnected completely after closing the tab. The same with screen-sharing. Everything works fine: mute video and unpublish video works fine etcetc unless the disconnection from the browser. My janus version is 10.0.2. Am I missing some necessary request or something? Any idea? I have never found something like that in another webRTC frameworks and I am curious about what is going on.

Thanks in advance,



--
Beka Iglesias
Software Engineering Group
Fundació i2CAT
Gran Capità, 2-4, Nexus I, 2a planta, Barcelona

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.


--

Brian Burt
Chief Visioneer (Founder & CEO)

+1 415 727 1820 direct+mobile
+1 877 414 1515 customer support
VoiceVoice and MaestroConference

Technology for Conversations that Engage Every Voice.

Customers:  the Obama, Clinton, Sanders campaigns; Airbnb, the World Bank, Stanford University, NextDoor, Uber the Sierra Club and MoveOn, Rackspace, and Nestle,
among thousands of organizations and thought leaders globally.

Why?  Social conferencing combines the power of facilitated small group conversations which engage voices in parallel at tremendous scale, with tools for live crowdsourcing, collaboration and relationship-building, and actionable commitments.  Conversations for Action.

What's your mission, and where do conversations fit in?

Beka Iglesias López

unread,
Jul 30, 2020, 3:34:53 AM7/30/20
to Lorenzo Miniero, meetecho-janus
"In my browser console, I can see unpublish event ok, hangup event, webRTC stuff is down now. Stopping local streams tracks"
Reading in the console browser stopping local stream tracks and see still the light was the starting point of the question :)
I will check all the steps relating MediaStreamTrack carefully.

Thanks!

El jue., 30 jul. 2020 a las 8:30, Lorenzo Miniero (<lmin...@gmail.com>) escribió:
Janus has nothing to do with that. Cameras being on or off means MediaStreamTrack, which is a client side or browser thing. Check the JavaScript code.

L.

Il giorno mercoledì 29 luglio 2020 23:10:21 UTC+2, Beka Iglesias López ha scritto:
I am trying Firefox, Chromium and Opera in Debian. But it happens in another OS for another people as well.
Yeps, I always got light off when closed (with different frameworks). I am trying to understand if it's something related to janus 10.0.2 version
or maybe some function or request after unpublish request and session destroyed that I can be missing...

El mié., 29 jul. 2020 a las 16:43, Brian Burt (<brian...@gmail.com>) escribió:
Odd. Which browser and OS are you using?  Have you tried other WebRTC video/demo websites do they yield the expected light off when closed?  

On Wed, Jul 29, 2020 at 7:09 AM Beka Iglesias López <beka.i...@i2cat.net> wrote:
Hello,

I was setting up four webRTC emission (angular and videoroom plugin) which rtp_forwarder and streaming plugin four mount-points. It works like a charm. I was trying to receive and record the flux via gstreamer pipeline and this works really nice too (in video case and screen-sharing case as well).

I have realized that my webcam is still active after destroying session. The session is destroyed but my webcam is still active  (light on in browser). I was trying the unpublish request before destroying the session. In my browser console, I can see unpublish event ok, hangup event, webRTC stuff is down now. Stopping local streams tracks. So, the emission is stopping fine but my webcam is still with light on in browser. It only seems disconnected completely after closing the tab. The same with screen-sharing. Everything works fine: mute video and unpublish video works fine etcetc unless the disconnection from the browser. My janus version is 10.0.2. Am I missing some necessary request or something? Any idea? I have never found something like that in another webRTC frameworks and I am curious about what is going on.

Thanks in advance,



--
Beka Iglesias
Software Engineering Group
Fundació i2CAT
Gran Capità, 2-4, Nexus I, 2a planta, Barcelona

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.


--

Brian Burt
Chief Visioneer (Founder & CEO)

+1 415 727 1820 direct+mobile
+1 877 414 1515 customer support
VoiceVoice and MaestroConference

Technology for Conversations that Engage Every Voice.

Customers:  the Obama, Clinton, Sanders campaigns; Airbnb, the World Bank, Stanford University, NextDoor, Uber the Sierra Club and MoveOn, Rackspace, and Nestle,
among thousands of organizations and thought leaders globally.

Why?  Social conferencing combines the power of facilitated small group conversations which engage voices in parallel at tremendous scale, with tools for live crowdsourcing, collaboration and relationship-building, and actionable commitments.  Conversations for Action.

What's your mission, and where do conversations fit in?


--
Beka Iglesias
Software Engineering Group
Fundació i2CAT
Gran Capità, 2-4, Nexus I, 2a planta, Barcelona

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/5b631b40-da2f-4027-a7ef-247aa619f62do%40googlegroups.com.

Olivier Anguenot

unread,
Aug 6, 2020, 7:26:20 AM8/6/20
to meetecho-janus
Hi all,

I have the same problem with Firefox. 

In the demo such as EchoTest, after the session is destroyed, the web page is reloaded, so no problem, camera is switched off. But, if you don"t reload the page, in Firefox, I have a crash because I don't know what is the methods to call to terminate the call correctly.

I tried to a session.destroy() and then on the destroyed event to call the echotest.hangup(). It works in Chrome but it crashes in Firefox (in WebRTC-adapter: No more peer connection)

Could you describe the correct way to handle the end of the call ?

Thanks in advance,
Regards,
Olivier

Matt Nelson

unread,
Aug 7, 2020, 4:35:23 AM8/7/20
to meetecho-janus
If you keep a pointer to the local stream then you can manually tell the stream to stop at any point. It can be helpful in Angular and VueJS apps where you don't reload the page.

if(this.localStream != null) {
    this.localStream.getTracks().forEach(function(track) {
        track.stop();
    });
}


Kevin Artesh

unread,
Feb 10, 2022, 4:40:12 PM2/10/22
to meetecho-janus
track.stop(); 
Not solving the problem.
I was test all solutions, and report this before in google group and github, but no attention from meetecho.

This bug was exist in meetecho live demo.
They run 'window.location.reload();' on 'destroyed' event, on live demo and this is not good and dirty way
reload page in janus live demo, show that their developers know that issue but have no solution for that, but for example 
lmin...@gmail.com reject and don't accept any issue.

janus-gateway is a great source, but their support was not good and friendly.

Kevin Artesh

unread,
Feb 10, 2022, 5:32:40 PM2/10/22
to meetecho-janus
WOW, Hey guys I find the solution:

function stopAndRemoveTrack(mediaStream) {
  return function(track) {
    track.stop();
    mediaStream.removeTrack(track);
  };
}

function stopMediaStream(mediaStream) {
  if (!mediaStream) {
    return;
  }

  mediaStream.getTracks().forEach(stopAndRemoveTrack(mediaStream));
}

function kill_own_feed(){
        for (const [key, value] of Object.entries(localTracks)) {
                stopMediaStream(localTracks[key]);
        }
        unpublishOwnFeed();
}

kill_own_feed();

Reply all
Reply to author
Forward
0 new messages