Leaving room procedure

224 views
Skip to first unread message

hassine...@gmail.com

unread,
Sep 18, 2017, 5:26:44 AM9/18/17
to meetecho-janus
Hello ,  
I am confused on the procedure of leaving a room in videoRoom plugin . 
I thought that i have to send a leaving message and detach the stream , but after debugging , i saw that both unpublished and leaving events had happened when i leaved a room . 
what is the difference betwenn unpublish and leave ? 
we cannot leave without unpublishing ? 
Any one can explain to us the whole procedure of leaving a room (either for listener or for publisher)!
Thank you very much

Lorenzo Miniero

unread,
Sep 18, 2017, 7:29:44 AM9/18/17
to meetecho-janus
Unpublish is not a command, it's simply closing your PeerConnection, which means viewers will close it too. When you unpublish, you're still in as a Participant, and so you can publish again. If you leave, you have to detach and create a new handle. See the demo and the Unpublish/Publish button to see how this differs API wise.

L.

hassine...@gmail.com

unread,
Sep 18, 2017, 7:37:10 AM9/18/17
to meetecho-janus
I test the button , and i understood how it works .
The only thing that i didn't understand is that , when I leave the room definitely ( for example by cloosing the browser )  , these steps happened :
unpublished event  ( with feeds[i].rfid == unpublished )
detach handle
leaving event
what is the utility for leaving event message , i commented this block of code and i run the demo , I think unpublish + detach are suffisant !
Am I wrong ?

Lorenzo Miniero

unread,
Sep 18, 2017, 7:44:29 AM9/18/17
to meetecho-janus
Yes, if you detach then the "leave" request is not needed (the handle is gone and so the plugin implicitly treats it as a "leave" too).

L.

Lorenzo Miniero

unread,
Sep 18, 2017, 7:44:43 AM9/18/17
to meetecho-janus
Yes, if you detach then the "leave" request is not needed (the handle is gone and so the plugin implicitly treats it as a "leave" too).

L.

Il giorno lunedì 18 settembre 2017 13:37:10 UTC+2, hassine...@gmail.com ha scritto:

hassine...@gmail.com

unread,
Sep 18, 2017, 8:10:05 AM9/18/17
to meetecho-janus

Sorry for asking again ,
So if we can leave the room with unpublish + detach , the leaving event is used for what exactly ?!

Lorenzo Miniero

unread,
Sep 18, 2017, 8:38:29 AM9/18/17
to meetecho-janus
For state. Whatever you use to leave a room, we need an event to formalize this to you and others.

L.
Reply all
Reply to author
Forward
0 new messages