Skip to content

Commit

Permalink
VIDEO-11160 Pause dummy element only if no processed track exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
manjeshbhargav committed Feb 27, 2023
1 parent 89566fc commit 15131db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/media/track/localmediatrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ function restartWhenInadvertentlyStopped(localMediaTrack) {
}).catch(error => {
log.warn('Failed to detect silence:', error);
}).finally(() => {
// Pause the dummy element again.
el.pause();
// Pause the dummy element again, if there is no processed track.
if (!localMediaTrack.processedTrack) {
el.pause();
}
});
}

Expand Down
5 changes: 3 additions & 2 deletions lib/media/track/localvideotrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ function workaroundSilentLocalVideo(localVideoTrack, doc) {
}).catch(error => {
log.warn('Failed to detect silence and restart:', error);
}).finally(() => {
// If silent frames were not detected, then pause the dummy element again.
// If silent frames were not detected, then pause the dummy element again,
// if there is no processed track.
el = localVideoTrack._dummyEl;
if (el && !el.paused) {
if (el && !el.paused && !localVideoTrack.processedTrack) {
el.pause();
}

Expand Down

0 comments on commit 15131db

Please sign in to comment.