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

Account for reconnect when adding track #366

Merged
merged 2 commits into from
Jul 29, 2022
Merged
Changes from 1 commit
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
Next Next commit
handle reconnect promise in onTrackAdded
  • Loading branch information
lukasIO committed Jul 29, 2022
commit fe9bbddddab260df3de446d61951a83c753a5fd0
4 changes: 2 additions & 2 deletions src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
// at that time, ICE connectivity has not been established so the track is not
// technically subscribed.
// We'll defer these events until when the room is connected or eventually disconnected.
if (this.connectFuture) {
this.connectFuture.promise.then(() => {
if (this.connectFuture || this.reconnectFuture) {
Promise.allSettled([this.connectFuture?.promise, this.reconnectFuture?.promise]).then(() => {
this.onTrackAdded(mediaTrack, stream, receiver);
});
return;
Expand Down