Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this._fillLevels()
// update stats that may have changed before we trigger event
// so that user can rely on stats data when handling event
this._sendStats()
if (this._pendingAdaptationEvent) {
this.trigger(Events.PLAYBACK_LEVEL_SWITCH_END)
this._pendingAdaptationEvent = false
}
Log.debug('an adaptation has happened:', activeVideo)
this.highDefinition = (activeVideo.height >= 720)
this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition)
this.trigger(Events.PLAYBACK_BITRATE, {
bandwidth: activeVideo.bandwidth,
width: activeVideo.width,
height: activeVideo.height,
level: activeVideo.id,
bitrate: activeVideo.videoBandwidth
})
}
_onAdaptation() {
var activeVideo = this.videoTracks.filter((t) => t.active === true)[0]
this._fillLevels()
Log.debug('an adaptation has happened:', activeVideo)
this.highDefinition = (activeVideo.height >= 720)
this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition)
this.trigger(Events.PLAYBACK_BITRATE, {
bandwidth: activeVideo.bandwidth,
width: activeVideo.width,
height: activeVideo.height,
level: activeVideo.id
})
}