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

Fix unsubscribe from the last stream in a connection #1401

Merged
merged 1 commit into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions erizo_controller/erizoClient/src/ErizoConnectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ class ErizoConnection extends EventEmitterConst {
removeStream(stream) {
const streamId = stream.getID();
if (!this.streamsMap.has(streamId)) {
Logger.warning(`message: Cannot remove stream not in map, streamId: ${streamId}`);
Logger.debug(`message: Cannot remove stream not in map, streamId: ${streamId}`);
return;
}
this.streamsMap.remove(streamId);
if (stream.local) {
this.stack.removeStream(stream.stream);
} else if (this.streamsMap.size() === 1) {
} else if (this.streamsMap.size() === 0) {
this.streamRemovedListener(stream.getLabel());
}
this.streamsMap.remove(streamId);
}

processSignalingMessage(msg) {
Expand Down
4 changes: 2 additions & 2 deletions erizo_controller/erizoClient/src/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ const Room = (altIo, altConnectionHelpers, altConnectionManager, specInput) => {
Logger.debug(`maybeDispatchStreamUnsubscribed - unsubscribe id ${stream.getID()}`, stream.unsubscribing);
if (stream && stream.unsubscribing.callbackReceived && stream.unsubscribing.pcEventReceived) {
Logger.info(`Dispatching Stream unsubscribed ${stream.getID()}`);
stream.unsubscribing.callbackReceived = false;
stream.unsubscribing.pcEventReceived = false;
removeStream(stream);
delete stream.failed;
const evt2 = StreamEvent({ type: 'stream-unsubscribed', stream });
stream.unsubscribing.callbackReceived = false;
stream.unsubscribing.pcEventReceived = false;
that.dispatchEvent(evt2);
} else {
Logger.debug(`Not dispatching stream unsubscribed yet ${stream.getID()}`);
Expand Down