diff --git a/index.js b/index.js index 5281bca..58d4f87 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ import shaka from 'shaka-player' const SEND_STATS_AT = 30 * 1000 const AUTO = -1 +const SHAKA_READY = 'shaka:ready' export default class DashShakaPlayback extends HTML5Video { get name() {return 'dash_shaka_playback'} @@ -50,7 +51,7 @@ export default class DashShakaPlayback extends HTML5Video { !this._player && this._setup() if (!this.isReady) { - this.once(Events.PLAYBACK_READY, this.play) + this.once(SHAKA_READY, this.play) return } super.play() @@ -117,6 +118,7 @@ export default class DashShakaPlayback extends HTML5Video { _loaded() { this._isShakaReadyState = true + this.trigger(SHAKA_READY) this._ready() this._startToSendStats() this._levels = this.videoTracks().map((videoTrack) => { return {id: videoTrack.id, label: `${videoTrack.height}p`}})