diff --git a/README.md b/README.md index 8236315..77e4814 100644 --- a/README.md +++ b/README.md @@ -534,6 +534,33 @@ detector.on('statechanged', onStateChanged); ``` +### Video Freeze Detector + +```javascript +const detector = monitor.createVideoFreezesDetector({ + createIssueOnDetection: { + severity: 'major', + attachments: { + // various custom data + }, + } +}); +detector.on('freezedVideoStarted', event => { + console.log('Freezed video started'); + console.log('TrackId', event.trackId); + console.log('PeerConnectionId', event.peerConnectionId); + console.log('SSRC:', event.ssrc); +}); + +detector.on('freezedVideoEnded', event => { + console.log('Freezed video ended'); + console.log('TrackId', event.trackId); + console.log('Freeze duration in Seconds', event.durationInS); + console.log('PeerConnectionId', event.peerConnectionId); + console.log('SSRC:', event.ssrc); +}); +``` + ## Configurations ```javascript diff --git a/src/ClientMonitor.ts b/src/ClientMonitor.ts index d1bca78..62192a5 100644 --- a/src/ClientMonitor.ts +++ b/src/ClientMonitor.ts @@ -452,6 +452,8 @@ export class ClientMonitor extends TypedEventEmitter { detector.off('freezedVideoEnded', onFreezeEnded); this._detectors.delete(VideoFreezesDetector.name); }); + detector.on('freezedVideoStarted', onFreezeStarted); + detector.on('freezedVideoEnded', onFreezeEnded); this._detectors.set(VideoFreezesDetector.name, detector);