Skip to content

Commit c70276b

Browse files
authored
Emit TrackSubscribed event only when room is connected (#1860)
1 parent 5470632 commit c70276b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/room/Room.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
21952195
track.on(TrackEvent.VideoPlaybackFailed, this.handleVideoPlaybackFailed);
21962196
track.on(TrackEvent.VideoPlaybackStarted, this.handleVideoPlaybackStarted);
21972197
}
2198-
this.emit(RoomEvent.TrackSubscribed, track, publication, participant);
2198+
this.emitWhenConnected(RoomEvent.TrackSubscribed, track, publication, participant);
21992199
},
22002200
)
22012201
.on(ParticipantEvent.TrackUnpublished, (publication: RemoteTrackPublication) => {

0 commit comments

Comments
 (0)