@observertc/client-monitor-js
Version:
ObserveRTC Client Integration Javascript Library
1 lines • 866 B
JavaScript
export class DryInboundTrackDetector{trackMonitor;name="dry-inbound-track-detector";constructor(t){this.trackMonitor=t}_evented=!1;get peerConnection(){return this.trackMonitor.getPeerConnection()}get config(){return this.peerConnection.parent.config.dryInboundTrackDetector}_activatedAt;update(){if(this._evented||this.config.disabled)return;if(0!==this.trackMonitor.getInboundRtp()?.bytesReceived)return;if(this.trackMonitor.remoteOutboundTrackPaused)return void(this._activatedAt=void 0);this._activatedAt||(this._activatedAt=Date.now());const t=Date.now()-this._activatedAt;if(t<this.config.thresholdInMs)return;this._evented=!0;const e=this.peerConnection.parent;e.emit("dry-inbound-track",{trackMonitor:this.trackMonitor,clientMonitor:e}),this.config.createIssue&&e.addIssue({type:"dry-inbound-track",payload:{trackId:this.trackMonitor.track.id,duration:t}})}}