Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Apr 19, 2024
1 parent 7e2e09d commit e6f8091
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/detectors/VideoFreezesDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type VideoFreezesDetectorEvents = {
type InboundRtpStatsTrace = {
ssrc: number,
lastFreezeCount: number,
freezedStartedDuration: number,
freezedStartedDuration?: number,
freezed: boolean,
visited: boolean,
}
Expand Down Expand Up @@ -93,9 +93,9 @@ export class VideoFreezesDetector extends EventEmitter {
ssrc,
})
} else if (wasFreezed && !trace.freezed) {
const durationInS = Math.max(0, (stats.totalFreezesDuration ?? 0) - trace.freezedStartedDuration);
const durationInS = Math.max(0, (stats.totalFreezesDuration ?? 0) - (trace.freezedStartedDuration ?? 0));

trace.freezedStartedDuration = 0;
trace.freezedStartedDuration = undefined;

0 < durationInS && this.emit('freezedVideoEnded', {
peerConnectionId: inboundRtp.getPeerConnection()?.peerConnectionId,
Expand Down

0 comments on commit e6f8091

Please sign in to comment.