Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
play(time=2, total=40) {
this.container.play()
this.container.onBuffering()
this.container.onProgress({current: 50})
this.container.playing()
this.container.updateBitrate(480)
this.playback.trigger(Events.PLAYBACK_TIMEUPDATE, {current: time, total: total})
}
bindEvents() {
this.listenTo(this.container, Events.CONTAINER_BITRATE, this.onBitrate)
this.listenTo(this.container, Events.CONTAINER_STOP, this.stopReporting)
this.listenTo(this.container, Events.CONTAINER_ENDED, this.stopReporting)
this.listenToOnce(this.container.playback, Events.PLAYBACK_PLAY_INTENT, this.startTimers)
this.listenToOnce(this.container, Events.CONTAINER_PLAY, this.onFirstPlaying)
this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay)
this.listenTo(this.container, Events.CONTAINER_PAUSE, this.onPause)
this.listenToOnce(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering)
this.listenTo(this.container, Events.CONTAINER_SEEK, this.onSeek)
this.listenTo(this.container, Events.CONTAINER_ERROR, () => this._inc('error'))
this.listenTo(this.container, Events.CONTAINER_FULLSCREEN, () => this._inc('fullscreen'))
this.listenTo(this.container, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, (dvrInUse) => {dvrInUse && this._inc('dvrUsage')})
this.listenTo(this.container.playback, Events.PLAYBACK_PROGRESS, this.onProgress)
this.listenTo(this.container.playback, Events.PLAYBACK_TIMEUPDATE, this.onTimeUpdate)
}