Skip to content

Commit 865fb51

Browse files
committed
Stop preview Tracks when leaving Room
Fixes #9
1 parent 6a05d76 commit 865fb51

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

quickstart/src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ function roomJoined(room) {
130130
// of all Participants, including that of the LocalParticipant.
131131
room.on('disconnected', function() {
132132
log('Left');
133+
if (previewTracks) {
134+
previewTracks.forEach(function(track) {
135+
track.stop();
136+
});
137+
}
133138
detachParticipantTracks(room.localParticipant);
134139
room.participants.forEach(detachParticipantTracks);
135140
activeRoom = null;

0 commit comments

Comments
 (0)