Skip to content

Commit

Permalink
* readme
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Apr 17, 2024
1 parent 5b034ef commit 5b18d8b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/ClientMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ export class ClientMonitor extends TypedEventEmitter<ClientMonitorEvents> {
detector.off('freezedVideoEnded', onFreezeEnded);
this._detectors.delete(VideoFreezesDetector.name);
});
detector.on('freezedVideoStarted', onFreezeStarted);
detector.on('freezedVideoEnded', onFreezeEnded);

this._detectors.set(VideoFreezesDetector.name, detector);

Expand Down

0 comments on commit 5b18d8b

Please sign in to comment.