Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

videoroom: fix parse "Leave" and "Unpublish" event #50

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/plugins/videoroom-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,13 +516,6 @@ class VideoRoomHandle extends Handle {
janode_event.data.configured = message_data.configured;
break;
}
/* Display name changed event */
if (typeof message_data.display !== 'undefined' && typeof message_data.switched === 'undefined') {
janode_event.event = PLUGIN_EVENT.DISPLAY;
janode_event.data.feed = message_data.id;
janode_event.data.display = message_data.display;
break;
}
/* Subscribed feed started */
if (typeof message_data.started !== 'undefined') {
janode_event.event = PLUGIN_EVENT.STARTED;
Expand Down Expand Up @@ -559,13 +552,22 @@ class VideoRoomHandle extends Handle {
if (typeof message_data.unpublished !== 'undefined') {
janode_event.event = PLUGIN_EVENT.UNPUBLISHED;
janode_event.data.feed = (message_data.unpublished === 'ok') ? this.feed : message_data.unpublished;
if (message_data.display) janode_event.data.display = message_data.display;
break;
}
/* Leaving confirmation */
if (typeof message_data.leaving !== 'undefined') {
janode_event.event = PLUGIN_EVENT.LEAVING;
janode_event.data.feed = (message_data.leaving === 'ok') ? this.feed : message_data.leaving;
if (message_data.reason) janode_event.data.reason = message_data.reason;
if (message_data.display) janode_event.data.display = message_data.display;
break;
}
/* Display name changed event */
if (typeof message_data.display !== 'undefined' && typeof message_data.switched === 'undefined') {
janode_event.event = PLUGIN_EVENT.DISPLAY;
janode_event.data.feed = message_data.id;
janode_event.data.display = message_data.display;
break;
}
/* Participant kicked out */
Expand Down