@clappr/hlsjs-playback 1.7.2 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hlsjs-playback.esm.js +120 -167
- package/dist/hlsjs-playback.external.js +120 -167
- package/dist/hlsjs-playback.external.min.js +1 -1
- package/dist/hlsjs-playback.external.min.js.map +1 -1
- package/dist/hlsjs-playback.js +120 -167
- package/dist/hlsjs-playback.min.js +1 -1
- package/dist/hlsjs-playback.min.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hlsjs-playback.external.min.js","sources":["../src/hls.js"],"sourcesContent":["// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport { Events, HTML5Video, Log, Playback, PlayerError, Utils } from '@clappr/core'\nimport HLSJS from 'hls.js'\n\nconst { now, listContainsIgnoreCase } = Utils\nconst AUTO = -1\nconst DEFAULT_RECOVER_ATTEMPTS = 16\n\nEvents.register('PLAYBACK_FRAGMENT_CHANGED')\nEvents.register('PLAYBACK_FRAGMENT_PARSING_METADATA')\n\nexport default class HlsjsPlayback extends HTML5Video {\n get name() { return 'hls' }\n\n get supportedVersion() { return { min: CLAPPR_CORE_VERSION } }\n\n get levels() { return this._levels || [] }\n\n get currentLevel() {\n if (this._currentLevel === null || this._currentLevel === undefined)\n return AUTO\n else\n return this._currentLevel //0 is a valid level ID\n\n }\n\n get isReady() {\n return this._isReadyState\n }\n\n set currentLevel(id) {\n this._currentLevel = id\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_START)\n if (this.options.playback.hlsUseNextLevel)\n this._hls.nextLevel = this._currentLevel\n else\n this._hls.currentLevel = this._currentLevel\n }\n\n get latency() {\n return this._hls.latency\n }\n\n get currentProgramDateTime() {\n return this._hls.playingDate\n }\n\n get _startTime() {\n if (this._playbackType === Playback.LIVE && this._playlistType !== 'EVENT')\n return this._extrapolatedStartTime\n\n return this._playableRegionStartTime\n }\n\n get _now() {\n return now()\n }\n\n // the time in the video element which should represent the start of the sliding window\n // extrapolated to increase in real time (instead of jumping as the early segments are removed)\n get _extrapolatedStartTime() {\n if (!this._localStartTimeCorrelation)\n return this._playableRegionStartTime\n\n let corr = this._localStartTimeCorrelation\n let timePassed = this._now - corr.local\n let extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000\n // cap at the end of the extrapolated window duration\n return Math.min(extrapolatedWindowStartTime, this._playableRegionStartTime + this._extrapolatedWindowDuration)\n }\n\n // the time in the video element which should represent the end of the content\n // extrapolated to increase in real time (instead of jumping as segments are added)\n get _extrapolatedEndTime() {\n let actualEndTime = this._playableRegionStartTime + this._playableRegionDuration\n if (!this._localEndTimeCorrelation) return actualEndTime\n const correlation = this._localEndTimeCorrelation\n const timePassed = this._now - correlation.local\n const extrapolatedEndTime = (correlation.remote + timePassed) / 1000\n return Math.max(actualEndTime - this._extrapolatedWindowDuration, Math.min(extrapolatedEndTime, actualEndTime))\n }\n\n get _duration() {\n return this._extrapolatedEndTime - this._startTime\n }\n\n // Returns the duration (seconds) of the window that the extrapolated start time is allowed\n // to move in before being capped.\n // The extrapolated start time should never reach the cap at the end of the window as the\n // window should slide as chunks are removed from the start.\n // This also applies to the extrapolated end time in the same way.\n //\n // If chunks aren't being removed for some reason that the start time will reach and remain fixed at\n // playableRegionStartTime + extrapolatedWindowDuration\n //\n // <-- window duration -->\n // I.e playableRegionStartTime |-----------------------|\n // | --> . . .\n // . --> | --> . .\n // . . --> | --> .\n // . . . --> |\n // . . . .\n // extrapolatedStartTime\n get _extrapolatedWindowDuration() {\n if (this._segmentTargetDuration === null)\n return 0\n\n return this._extrapolatedWindowNumSegments * this._segmentTargetDuration\n }\n\n get bandwidthEstimate() {\n return this._hls && this._hls.bandwidthEstimate\n }\n\n get defaultOptions() {\n return { preload: true }\n }\n\n get customListeners() {\n return this.options.hlsPlayback && this.options.hlsPlayback.customListeners || []\n }\n\n get sourceMedia() {\n return this.options.src\n }\n\n get currentTimestamp() {\n if (!this._currentFragment) return null\n const startTime = this._currentFragment.programDateTime\n const playbackTime = this.el.currentTime\n const playTimeOffSet = playbackTime - this._currentFragment.start\n const currentTimestampInMs = startTime + playTimeOffSet * 1000\n return currentTimestampInMs / 1000\n }\n\n static get HLSJS() {\n return HLSJS\n }\n\n constructor(...args) {\n super(...args)\n this.options.hlsPlayback = { ...this.defaultOptions, ...this.options.hlsPlayback }\n this._timeUpdateThrottleDelay = 200\n this._timeUpdateFiringRate = 0.2\n this._durationChangeMinOffset = 0.5\n this._setInitialState()\n }\n\n _setInitialState() {\n this._minDvrSize = typeof (this.options.hlsMinimumDvrSize) === 'undefined' ? 60 : this.options.hlsMinimumDvrSize\n // The size of the start time extrapolation window measured as a multiple of segments.\n // Should be 2 or higher, or 0 to disable. Should only need to be increased above 2 if more than one segment is\n // removed from the start of the playlist at a time. E.g if the playlist is cached for 10 seconds and new chunks are\n // added/removed every 5.\n this._extrapolatedWindowNumSegments = !this.options.playback || typeof (this.options.playback.extrapolatedWindowNumSegments) === 'undefined' ? 2 : this.options.playback.extrapolatedWindowNumSegments\n\n this._playbackType = Playback.VOD\n this._lastTimeUpdate = { current: 0, total: 0, firstFragDateTime: 0 }\n this._lastTimeUpdateFiredTime = 0\n this._lastDuration = null\n // for hls streams which have dvr with a sliding window,\n // the content at the start of the playlist is removed as new\n // content is appended at the end.\n // this means the actual playable start time will increase as the\n // start content is deleted\n // For streams with dvr where the entire recording is kept from the\n // beginning this should stay as 0\n this._playableRegionStartTime = 0\n // {local, remote} remote is the time in the video element that should represent 0\n // local is the system time when the 'remote' measurment took place\n this._localStartTimeCorrelation = null\n // {local, remote} remote is the time in the video element that should represents the end\n // local is the system time when the 'remote' measurment took place\n this._localEndTimeCorrelation = null\n // if content is removed from the beginning then this empty area should\n // be ignored. \"playableRegionDuration\" excludes the empty area\n this._playableRegionDuration = 0\n // #EXT-X-PROGRAM-DATE-TIME\n this._programDateTime = 0\n // true when the actual duration is longer than hlsjs's live sync point\n // when this is false playableRegionDuration will be the actual duration\n // when this is true playableRegionDuration will exclude the time after the sync point\n this._durationExcludesAfterLiveSyncPoint = false\n // #EXT-X-TARGETDURATION\n this._segmentTargetDuration = null\n // #EXT-X-PLAYLIST-TYPE\n this._playlistType = null\n this._recoverAttemptsRemaining = this.options.hlsRecoverAttempts || DEFAULT_RECOVER_ATTEMPTS\n }\n\n _setup() {\n this._destroyHLSInstance()\n this._createHLSInstance()\n this._listenHLSEvents()\n this._attachHLSMedia()\n }\n\n _destroyHLSInstance() {\n if (!this._hls) return\n this._manifestLoading = false\n this._ccIsSetup = false\n this._ccTracksUpdated = false\n this._setInitialState()\n this._hls.destroy()\n this._hls = null\n }\n\n _createHLSInstance() {\n const config = { ...this.options.playback.hlsjsConfig }\n this._hls = new HLSJS(config)\n }\n\n _attachHLSMedia() {\n if (!this._hls) return\n this._hls.attachMedia(this.el)\n }\n\n _listenHLSEvents() {\n if (!this._hls) return\n this._hls.once(HLSJS.Events.MEDIA_ATTACHED, () => { this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src) })\n this._hls.on(HLSJS.Events.MANIFEST_LOADING, () => this._manifestLoading = true)\n this._hls.on(HLSJS.Events.LEVEL_LOADED, (evt, data) => this._updatePlaybackType(evt, data))\n this._hls.on(HLSJS.Events.LEVEL_UPDATED, (evt, data) => this._onLevelUpdated(evt, data))\n this._hls.on(HLSJS.Events.LEVEL_SWITCHED, (evt,data) => this._onLevelSwitch(evt, data))\n this._hls.on(HLSJS.Events.FRAG_CHANGED, (evt, data) => this._onFragmentChanged(evt, data))\n this._hls.on(HLSJS.Events.FRAG_LOADED, (evt, data) => this._onFragmentLoaded(evt, data))\n this._hls.on(HLSJS.Events.FRAG_BUFFERED, (evt, data) => this._onFragmentBuffered(evt, data))\n this._hls.on(HLSJS.Events.FRAG_PARSING_METADATA, (evt, data) => this._onFragmentParsingMetadata(evt, data))\n this._hls.on(HLSJS.Events.ERROR, (evt, data) => this._onHLSJSError(evt, data))\n this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, (evt, data) => this._onSubtitleLoaded(evt, data))\n this._hls.on(HLSJS.Events.SUBTITLE_TRACKS_UPDATED, () => this._ccTracksUpdated = true)\n this.bindCustomListeners()\n }\n\n bindCustomListeners() {\n this.customListeners.forEach(item => {\n const requestedEventName = item.eventName\n const typeOfListener = item.once ? 'once': 'on'\n requestedEventName && this._hls[`${typeOfListener}`](requestedEventName, item.callback)\n })\n }\n\n unbindCustomListeners() {\n this.customListeners.forEach(item => {\n const requestedEventName = item.eventName\n requestedEventName && this._hls.off(requestedEventName, item.callback)\n })\n }\n\n _onFragmentParsingMetadata(evt, data) {\n this.trigger(Events.Custom.PLAYBACK_FRAGMENT_PARSING_METADATA, { evt, data })\n }\n\n render() {\n this._ready()\n return super.render()\n }\n\n _ready() {\n if (this._isReadyState) return\n !this._hls && this._setup()\n this._isReadyState = true\n this.trigger(Events.PLAYBACK_READY, this.name)\n }\n\n _recover(evt, data, error) {\n if (!this._recoveredDecodingError) {\n this._recoveredDecodingError = true\n this._hls.recoverMediaError()\n this.play()\n } else if (!this._recoveredAudioCodecError) {\n this._recoveredAudioCodecError = true\n this._hls.swapAudioCodec()\n this._hls.recoverMediaError()\n this.play()\n } else {\n Log.error('hlsjs: failed to recover', { evt, data })\n error.level = PlayerError.Levels.FATAL\n const formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n }\n }\n\n // override\n // this playback manages the src on the video element itself\n _setupSrc(srcUrl) {} // eslint-disable-line no-unused-vars\n\n _startTimeUpdateTimer() {\n if (this._timeUpdateTimer) return\n this._timeUpdateTimer = setInterval(() => {\n this._onDurationChange()\n this._onTimeUpdate()\n }, 100)\n }\n\n _stopTimeUpdateTimer() {\n if (!this._timeUpdateTimer) return\n clearInterval(this._timeUpdateTimer)\n this._timeUpdateTimer = null\n }\n\n getProgramDateTime() {\n return this._programDateTime\n }\n\n // the duration on the video element itself should not be used\n // as this does not necesarily represent the duration of the stream\n // https://github.com/clappr/clappr/issues/668#issuecomment-157036678\n getDuration() {\n return this._duration\n }\n\n getCurrentTime() {\n // e.g. can be < 0 if user pauses near the start\n // eventually they will then be kicked to the end by hlsjs if they run out of buffer\n // before the official start time\n return Math.max(0, this.el.currentTime - this._startTime)\n }\n\n // the time that \"0\" now represents relative to when playback started\n // for a stream with a sliding window this will increase as content is\n // removed from the beginning\n getStartTimeOffset() {\n return this._startTime\n }\n\n seekPercentage(percentage) {\n const seekTo = (percentage > 0)\n ? this._duration * (percentage / 100)\n : this._duration\n this.seek(seekTo)\n }\n\n seek(time) {\n if (time < 0) {\n Log.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.')\n time = this.getDuration()\n }\n time += this._startTime\n this.el.currentTime = time\n }\n\n seekToLivePoint() {\n this.seek(this.getDuration())\n }\n\n _updateSettings() {\n if (this._playbackType === Playback.VOD)\n this.settings.left = ['playpause', 'position', 'duration']\n else if (this.dvrEnabled)\n this.settings.left = ['playpause']\n else\n this.settings.left = ['playstop']\n\n this.settings.seekEnabled = this.isSeekEnabled()\n this.trigger(Events.PLAYBACK_SETTINGSUPDATE)\n }\n\n _onHLSJSError(evt, data) {\n const error = {\n code: `${data.type}_${data.details}`,\n description: `${this.name} error: type: ${data.type}, details: ${data.details}`,\n raw: data,\n }\n let formattedError\n if (data.response) error.description += `, response: ${JSON.stringify(data.response)}`\n // only report/handle errors if they are fatal\n // hlsjs should automatically handle non fatal errors\n if (data.fatal) {\n if (this._recoverAttemptsRemaining > 0) {\n this._recoverAttemptsRemaining -= 1\n switch (data.type) {\n case HLSJS.ErrorTypes.NETWORK_ERROR:\n switch (data.details) {\n // The following network errors cannot be recovered with HLS.startLoad()\n // For more details, see https://github.com/video-dev/hls.js/blob/master/doc/design.md#error-detection-and-handling\n // For \"level load\" fatal errors, see https://github.com/video-dev/hls.js/issues/1138\n case HLSJS.ErrorDetails.MANIFEST_LOAD_ERROR:\n case HLSJS.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case HLSJS.ErrorDetails.MANIFEST_PARSING_ERROR:\n case HLSJS.ErrorDetails.LEVEL_LOAD_ERROR:\n case HLSJS.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n Log.error('hlsjs: unrecoverable network fatal error.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n break\n default:\n Log.warn('hlsjs: trying to recover from network error.', { evt, data })\n error.level = PlayerError.Levels.WARN\n this._hls.startLoad()\n break\n }\n break\n case HLSJS.ErrorTypes.MEDIA_ERROR:\n Log.warn('hlsjs: trying to recover from media error.', { evt, data })\n error.level = PlayerError.Levels.WARN\n this._recover(evt, data, error)\n break\n default:\n Log.error('hlsjs: could not recover from error.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n break\n }\n } else {\n Log.error('hlsjs: could not recover from error after maximum number of attempts.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n }\n } else {\n // Transforms HLSJS.ErrorDetails.KEY_LOAD_ERROR non-fatal error to\n // playback fatal error if triggerFatalErrorOnResourceDenied playback\n // option is set. HLSJS.ErrorTypes.KEY_SYSTEM_ERROR are fatal errors\n // and therefore already handled.\n if (this.options.playback.triggerFatalErrorOnResourceDenied && this._keyIsDenied(data)) {\n Log.error('hlsjs: could not load decrypt key.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n return\n }\n\n error.level = PlayerError.Levels.WARN\n Log.warn('hlsjs: non-fatal error occurred', { evt, data })\n }\n }\n\n _keyIsDenied(data) {\n return data.type === HLSJS.ErrorTypes.NETWORK_ERROR\n && data.details === HLSJS.ErrorDetails.KEY_LOAD_ERROR\n && data.response\n && data.response.code >= 400\n }\n\n _onTimeUpdate() {\n const update = { current: this.getCurrentTime(), total: this.getDuration(), firstFragDateTime: this.getProgramDateTime() }\n const shouldThrottle = this._shouldThrottleTimeUpdate(update)\n if (shouldThrottle) return\n this._lastTimeUpdate = update\n this._lastTimeUpdateFiredTime = this._now\n this.trigger(Events.PLAYBACK_TIMEUPDATE, update, this.name)\n }\n\n _shouldThrottleTimeUpdate(update) {\n const isSameTime = Math.abs(update.current - this._lastTimeUpdate.current) < this._timeUpdateFiringRate\n const isSameDuration = Math.abs(update.total - this._lastTimeUpdate.total) < this._durationChangeMinOffset\n const isSameFirstFragDateTime = update.firstFragDateTime === this._lastTimeUpdate.firstFragDateTime\n const isSameEventPayload = isSameTime && isSameDuration && isSameFirstFragDateTime\n const isThrottled = this._now - this._lastTimeUpdateFiredTime < this._timeUpdateThrottleDelay\n\n return isSameEventPayload && isThrottled\n }\n\n _onDurationChange() {\n const duration = this.getDuration()\n const isSameDuration = Math.abs(this._lastDuration - duration) < this._durationChangeMinOffset\n if (isSameDuration) return\n this._lastDuration = duration\n super._onDurationChange()\n }\n\n _onProgress() {\n if (!this.el.buffered.length) return\n let buffered = []\n let bufferedPos = 0\n for (let i = 0; i < this.el.buffered.length; i++) {\n buffered = [...buffered, {\n // for a stream with sliding window dvr something that is buffered my slide off the start of the timeline\n start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),\n end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)\n }]\n if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end)\n bufferedPos = i\n\n }\n const progress = {\n start: buffered[bufferedPos].start,\n current: buffered[bufferedPos].end,\n total: this.getDuration()\n }\n this.trigger(Events.PLAYBACK_PROGRESS, progress, buffered)\n }\n\n load(url) { \n this._stopTimeUpdateTimer()\n this.options.src = url\n this._setup()\n }\n\n play() {\n !this._hls && this._setup()\n !this._manifestLoading && !this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src)\n super.play()\n this._startTimeUpdateTimer()\n }\n\n pause() {\n if (!this._hls) return\n this.el.pause()\n }\n\n stop() {\n this._stopTimeUpdateTimer()\n if (this._hls) super.stop()\n this._destroyHLSInstance()\n }\n\n destroy() {\n this._stopTimeUpdateTimer()\n this._destroyHLSInstance()\n super.destroy()\n }\n\n _updatePlaybackType(evt, data) {\n this._playbackType = data.details.live ? Playback.LIVE : Playback.VOD\n this._onLevelUpdated(evt, data)\n // Live stream subtitle tracks detection hack (may not immediately available)\n if (this._ccTracksUpdated && this._playbackType === Playback.LIVE && this.hasClosedCaptionsTracks)\n this._onSubtitleLoaded()\n\n }\n\n _fillLevels() {\n this._levels = this._hls.levels.map((level, index) => {\n return { id: index, level: level, label: `${level.bitrate/1000}Kbps` }\n })\n this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this._levels)\n }\n\n _onLevelUpdated(evt, data) {\n this._segmentTargetDuration = data.details.targetduration\n this._playlistType = data.details.type || null\n let startTimeChanged = false\n let durationChanged = false\n let fragments = data.details.fragments\n let previousPlayableRegionStartTime = this._playableRegionStartTime\n let previousPlayableRegionDuration = this._playableRegionDuration\n if (fragments.length === 0) return\n // #EXT-X-PROGRAM-DATE-TIME\n if (fragments[0].rawProgramDateTime)\n this._programDateTime = fragments[0].rawProgramDateTime\n if (this._playableRegionStartTime !== fragments[0].start) {\n startTimeChanged = true\n this._playableRegionStartTime = fragments[0].start\n }\n\n if (startTimeChanged) {\n if (!this._localStartTimeCorrelation) {\n // set the correlation to map to middle of the extrapolation window\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: (fragments[0].start + (this._extrapolatedWindowDuration/2)) * 1000\n }\n } else {\n // check if the correlation still works\n let corr = this._localStartTimeCorrelation\n let timePassed = this._now - corr.local\n // this should point to a time within the extrapolation window\n let startTime = (corr.remote + timePassed) / 1000\n if (startTime < fragments[0].start) {\n // our start time is now earlier than the first chunk\n // (maybe the chunk was removed early)\n // reset correlation so that it sits at the beginning of the first available chunk\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: fragments[0].start * 1000\n }\n } else if (startTime > previousPlayableRegionStartTime + this._extrapolatedWindowDuration) {\n // start time was past the end of the old extrapolation window (so would have been capped)\n // see if now that time would be inside the window, and if it would be set the correlation\n // so that it resumes from the time it was at at the end of the old window\n // update the correlation so that the time starts counting again from the value it's on now\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: Math.max(fragments[0].start, previousPlayableRegionStartTime + this._extrapolatedWindowDuration) * 1000\n }\n }\n }\n }\n \n let newDuration = data.details.totalduration\n // if it's a live stream then shorten the duration to remove access\n // to the area after hlsjs's live sync point\n // seeks to areas after this point sometimes have issues\n if (this._playbackType === Playback.LIVE) {\n let fragmentTargetDuration = data.details.targetduration\n let hlsjsConfig = this.options.playback.hlsjsConfig || {}\n let liveSyncDurationCount = hlsjsConfig.liveSyncDurationCount || HLSJS.DefaultConfig.liveSyncDurationCount\n let hiddenAreaDuration = fragmentTargetDuration * liveSyncDurationCount\n if (hiddenAreaDuration <= newDuration) {\n newDuration -= hiddenAreaDuration\n this._durationExcludesAfterLiveSyncPoint = true\n } else { this._durationExcludesAfterLiveSyncPoint = false }\n\n }\n if (newDuration !== this._playableRegionDuration) {\n durationChanged = true\n this._playableRegionDuration = newDuration\n }\n // Note the end time is not the playableRegionDuration\n // The end time will always increase even if content is removed from the beginning\n let endTime = fragments[0].start + newDuration\n let previousEndTime = previousPlayableRegionStartTime + previousPlayableRegionDuration\n let endTimeChanged = endTime !== previousEndTime\n if (endTimeChanged) {\n if (!this._localEndTimeCorrelation) {\n // set the correlation to map to the end\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: endTime * 1000\n }\n } else {\n // check if the correlation still works\n let corr = this._localEndTimeCorrelation\n let timePassed = this._now - corr.local\n // this should point to a time within the extrapolation window from the end\n let extrapolatedEndTime = (corr.remote + timePassed) / 1000\n if (extrapolatedEndTime > endTime) {\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: endTime * 1000\n }\n } else if (extrapolatedEndTime < endTime - this._extrapolatedWindowDuration) {\n // our extrapolated end time is now earlier than the extrapolation window from the actual end time\n // (maybe a chunk became available early)\n // reset correlation so that it sits at the beginning of the extrapolation window from the end time\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: (endTime - this._extrapolatedWindowDuration) * 1000\n }\n } else if (extrapolatedEndTime > previousEndTime) {\n // end time was past the old end time (so would have been capped)\n // set the correlation so that it resumes from the time it was at at the end of the old window\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: previousEndTime * 1000\n }\n }\n }\n }\n\n // now that the values have been updated call any methods that use on them so they get the updated values\n // immediately\n durationChanged && this._onDurationChange()\n startTimeChanged && this._onProgress()\n }\n\n _onFragmentChanged(evt, data) {\n this._currentFragment = data.frag\n this.trigger(Events.Custom.PLAYBACK_FRAGMENT_CHANGED, data)\n }\n\n _onFragmentLoaded(evt, data) {\n this.trigger(Events.PLAYBACK_FRAGMENT_LOADED, data)\n }\n\n _onFragmentBuffered(evt, data) {\n this.trigger(Events.PLAYBACK_FRAGMENT_BUFFERED, data)\n }\n\n _onSubtitleLoaded() {\n // This event may be triggered multiple times\n // Setup CC only once (disable CC by default)\n if (!this._ccIsSetup) {\n this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)\n const trackId = this._playbackType === Playback.LIVE ? -1 : this.closedCaptionsTrackId\n this.closedCaptionsTrackId = trackId\n this._ccIsSetup = true\n }\n }\n\n _onLevelSwitch(evt, data) {\n if (!this.levels.length) this._fillLevels()\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_END)\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH, data)\n let currentLevel = this._hls.levels[data.level]\n if (currentLevel) {\n // TODO should highDefinition be private and maybe have a read only accessor if it's used somewhere\n this.highDefinition = (currentLevel.height >= 720 || (currentLevel.bitrate / 1000) >= 2000)\n this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition)\n this.trigger(Events.PLAYBACK_BITRATE, {\n height: currentLevel.height,\n width: currentLevel.width,\n bandwidth: currentLevel.bitrate,\n bitrate: currentLevel.bitrate,\n level: data.level\n })\n }\n }\n\n get dvrEnabled() {\n // enabled when:\n // - the duration does not include content after hlsjs's live sync point\n // - the playable region duration is longer than the configured duration to enable dvr after\n // - the playback type is LIVE.\n return (this._durationExcludesAfterLiveSyncPoint && this._duration >= this._minDvrSize && this.getPlaybackType() === Playback.LIVE)\n }\n\n getPlaybackType() {\n return this._playbackType\n }\n\n isSeekEnabled() {\n return (this._playbackType === Playback.VOD || this.dvrEnabled)\n }\n}\n\nHlsjsPlayback.canPlay = function(resource, mimeType) {\n const resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || []\n const isHls = ((resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8') || listContainsIgnoreCase(mimeType, ['application/vnd.apple.mpegurl', 'application/x-mpegURL']))\n return !!(HLSJS.isSupported() && isHls)\n}\n"],"names":["now","Utils","listContainsIgnoreCase","Events","register","HlsjsPlayback","_HTML5Video","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","this","concat","options","hlsPlayback","_objectSpread","defaultOptions","_timeUpdateThrottleDelay","_timeUpdateFiringRate","_durationChangeMinOffset","_setInitialState","key","get","HLSJS","min","_levels","_currentLevel","undefined","set","id","trigger","PLAYBACK_LEVEL_SWITCH_START","playback","hlsUseNextLevel","_hls","nextLevel","currentLevel","_isReadyState","latency","playingDate","_playbackType","Playback","LIVE","_playlistType","_extrapolatedStartTime","_playableRegionStartTime","_localStartTimeCorrelation","corr","timePassed","_now","local","extrapolatedWindowStartTime","remote","Math","_extrapolatedWindowDuration","actualEndTime","_playableRegionDuration","_localEndTimeCorrelation","correlation","extrapolatedEndTime","max","_extrapolatedEndTime","_startTime","_segmentTargetDuration","_extrapolatedWindowNumSegments","bandwidthEstimate","preload","customListeners","src","_currentFragment","programDateTime","el","currentTime","start","value","_minDvrSize","hlsMinimumDvrSize","extrapolatedWindowNumSegments","VOD","_lastTimeUpdate","current","total","firstFragDateTime","_lastTimeUpdateFiredTime","_lastDuration","_programDateTime","_durationExcludesAfterLiveSyncPoint","_recoverAttemptsRemaining","hlsRecoverAttempts","_destroyHLSInstance","_createHLSInstance","_listenHLSEvents","_attachHLSMedia","_manifestLoading","_ccIsSetup","_ccTracksUpdated","destroy","config","hlsjsConfig","attachMedia","_this2","once","MEDIA_ATTACHED","loadSource","on","MANIFEST_LOADING","LEVEL_LOADED","evt","data","_updatePlaybackType","LEVEL_UPDATED","_onLevelUpdated","LEVEL_SWITCHED","_onLevelSwitch","FRAG_CHANGED","_onFragmentChanged","FRAG_LOADED","_onFragmentLoaded","FRAG_BUFFERED","_onFragmentBuffered","FRAG_PARSING_METADATA","_onFragmentParsingMetadata","ERROR","_onHLSJSError","SUBTITLE_TRACK_LOADED","_onSubtitleLoaded","SUBTITLE_TRACKS_UPDATED","bindCustomListeners","_this3","forEach","item","requestedEventName","eventName","typeOfListener","callback","_this4","off","Custom","PLAYBACK_FRAGMENT_PARSING_METADATA","_ready","_get","_getPrototypeOf","prototype","_setup","PLAYBACK_READY","name","error","_recoveredDecodingError","_recoveredAudioCodecError","Log","level","PlayerError","Levels","FATAL","formattedError","createError","PLAYBACK_ERROR","stop","swapAudioCodec","recoverMediaError","play","srcUrl","_this5","_timeUpdateTimer","setInterval","_onDurationChange","_onTimeUpdate","clearInterval","_duration","percentage","seekTo","seek","time","warn","getDuration","settings","left","dvrEnabled","seekEnabled","isSeekEnabled","PLAYBACK_SETTINGSUPDATE","code","type","details","description","raw","response","JSON","stringify","fatal","ErrorTypes","NETWORK_ERROR","ErrorDetails","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","WARN","startLoad","MEDIA_ERROR","_recover","triggerFatalErrorOnResourceDenied","_keyIsDenied","KEY_LOAD_ERROR","update","getCurrentTime","getProgramDateTime","_shouldThrottleTimeUpdate","PLAYBACK_TIMEUPDATE","isSameTime","abs","isSameDuration","isSameFirstFragDateTime","isSameEventPayload","isThrottled","duration","buffered","bufferedPos","i","_toConsumableArray","end","progress","PLAYBACK_PROGRESS","url","_stopTimeUpdateTimer","_startTimeUpdateTimer","pause","live","hasClosedCaptionsTracks","levels","map","index","label","bitrate","PLAYBACK_LEVELS_AVAILABLE","targetduration","startTimeChanged","durationChanged","fragments","previousPlayableRegionStartTime","previousPlayableRegionDuration","rawProgramDateTime","startTime","newDuration","totalduration","hiddenAreaDuration","liveSyncDurationCount","DefaultConfig","endTime","previousEndTime","_onProgress","frag","PLAYBACK_FRAGMENT_CHANGED","PLAYBACK_FRAGMENT_LOADED","PLAYBACK_FRAGMENT_BUFFERED","PLAYBACK_SUBTITLE_AVAILABLE","trackId","closedCaptionsTrackId","_fillLevels","PLAYBACK_LEVEL_SWITCH_END","PLAYBACK_LEVEL_SWITCH","highDefinition","height","PLAYBACK_HIGHDEFINITIONUPDATE","PLAYBACK_BITRATE","width","bandwidth","getPlaybackType","HTML5Video","canPlay","resource","mimeType","resourceParts","split","match","isHls","toLowerCase","isSupported"],"mappings":"k1GAOA,IAAQA,EAAgCC,EAAKA,MAArCD,IAAKE,EAA2BD,EAAKA,MAAhCC,uBAIbC,EAAAA,OAAOC,SAAS,6BAChBD,EAAAA,OAAOC,SAAS,sCAEKC,IAAAA,WAAaC,yRAAAC,CAAAF,EAAAC,GAAA,UAAAE,EAAAC,EAAAJ,GAgIhC,SAAAA,IAAqB,IAAAK,+FAAAC,MAAAN,GAAA,IAAA,IAAAO,EAAAC,UAAAC,OAANC,EAAIC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAJF,EAAIE,GAAAJ,UAAAI,GAMM,OALvBP,EAAAF,EAAAU,KAAAC,MAAAX,EAAA,CAAAY,MAAAC,OAASN,KACJO,QAAQC,YAAWC,EAAAA,EAAA,CAAA,EAAQd,EAAKe,gBAAmBf,EAAKY,QAAQC,aACrEb,EAAKgB,yBAA2B,IAChChB,EAAKiB,sBAAwB,GAC7BjB,E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AAK6B,gBAAkBC,EAAAA,SAASqC,KAAOnE,KAAKsK,UACtD,oFA3jBCrL,CAAA,EA9HwCiR,qBA4rB3CjR,EAAckR,QAAU,SAASC,EAAUC,GACzC,IAAMC,EAAgBF,EAASG,MAAM,KAAK,GAAGC,MAAM,cAAgB,GAC7DC,EAAUH,EAAc5Q,OAAS,GAAwC,SAAnC4Q,EAAc,GAAGI,eAA6B5R,EAAuBuR,EAAU,CAAC,gCAAiC,0BAC7J,SAAUzP,EAAK,QAAC+P,gBAAiBF,EACnC"}
|
|
1
|
+
{"version":3,"file":"hlsjs-playback.external.min.js","sources":["../src/hls.js"],"sourcesContent":["// Copyright 2014 Globo.com Player authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport { Events, HTML5Video, Log, Playback, PlayerError, Utils } from '@clappr/core'\nimport HLSJS from 'hls.js'\n\nconst { now, listContainsIgnoreCase } = Utils\nconst AUTO = -1\nconst DEFAULT_RECOVER_ATTEMPTS = 16\n\nEvents.register('PLAYBACK_FRAGMENT_CHANGED')\nEvents.register('PLAYBACK_FRAGMENT_PARSING_METADATA')\n\nexport default class HlsjsPlayback extends HTML5Video {\n get name() { return 'hls' }\n\n get supportedVersion() { return { min: CLAPPR_CORE_VERSION } }\n\n get levels() { return this._levels || [] }\n\n get currentLevel() {\n if (this._currentLevel === null || this._currentLevel === undefined)\n return AUTO\n else\n return this._currentLevel //0 is a valid level ID\n\n }\n\n get isReady() {\n return this._isReadyState\n }\n\n set currentLevel(id) {\n this._currentLevel = id\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_START)\n if (this.options.playback.hlsUseNextLevel)\n this._hls.nextLevel = this._currentLevel\n else\n this._hls.currentLevel = this._currentLevel\n }\n\n get latency() {\n return this._hls.latency\n }\n\n get currentProgramDateTime() {\n return this._hls.playingDate\n }\n\n get _startTime() {\n if (this._playbackType === Playback.LIVE && this._playlistType !== 'EVENT')\n return this._extrapolatedStartTime\n\n return this._playableRegionStartTime\n }\n\n get _now() {\n return now()\n }\n\n // the time in the video element which should represent the start of the sliding window\n // extrapolated to increase in real time (instead of jumping as the early segments are removed)\n get _extrapolatedStartTime() {\n if (!this._localStartTimeCorrelation)\n return this._playableRegionStartTime\n\n let corr = this._localStartTimeCorrelation\n let timePassed = this._now - corr.local\n let extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000\n // cap at the end of the extrapolated window duration\n return Math.min(extrapolatedWindowStartTime, this._playableRegionStartTime + this._extrapolatedWindowDuration)\n }\n\n // the time in the video element which should represent the end of the content\n // extrapolated to increase in real time (instead of jumping as segments are added)\n get _extrapolatedEndTime() {\n let actualEndTime = this._playableRegionStartTime + this._playableRegionDuration\n if (!this._localEndTimeCorrelation) return actualEndTime\n const correlation = this._localEndTimeCorrelation\n const timePassed = this._now - correlation.local\n const extrapolatedEndTime = (correlation.remote + timePassed) / 1000\n return Math.max(actualEndTime - this._extrapolatedWindowDuration, Math.min(extrapolatedEndTime, actualEndTime))\n }\n\n get _duration() {\n return this._extrapolatedEndTime - this._startTime\n }\n\n // Returns the duration (seconds) of the window that the extrapolated start time is allowed\n // to move in before being capped.\n // The extrapolated start time should never reach the cap at the end of the window as the\n // window should slide as chunks are removed from the start.\n // This also applies to the extrapolated end time in the same way.\n //\n // If chunks aren't being removed for some reason that the start time will reach and remain fixed at\n // playableRegionStartTime + extrapolatedWindowDuration\n //\n // <-- window duration -->\n // I.e playableRegionStartTime |-----------------------|\n // | --> . . .\n // . --> | --> . .\n // . . --> | --> .\n // . . . --> |\n // . . . .\n // extrapolatedStartTime\n get _extrapolatedWindowDuration() {\n if (this._segmentTargetDuration === null)\n return 0\n\n return this._extrapolatedWindowNumSegments * this._segmentTargetDuration\n }\n\n get bandwidthEstimate() {\n return this._hls && this._hls.bandwidthEstimate\n }\n\n get defaultOptions() {\n return { preload: true }\n }\n\n get customListeners() {\n return this.options.hlsPlayback && this.options.hlsPlayback.customListeners || []\n }\n\n get sourceMedia() {\n return this.options.src\n }\n\n get currentTimestamp() {\n if (!this._currentFragment) return null\n const startTime = this._currentFragment.programDateTime\n const playbackTime = this.el.currentTime\n const playTimeOffSet = playbackTime - this._currentFragment.start\n const currentTimestampInMs = startTime + playTimeOffSet * 1000\n return currentTimestampInMs / 1000\n }\n\n static get HLSJS() {\n return HLSJS\n }\n\n constructor(...args) {\n super(...args)\n this.options.hlsPlayback = { ...this.defaultOptions, ...this.options.hlsPlayback }\n this._timeUpdateThrottleDelay = 200\n this._timeUpdateFiringRate = 0.2\n this._durationChangeMinOffset = 0.5\n this._setInitialState()\n }\n\n _setInitialState() {\n this._minDvrSize = typeof (this.options.hlsMinimumDvrSize) === 'undefined' ? 60 : this.options.hlsMinimumDvrSize\n // The size of the start time extrapolation window measured as a multiple of segments.\n // Should be 2 or higher, or 0 to disable. Should only need to be increased above 2 if more than one segment is\n // removed from the start of the playlist at a time. E.g if the playlist is cached for 10 seconds and new chunks are\n // added/removed every 5.\n this._extrapolatedWindowNumSegments = !this.options.playback || typeof (this.options.playback.extrapolatedWindowNumSegments) === 'undefined' ? 2 : this.options.playback.extrapolatedWindowNumSegments\n\n this._playbackType = Playback.VOD\n this._lastTimeUpdate = { current: 0, total: 0, firstFragDateTime: 0 }\n this._lastTimeUpdateFiredTime = 0\n this._lastDuration = null\n // for hls streams which have dvr with a sliding window,\n // the content at the start of the playlist is removed as new\n // content is appended at the end.\n // this means the actual playable start time will increase as the\n // start content is deleted\n // For streams with dvr where the entire recording is kept from the\n // beginning this should stay as 0\n this._playableRegionStartTime = 0\n // {local, remote} remote is the time in the video element that should represent 0\n // local is the system time when the 'remote' measurment took place\n this._localStartTimeCorrelation = null\n // {local, remote} remote is the time in the video element that should represents the end\n // local is the system time when the 'remote' measurment took place\n this._localEndTimeCorrelation = null\n // if content is removed from the beginning then this empty area should\n // be ignored. \"playableRegionDuration\" excludes the empty area\n this._playableRegionDuration = 0\n // #EXT-X-PROGRAM-DATE-TIME\n this._programDateTime = 0\n // true when the actual duration is longer than hlsjs's live sync point\n // when this is false playableRegionDuration will be the actual duration\n // when this is true playableRegionDuration will exclude the time after the sync point\n this._durationExcludesAfterLiveSyncPoint = false\n // #EXT-X-TARGETDURATION\n this._segmentTargetDuration = null\n // #EXT-X-PLAYLIST-TYPE\n this._playlistType = null\n this._recoverAttemptsRemaining = this.options.hlsRecoverAttempts || DEFAULT_RECOVER_ATTEMPTS\n }\n\n _setup() {\n this._destroyHLSInstance()\n this._createHLSInstance()\n this._listenHLSEvents()\n this._attachHLSMedia()\n }\n\n _destroyHLSInstance() {\n if (!this._hls) return\n this._manifestLoading = false\n this._ccIsSetup = false\n this._ccTracksUpdated = false\n this._setInitialState()\n this._hls.destroy()\n this._hls = null\n }\n\n _createHLSInstance() {\n const config = { ...this.options.playback.hlsjsConfig }\n this._hls = new HLSJS(config)\n }\n\n _attachHLSMedia() {\n if (!this._hls) return\n this._hls.attachMedia(this.el)\n }\n\n _listenHLSEvents() {\n if (!this._hls) return\n this._hls.once(HLSJS.Events.MEDIA_ATTACHED, () => { this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src) })\n this._hls.on(HLSJS.Events.MANIFEST_LOADING, () => this._manifestLoading = true)\n this._hls.on(HLSJS.Events.LEVEL_LOADED, (evt, data) => this._updatePlaybackType(evt, data))\n this._hls.on(HLSJS.Events.LEVEL_UPDATED, (evt, data) => this._onLevelUpdated(evt, data))\n this._hls.on(HLSJS.Events.LEVEL_SWITCHED, (evt,data) => this._onLevelSwitch(evt, data))\n this._hls.on(HLSJS.Events.FRAG_CHANGED, (evt, data) => this._onFragmentChanged(evt, data))\n this._hls.on(HLSJS.Events.FRAG_LOADED, (evt, data) => this._onFragmentLoaded(evt, data))\n this._hls.on(HLSJS.Events.FRAG_BUFFERED, (evt, data) => this._onFragmentBuffered(evt, data))\n this._hls.on(HLSJS.Events.FRAG_PARSING_METADATA, (evt, data) => this._onFragmentParsingMetadata(evt, data))\n this._hls.on(HLSJS.Events.ERROR, (evt, data) => this._onHLSJSError(evt, data))\n this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, (evt, data) => this._onSubtitleLoaded(evt, data))\n this._hls.on(HLSJS.Events.SUBTITLE_TRACKS_UPDATED, () => this._ccTracksUpdated = true)\n this.bindCustomListeners()\n }\n\n bindCustomListeners() {\n this.customListeners.forEach(item => {\n const requestedEventName = item.eventName\n const typeOfListener = item.once ? 'once': 'on'\n requestedEventName && this._hls[`${typeOfListener}`](requestedEventName, item.callback)\n })\n }\n\n unbindCustomListeners() {\n this.customListeners.forEach(item => {\n const requestedEventName = item.eventName\n requestedEventName && this._hls.off(requestedEventName, item.callback)\n })\n }\n\n _onFragmentParsingMetadata(evt, data) {\n this.trigger(Events.Custom.PLAYBACK_FRAGMENT_PARSING_METADATA, { evt, data })\n }\n\n render() {\n this._ready()\n return super.render()\n }\n\n _ready() {\n if (this._isReadyState) return\n !this._hls && this._setup()\n this._isReadyState = true\n this.trigger(Events.PLAYBACK_READY, this.name)\n }\n\n _recover(evt, data, error) {\n if (!this._recoveredDecodingError) {\n this._recoveredDecodingError = true\n this._hls.recoverMediaError()\n this.play()\n } else if (!this._recoveredAudioCodecError) {\n this._recoveredAudioCodecError = true\n this._hls.swapAudioCodec()\n this._hls.recoverMediaError()\n this.play()\n } else {\n Log.error('hlsjs: failed to recover', { evt, data })\n error.level = PlayerError.Levels.FATAL\n const formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n }\n }\n\n // override\n // this playback manages the src on the video element itself\n _setupSrc(srcUrl) {} // eslint-disable-line no-unused-vars\n\n _startTimeUpdateTimer() {\n if (this._timeUpdateTimer) return\n this._timeUpdateTimer = setInterval(() => {\n this._onDurationChange()\n this._onTimeUpdate()\n }, 100)\n }\n\n _stopTimeUpdateTimer() {\n if (!this._timeUpdateTimer) return\n clearInterval(this._timeUpdateTimer)\n this._timeUpdateTimer = null\n }\n\n getProgramDateTime() {\n return this._programDateTime\n }\n\n // the duration on the video element itself should not be used\n // as this does not necesarily represent the duration of the stream\n // https://github.com/clappr/clappr/issues/668#issuecomment-157036678\n getDuration() {\n return this._duration\n }\n\n getCurrentTime() {\n // e.g. can be < 0 if user pauses near the start\n // eventually they will then be kicked to the end by hlsjs if they run out of buffer\n // before the official start time\n return Math.max(0, this.el.currentTime - this._startTime)\n }\n\n // the time that \"0\" now represents relative to when playback started\n // for a stream with a sliding window this will increase as content is\n // removed from the beginning\n getStartTimeOffset() {\n return this._startTime\n }\n\n seekPercentage(percentage) {\n const seekTo = (percentage > 0)\n ? this._duration * (percentage / 100)\n : this._duration\n this.seek(seekTo)\n }\n\n seek(time) {\n if (time < 0) {\n Log.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.')\n time = this.getDuration()\n }\n time += this._startTime\n this.el.currentTime = time\n }\n\n seekToLivePoint() {\n this.seek(this.getDuration())\n }\n\n _updateSettings() {\n if (this._playbackType === Playback.VOD)\n this.settings.left = ['playpause', 'position', 'duration']\n else if (this.dvrEnabled)\n this.settings.left = ['playpause']\n else\n this.settings.left = ['playstop']\n\n this.settings.seekEnabled = this.isSeekEnabled()\n this.trigger(Events.PLAYBACK_SETTINGSUPDATE)\n }\n\n _onHLSJSError(evt, data) {\n const error = {\n code: `${data.type}_${data.details}`,\n description: `${this.name} error: type: ${data.type}, details: ${data.details}`,\n raw: data,\n }\n let formattedError\n if (data.response) error.description += `, response: ${JSON.stringify(data.response)}`\n // only report/handle errors if they are fatal\n // hlsjs should automatically handle non fatal errors\n if (data.fatal) {\n if (this._recoverAttemptsRemaining > 0) {\n this._recoverAttemptsRemaining -= 1\n switch (data.type) {\n case HLSJS.ErrorTypes.NETWORK_ERROR:\n switch (data.details) {\n // The following network errors cannot be recovered with HLS.startLoad()\n // For more details, see https://github.com/video-dev/hls.js/blob/master/doc/design.md#error-detection-and-handling\n // For \"level load\" fatal errors, see https://github.com/video-dev/hls.js/issues/1138\n case HLSJS.ErrorDetails.MANIFEST_LOAD_ERROR:\n case HLSJS.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case HLSJS.ErrorDetails.MANIFEST_PARSING_ERROR:\n case HLSJS.ErrorDetails.LEVEL_LOAD_ERROR:\n case HLSJS.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n Log.error('hlsjs: unrecoverable network fatal error.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n break\n default:\n Log.warn('hlsjs: trying to recover from network error.', { evt, data })\n error.level = PlayerError.Levels.WARN\n this._hls.startLoad()\n break\n }\n break\n case HLSJS.ErrorTypes.MEDIA_ERROR:\n Log.warn('hlsjs: trying to recover from media error.', { evt, data })\n error.level = PlayerError.Levels.WARN\n this._recover(evt, data, error)\n break\n default:\n Log.error('hlsjs: could not recover from error.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n break\n }\n } else {\n Log.error('hlsjs: could not recover from error after maximum number of attempts.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n }\n } else {\n // Transforms HLSJS.ErrorDetails.KEY_LOAD_ERROR non-fatal error to\n // playback fatal error if triggerFatalErrorOnResourceDenied playback\n // option is set. HLSJS.ErrorTypes.KEY_SYSTEM_ERROR are fatal errors\n // and therefore already handled.\n if (this.options.playback.triggerFatalErrorOnResourceDenied && this._keyIsDenied(data)) {\n Log.error('hlsjs: could not load decrypt key.', { evt, data })\n formattedError = this.createError(error)\n this.trigger(Events.PLAYBACK_ERROR, formattedError)\n this.stop()\n return\n }\n\n error.level = PlayerError.Levels.WARN\n Log.warn('hlsjs: non-fatal error occurred', { evt, data })\n }\n }\n\n _keyIsDenied(data) {\n return data.type === HLSJS.ErrorTypes.NETWORK_ERROR\n && data.details === HLSJS.ErrorDetails.KEY_LOAD_ERROR\n && data.response\n && data.response.code >= 400\n }\n\n _onTimeUpdate() {\n const update = { current: this.getCurrentTime(), total: this.getDuration(), firstFragDateTime: this.getProgramDateTime() }\n const shouldThrottle = this._shouldThrottleTimeUpdate(update)\n if (shouldThrottle) return\n this._lastTimeUpdate = update\n this._lastTimeUpdateFiredTime = this._now\n this.trigger(Events.PLAYBACK_TIMEUPDATE, update, this.name)\n }\n\n _shouldThrottleTimeUpdate(update) {\n const isSameTime = Math.abs(update.current - this._lastTimeUpdate.current) < this._timeUpdateFiringRate\n const isSameDuration = Math.abs(update.total - this._lastTimeUpdate.total) < this._durationChangeMinOffset\n const isSameFirstFragDateTime = update.firstFragDateTime === this._lastTimeUpdate.firstFragDateTime\n const isSameEventPayload = isSameTime && isSameDuration && isSameFirstFragDateTime\n const isThrottled = this._now - this._lastTimeUpdateFiredTime < this._timeUpdateThrottleDelay\n\n return isSameEventPayload && isThrottled\n }\n\n _onDurationChange() {\n const duration = this.getDuration()\n const isSameDuration = Math.abs(this._lastDuration - duration) < this._durationChangeMinOffset\n if (isSameDuration) return\n this._lastDuration = duration\n super._onDurationChange()\n }\n\n _onProgress() {\n if (!this.el.buffered.length) return\n let buffered = []\n let bufferedPos = 0\n for (let i = 0; i < this.el.buffered.length; i++) {\n buffered = [...buffered, {\n // for a stream with sliding window dvr something that is buffered my slide off the start of the timeline\n start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),\n end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)\n }]\n if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end)\n bufferedPos = i\n\n }\n const progress = {\n start: buffered[bufferedPos].start,\n current: buffered[bufferedPos].end,\n total: this.getDuration()\n }\n this.trigger(Events.PLAYBACK_PROGRESS, progress, buffered)\n }\n\n load(url) { \n this._stopTimeUpdateTimer()\n this.options.src = url\n this._setup()\n }\n\n play() {\n !this._hls && this._setup()\n !this._manifestLoading && !this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src)\n super.play()\n this._startTimeUpdateTimer()\n }\n\n pause() {\n if (!this._hls) return\n this.el.pause()\n }\n\n stop() {\n this._stopTimeUpdateTimer()\n if (this._hls) super.stop()\n this._destroyHLSInstance()\n }\n\n destroy() {\n this._stopTimeUpdateTimer()\n this._destroyHLSInstance()\n super.destroy()\n }\n\n _updatePlaybackType(evt, data) {\n this._playbackType = data.details.live ? Playback.LIVE : Playback.VOD\n this._onLevelUpdated(evt, data)\n // Live stream subtitle tracks detection hack (may not immediately available)\n if (this._ccTracksUpdated && this._playbackType === Playback.LIVE && this.hasClosedCaptionsTracks)\n this._onSubtitleLoaded()\n\n }\n\n _fillLevels() {\n this._levels = this._hls.levels.map((level, index) => {\n return { id: index, level: level, label: `${level.bitrate/1000}Kbps` }\n })\n this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this._levels)\n }\n\n _onLevelUpdated(evt, data) {\n this._segmentTargetDuration = data.details.targetduration\n this._playlistType = data.details.type || null\n let startTimeChanged = false\n let durationChanged = false\n let fragments = data.details.fragments\n let previousPlayableRegionStartTime = this._playableRegionStartTime\n let previousPlayableRegionDuration = this._playableRegionDuration\n if (fragments.length === 0) return\n // #EXT-X-PROGRAM-DATE-TIME\n if (fragments[0].rawProgramDateTime)\n this._programDateTime = fragments[0].rawProgramDateTime\n if (this._playableRegionStartTime !== fragments[0].start) {\n startTimeChanged = true\n this._playableRegionStartTime = fragments[0].start\n }\n\n if (startTimeChanged) {\n if (!this._localStartTimeCorrelation) {\n // set the correlation to map to middle of the extrapolation window\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: (fragments[0].start + (this._extrapolatedWindowDuration/2)) * 1000\n }\n } else {\n // check if the correlation still works\n let corr = this._localStartTimeCorrelation\n let timePassed = this._now - corr.local\n // this should point to a time within the extrapolation window\n let startTime = (corr.remote + timePassed) / 1000\n if (startTime < fragments[0].start) {\n // our start time is now earlier than the first chunk\n // (maybe the chunk was removed early)\n // reset correlation so that it sits at the beginning of the first available chunk\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: fragments[0].start * 1000\n }\n } else if (startTime > previousPlayableRegionStartTime + this._extrapolatedWindowDuration) {\n // start time was past the end of the old extrapolation window (so would have been capped)\n // see if now that time would be inside the window, and if it would be set the correlation\n // so that it resumes from the time it was at at the end of the old window\n // update the correlation so that the time starts counting again from the value it's on now\n this._localStartTimeCorrelation = {\n local: this._now,\n remote: Math.max(fragments[0].start, previousPlayableRegionStartTime + this._extrapolatedWindowDuration) * 1000\n }\n }\n }\n }\n \n let newDuration = data.details.totalduration\n // if it's a live stream then shorten the duration to remove access\n // to the area after hlsjs's live sync point\n // seeks to areas after this point sometimes have issues\n if (this._playbackType === Playback.LIVE) {\n let fragmentTargetDuration = data.details.targetduration\n let hlsjsConfig = this.options.playback.hlsjsConfig || {}\n let liveSyncDurationCount = hlsjsConfig.liveSyncDurationCount || HLSJS.DefaultConfig.liveSyncDurationCount\n let hiddenAreaDuration = fragmentTargetDuration * liveSyncDurationCount\n if (hiddenAreaDuration <= newDuration) {\n newDuration -= hiddenAreaDuration\n this._durationExcludesAfterLiveSyncPoint = true\n } else { this._durationExcludesAfterLiveSyncPoint = false }\n\n }\n if (newDuration !== this._playableRegionDuration) {\n durationChanged = true\n this._playableRegionDuration = newDuration\n }\n // Note the end time is not the playableRegionDuration\n // The end time will always increase even if content is removed from the beginning\n let endTime = fragments[0].start + newDuration\n let previousEndTime = previousPlayableRegionStartTime + previousPlayableRegionDuration\n let endTimeChanged = endTime !== previousEndTime\n if (endTimeChanged) {\n if (!this._localEndTimeCorrelation) {\n // set the correlation to map to the end\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: endTime * 1000\n }\n } else {\n // check if the correlation still works\n let corr = this._localEndTimeCorrelation\n let timePassed = this._now - corr.local\n // this should point to a time within the extrapolation window from the end\n let extrapolatedEndTime = (corr.remote + timePassed) / 1000\n if (extrapolatedEndTime > endTime) {\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: endTime * 1000\n }\n } else if (extrapolatedEndTime < endTime - this._extrapolatedWindowDuration) {\n // our extrapolated end time is now earlier than the extrapolation window from the actual end time\n // (maybe a chunk became available early)\n // reset correlation so that it sits at the beginning of the extrapolation window from the end time\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: (endTime - this._extrapolatedWindowDuration) * 1000\n }\n } else if (extrapolatedEndTime > previousEndTime) {\n // end time was past the old end time (so would have been capped)\n // set the correlation so that it resumes from the time it was at at the end of the old window\n this._localEndTimeCorrelation = {\n local: this._now,\n remote: previousEndTime * 1000\n }\n }\n }\n }\n\n // now that the values have been updated call any methods that use on them so they get the updated values\n // immediately\n durationChanged && this._onDurationChange()\n startTimeChanged && this._onProgress()\n }\n\n _onFragmentChanged(evt, data) {\n this._currentFragment = data.frag\n this.trigger(Events.Custom.PLAYBACK_FRAGMENT_CHANGED, data)\n }\n\n _onFragmentLoaded(evt, data) {\n this.trigger(Events.PLAYBACK_FRAGMENT_LOADED, data)\n }\n\n _onFragmentBuffered(evt, data) {\n this.trigger(Events.PLAYBACK_FRAGMENT_BUFFERED, data)\n }\n\n _onSubtitleLoaded() {\n // This event may be triggered multiple times\n // Setup CC only once (disable CC by default)\n if (!this._ccIsSetup) {\n this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)\n const trackId = this._playbackType === Playback.LIVE ? -1 : this.closedCaptionsTrackId\n this.closedCaptionsTrackId = trackId\n this._ccIsSetup = true\n }\n }\n\n _onLevelSwitch(evt, data) {\n if (!this.levels.length) this._fillLevels()\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH_END)\n this.trigger(Events.PLAYBACK_LEVEL_SWITCH, data)\n let currentLevel = this._hls.levels[data.level]\n if (currentLevel) {\n // TODO should highDefinition be private and maybe have a read only accessor if it's used somewhere\n this.highDefinition = (currentLevel.height >= 720 || (currentLevel.bitrate / 1000) >= 2000)\n this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition)\n this.trigger(Events.PLAYBACK_BITRATE, {\n height: currentLevel.height,\n width: currentLevel.width,\n bandwidth: currentLevel.bitrate,\n bitrate: currentLevel.bitrate,\n level: data.level\n })\n }\n }\n\n get dvrEnabled() {\n // enabled when:\n // - the duration does not include content after hlsjs's live sync point\n // - the playable region duration is longer than the configured duration to enable dvr after\n // - the playback type is LIVE.\n return (this._durationExcludesAfterLiveSyncPoint && this._duration >= this._minDvrSize && this.getPlaybackType() === Playback.LIVE)\n }\n\n getPlaybackType() {\n return this._playbackType\n }\n\n isSeekEnabled() {\n return (this._playbackType === Playback.VOD || this.dvrEnabled)\n }\n}\n\nHlsjsPlayback.canPlay = function(resource, mimeType) {\n const resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || []\n const isHls = ((resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8') || listContainsIgnoreCase(mimeType, ['application/vnd.apple.mpegurl', 'application/x-mpegURL']))\n return !!(HLSJS.isSupported() && isHls)\n}\n"],"names":["now","Utils","listContainsIgnoreCase","Events","register","HlsjsPlayback","_HTML5Video","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","this","concat","options","hlsPlayback","_objectSpread","defaultOptions","_timeUpdateThrottleDelay","_timeUpdateFiringRate","_durationChangeMinOffset","_setInitialState","_inherits","key","get","HLSJS","min","_levels","_currentLevel","undefined","set","id","trigger","PLAYBACK_LEVEL_SWITCH_START","playback","hlsUseNextLevel","_hls","nextLevel","currentLevel","_isReadyState","latency","playingDate","_playbackType","Playback","LIVE","_playlistType","_extrapolatedStartTime","_playableRegionStartTime","_localStartTimeCorrelation","corr","timePassed","_now","local","extrapolatedWindowStartTime","remote","Math","_extrapolatedWindowDuration","actualEndTime","_playableRegionDuration","_localEndTimeCorrelation","correlation","extrapolatedEndTime","max","_extrapolatedEndTime","_startTime","_segmentTargetDuration","_extrapolatedWindowNumSegments","bandwidthEstimate","preload","customListeners","src","_currentFragment","programDateTime","el","currentTime","start","value","_minDvrSize","hlsMinimumDvrSize","extrapolatedWindowNumSegments","VOD","_lastTimeUpdate","current","total","firstFragDateTime","_lastTimeUpdateFiredTime","_lastDuration","_programDateTime","_durationExcludesAfterLiveSyncPoint","_recoverAttemptsRemaining","hlsRecoverAttempts","_destroyHLSInstance","_createHLSInstance","_listenHLSEvents","_attachHLSMedia","_manifestLoading","_ccIsSetup","_ccTracksUpdated","destroy","config","hlsjsConfig","attachMedia","_this2","once","MEDIA_ATTACHED","loadSource","on","MANIFEST_LOADING","LEVEL_LOADED","evt","data","_updatePlaybackType","LEVEL_UPDATED","_onLevelUpdated","LEVEL_SWITCHED","_onLevelSwitch","FRAG_CHANGED","_onFragmentChanged","FRAG_LOADED","_onFragmentLoaded","FRAG_BUFFERED","_onFragmentBuffered","FRAG_PARSING_METADATA","_onFragmentParsingMetadata","ERROR","_onHLSJSError","SUBTITLE_TRACK_LOADED","_onSubtitleLoaded","SUBTITLE_TRACKS_UPDATED","bindCustomListeners","_this3","forEach","item","requestedEventName","eventName","typeOfListener","callback","_this4","off","Custom","PLAYBACK_FRAGMENT_PARSING_METADATA","_ready","_superPropGet","_setup","PLAYBACK_READY","name","error","_recoveredDecodingError","_recoveredAudioCodecError","Log","level","PlayerError","Levels","FATAL","formattedError","createError","PLAYBACK_ERROR","stop","swapAudioCodec","recoverMediaError","play","srcUrl","_this5","_timeUpdateTimer","setInterval","_onDurationChange","_onTimeUpdate","clearInterval","_duration","percentage","seekTo","seek","time","warn","getDuration","settings","left","dvrEnabled","seekEnabled","isSeekEnabled","PLAYBACK_SETTINGSUPDATE","code","type","details","description","raw","response","JSON","stringify","fatal","ErrorTypes","NETWORK_ERROR","ErrorDetails","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","WARN","startLoad","MEDIA_ERROR","_recover","triggerFatalErrorOnResourceDenied","_keyIsDenied","KEY_LOAD_ERROR","update","getCurrentTime","getProgramDateTime","_shouldThrottleTimeUpdate","PLAYBACK_TIMEUPDATE","isSameTime","abs","isSameDuration","isSameFirstFragDateTime","isSameEventPayload","isThrottled","duration","buffered","bufferedPos","i","_toConsumableArray","end","progress","PLAYBACK_PROGRESS","url","_stopTimeUpdateTimer","_startTimeUpdateTimer","pause","live","hasClosedCaptionsTracks","levels","map","index","label","bitrate","PLAYBACK_LEVELS_AVAILABLE","targetduration","startTimeChanged","durationChanged","fragments","previousPlayableRegionStartTime","previousPlayableRegionDuration","rawProgramDateTime","startTime","newDuration","totalduration","hiddenAreaDuration","liveSyncDurationCount","DefaultConfig","endTime","previousEndTime","_onProgress","frag","PLAYBACK_FRAGMENT_CHANGED","PLAYBACK_FRAGMENT_LOADED","PLAYBACK_FRAGMENT_BUFFERED","PLAYBACK_SUBTITLE_AVAILABLE","trackId","closedCaptionsTrackId","_fillLevels","PLAYBACK_LEVEL_SWITCH_END","PLAYBACK_LEVEL_SWITCH","highDefinition","height","PLAYBACK_HIGHDEFINITIONUPDATE","PLAYBACK_BITRATE","width","bandwidth","getPlaybackType","HTML5Video","canPlay","resource","mimeType","resourceParts","split","match","isHls","toLowerCase","isSupported"],"mappings":"2tGAOA,IAAQA,EAAgCC,EAAKA,MAArCD,IAAKE,EAA2BD,EAAKA,MAAhCC,uBAIbC,EAAAA,OAAOC,SAAS,6BAChBD,EAAAA,OAAOC,SAAS,sCAEKC,IAAAA,WAAaC,GAgIhC,SAAAD,IAAqB,IAAAE,+FAAAC,MAAAH,GAAA,IAAA,IAAAI,EAAAC,UAAAC,OAANC,EAAIC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAJF,EAAIE,GAAAJ,UAAAI,GAMM,OALvBP,EAAAQ,EAAAC,KAAAX,EAAAY,GAAAA,OAASL,KACJM,QAAQC,YAAWC,EAAAA,EAAA,CAAA,EAAQb,EAAKc,gBAAmBd,EAAKW,QAAQC,aACrEZ,EAAKe,yBAA2B,IAChCf,EAAKgB,sBAAwB,GAC7BhB,EAAKiB,yBAA2B,GAChCjB,EAAKkB,mBAAkBlB,CACzB,CAAC,4RAAAmB,CAAArB,EAAAC,KAAAD,IAkjBA,CAAA,CAAAsB,IA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5Q,EAAc6Q,QAAU,SAASC,EAAUC,GACzC,IAAMC,EAAgBF,EAASG,MAAM,KAAK,GAAGC,MAAM,cAAgB,GAC7DC,EAAUH,EAAc1Q,OAAS,GAAwC,SAAnC0Q,EAAc,GAAGI,eAA6BvR,EAAuBkR,EAAU,CAAC,gCAAiC,0BAC7J,SAAUvP,EAAK,QAAC6P,gBAAiBF,EACnC"}
|
package/dist/hlsjs-playback.js
CHANGED
|
@@ -4,6 +4,83 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.HlsjsPlayback = factory(global.Clappr));
|
|
5
5
|
})(this, (function (core) { 'use strict';
|
|
6
6
|
|
|
7
|
+
function _arrayLikeToArray(r, a) {
|
|
8
|
+
(null == a || a > r.length) && (a = r.length);
|
|
9
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
function _arrayWithoutHoles(r) {
|
|
13
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
14
|
+
}
|
|
15
|
+
function _assertThisInitialized(e) {
|
|
16
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
function _callSuper(t, o, e) {
|
|
20
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
21
|
+
}
|
|
22
|
+
function _classCallCheck(a, n) {
|
|
23
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
24
|
+
}
|
|
25
|
+
function _defineProperties(e, r) {
|
|
26
|
+
for (var t = 0; t < r.length; t++) {
|
|
27
|
+
var o = r[t];
|
|
28
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$1(o.key), o);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function _createClass(e, r, t) {
|
|
32
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
33
|
+
writable: !1
|
|
34
|
+
}), e;
|
|
35
|
+
}
|
|
36
|
+
function _defineProperty$1(e, r, t) {
|
|
37
|
+
return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
38
|
+
value: t,
|
|
39
|
+
enumerable: !0,
|
|
40
|
+
configurable: !0,
|
|
41
|
+
writable: !0
|
|
42
|
+
}) : e[r] = t, e;
|
|
43
|
+
}
|
|
44
|
+
function _get() {
|
|
45
|
+
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
|
46
|
+
var p = _superPropBase(e, t);
|
|
47
|
+
if (p) {
|
|
48
|
+
var n = Object.getOwnPropertyDescriptor(p, t);
|
|
49
|
+
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
|
50
|
+
}
|
|
51
|
+
}, _get.apply(null, arguments);
|
|
52
|
+
}
|
|
53
|
+
function _getPrototypeOf(t) {
|
|
54
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
55
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
56
|
+
}, _getPrototypeOf(t);
|
|
57
|
+
}
|
|
58
|
+
function _inherits(t, e) {
|
|
59
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
60
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
61
|
+
constructor: {
|
|
62
|
+
value: t,
|
|
63
|
+
writable: !0,
|
|
64
|
+
configurable: !0
|
|
65
|
+
}
|
|
66
|
+
}), Object.defineProperty(t, "prototype", {
|
|
67
|
+
writable: !1
|
|
68
|
+
}), e && _setPrototypeOf(t, e);
|
|
69
|
+
}
|
|
70
|
+
function _isNativeReflectConstruct() {
|
|
71
|
+
try {
|
|
72
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
73
|
+
} catch (t) {}
|
|
74
|
+
return (_isNativeReflectConstruct = function () {
|
|
75
|
+
return !!t;
|
|
76
|
+
})();
|
|
77
|
+
}
|
|
78
|
+
function _iterableToArray(r) {
|
|
79
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
80
|
+
}
|
|
81
|
+
function _nonIterableSpread() {
|
|
82
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
83
|
+
}
|
|
7
84
|
function ownKeys$1(e, r) {
|
|
8
85
|
var t = Object.keys(e);
|
|
9
86
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -25,171 +102,49 @@
|
|
|
25
102
|
}
|
|
26
103
|
return e;
|
|
27
104
|
}
|
|
28
|
-
function
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
function _defineProperties(target, props) {
|
|
34
|
-
for (var i = 0; i < props.length; i++) {
|
|
35
|
-
var descriptor = props[i];
|
|
36
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
37
|
-
descriptor.configurable = true;
|
|
38
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
39
|
-
Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor);
|
|
40
|
-
}
|
|
105
|
+
function _possibleConstructorReturn(t, e) {
|
|
106
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
107
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
108
|
+
return _assertThisInitialized(t);
|
|
41
109
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
writable: false
|
|
47
|
-
});
|
|
48
|
-
return Constructor;
|
|
110
|
+
function _setPrototypeOf(t, e) {
|
|
111
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
112
|
+
return t.__proto__ = e, t;
|
|
113
|
+
}, _setPrototypeOf(t, e);
|
|
49
114
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Object.defineProperty(obj, key, {
|
|
54
|
-
value: value,
|
|
55
|
-
enumerable: true,
|
|
56
|
-
configurable: true,
|
|
57
|
-
writable: true
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
obj[key] = value;
|
|
61
|
-
}
|
|
62
|
-
return obj;
|
|
63
|
-
}
|
|
64
|
-
function _inherits(subClass, superClass) {
|
|
65
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
66
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
67
|
-
}
|
|
68
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
69
|
-
constructor: {
|
|
70
|
-
value: subClass,
|
|
71
|
-
writable: true,
|
|
72
|
-
configurable: true
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
Object.defineProperty(subClass, "prototype", {
|
|
76
|
-
writable: false
|
|
77
|
-
});
|
|
78
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
79
|
-
}
|
|
80
|
-
function _getPrototypeOf(o) {
|
|
81
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
82
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
83
|
-
};
|
|
84
|
-
return _getPrototypeOf(o);
|
|
85
|
-
}
|
|
86
|
-
function _setPrototypeOf(o, p) {
|
|
87
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
88
|
-
o.__proto__ = p;
|
|
89
|
-
return o;
|
|
90
|
-
};
|
|
91
|
-
return _setPrototypeOf(o, p);
|
|
92
|
-
}
|
|
93
|
-
function _isNativeReflectConstruct() {
|
|
94
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
95
|
-
if (Reflect.construct.sham) return false;
|
|
96
|
-
if (typeof Proxy === "function") return true;
|
|
97
|
-
try {
|
|
98
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
99
|
-
return true;
|
|
100
|
-
} catch (e) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function _assertThisInitialized(self) {
|
|
105
|
-
if (self === void 0) {
|
|
106
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
107
|
-
}
|
|
108
|
-
return self;
|
|
109
|
-
}
|
|
110
|
-
function _possibleConstructorReturn(self, call) {
|
|
111
|
-
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
112
|
-
return call;
|
|
113
|
-
} else if (call !== void 0) {
|
|
114
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
115
|
-
}
|
|
116
|
-
return _assertThisInitialized(self);
|
|
115
|
+
function _superPropBase(t, o) {
|
|
116
|
+
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
|
117
|
+
return t;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
-
var
|
|
120
|
-
return function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (hasNativeReflectConstruct) {
|
|
124
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
125
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
126
|
-
} else {
|
|
127
|
-
result = Super.apply(this, arguments);
|
|
128
|
-
}
|
|
129
|
-
return _possibleConstructorReturn(this, result);
|
|
130
|
-
};
|
|
119
|
+
function _superPropGet(t, o, e, r) {
|
|
120
|
+
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
|
|
121
|
+
return 2 & r && "function" == typeof p ? function (t) {
|
|
122
|
+
return p.apply(e, t);
|
|
123
|
+
} : p;
|
|
131
124
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
object = _getPrototypeOf(object);
|
|
135
|
-
if (object === null) break;
|
|
136
|
-
}
|
|
137
|
-
return object;
|
|
125
|
+
function _toConsumableArray(r) {
|
|
126
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
138
127
|
}
|
|
139
|
-
function
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
147
|
-
if (desc.get) {
|
|
148
|
-
return desc.get.call(arguments.length < 3 ? target : receiver);
|
|
149
|
-
}
|
|
150
|
-
return desc.value;
|
|
151
|
-
};
|
|
128
|
+
function _toPrimitive$1(t, r) {
|
|
129
|
+
if ("object" != typeof t || !t) return t;
|
|
130
|
+
var e = t[Symbol.toPrimitive];
|
|
131
|
+
if (void 0 !== e) {
|
|
132
|
+
var i = e.call(t, r || "default");
|
|
133
|
+
if ("object" != typeof i) return i;
|
|
134
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
152
135
|
}
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
function _toConsumableArray(arr) {
|
|
156
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
157
|
-
}
|
|
158
|
-
function _arrayWithoutHoles(arr) {
|
|
159
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
160
|
-
}
|
|
161
|
-
function _iterableToArray(iter) {
|
|
162
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
163
|
-
}
|
|
164
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
165
|
-
if (!o) return;
|
|
166
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
167
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
168
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
169
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
170
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
171
|
-
}
|
|
172
|
-
function _arrayLikeToArray(arr, len) {
|
|
173
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
174
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
175
|
-
return arr2;
|
|
136
|
+
return ("string" === r ? String : Number)(t);
|
|
176
137
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
138
|
+
function _toPropertyKey$1(t) {
|
|
139
|
+
var i = _toPrimitive$1(t, "string");
|
|
140
|
+
return "symbol" == typeof i ? i : i + "";
|
|
179
141
|
}
|
|
180
|
-
function
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (typeof res !== "object") return res;
|
|
186
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
142
|
+
function _unsupportedIterableToArray(r, a) {
|
|
143
|
+
if (r) {
|
|
144
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
145
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
146
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
187
147
|
}
|
|
188
|
-
return (hint === "string" ? String : Number)(input);
|
|
189
|
-
}
|
|
190
|
-
function _toPropertyKey$1(arg) {
|
|
191
|
-
var key = _toPrimitive$1(arg, "string");
|
|
192
|
-
return typeof key === "symbol" ? key : String(key);
|
|
193
148
|
}
|
|
194
149
|
|
|
195
150
|
function getDefaultExportFromCjs (x) {
|
|
@@ -28743,15 +28698,13 @@
|
|
|
28743
28698
|
core.Events.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
28744
28699
|
core.Events.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
28745
28700
|
var HlsjsPlayback = /*#__PURE__*/function (_HTML5Video) {
|
|
28746
|
-
_inherits(HlsjsPlayback, _HTML5Video);
|
|
28747
|
-
var _super = _createSuper(HlsjsPlayback);
|
|
28748
28701
|
function HlsjsPlayback() {
|
|
28749
28702
|
var _this;
|
|
28750
28703
|
_classCallCheck(this, HlsjsPlayback);
|
|
28751
28704
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28752
28705
|
args[_key] = arguments[_key];
|
|
28753
28706
|
}
|
|
28754
|
-
_this =
|
|
28707
|
+
_this = _callSuper(this, HlsjsPlayback, [].concat(args));
|
|
28755
28708
|
_this.options.hlsPlayback = _objectSpread2$1(_objectSpread2$1({}, _this.defaultOptions), _this.options.hlsPlayback);
|
|
28756
28709
|
_this._timeUpdateThrottleDelay = 200;
|
|
28757
28710
|
_this._timeUpdateFiringRate = 0.2;
|
|
@@ -28759,7 +28712,8 @@
|
|
|
28759
28712
|
_this._setInitialState();
|
|
28760
28713
|
return _this;
|
|
28761
28714
|
}
|
|
28762
|
-
|
|
28715
|
+
_inherits(HlsjsPlayback, _HTML5Video);
|
|
28716
|
+
return _createClass(HlsjsPlayback, [{
|
|
28763
28717
|
key: "name",
|
|
28764
28718
|
get: function get() {
|
|
28765
28719
|
return 'hls';
|
|
@@ -28768,7 +28722,7 @@
|
|
|
28768
28722
|
key: "supportedVersion",
|
|
28769
28723
|
get: function get() {
|
|
28770
28724
|
return {
|
|
28771
|
-
min: "0.11.
|
|
28725
|
+
min: "0.11.4"
|
|
28772
28726
|
};
|
|
28773
28727
|
}
|
|
28774
28728
|
}, {
|
|
@@ -29050,7 +29004,7 @@
|
|
|
29050
29004
|
key: "render",
|
|
29051
29005
|
value: function render() {
|
|
29052
29006
|
this._ready();
|
|
29053
|
-
return
|
|
29007
|
+
return _superPropGet(HlsjsPlayback, "render", this, 3)([]);
|
|
29054
29008
|
}
|
|
29055
29009
|
}, {
|
|
29056
29010
|
key: "_ready",
|
|
@@ -29294,7 +29248,7 @@
|
|
|
29294
29248
|
var isSameDuration = Math.abs(this._lastDuration - duration) < this._durationChangeMinOffset;
|
|
29295
29249
|
if (isSameDuration) return;
|
|
29296
29250
|
this._lastDuration = duration;
|
|
29297
|
-
|
|
29251
|
+
_superPropGet(HlsjsPlayback, "_onDurationChange", this, 3)([]);
|
|
29298
29252
|
}
|
|
29299
29253
|
}, {
|
|
29300
29254
|
key: "_onProgress",
|
|
@@ -29329,7 +29283,7 @@
|
|
|
29329
29283
|
value: function play() {
|
|
29330
29284
|
!this._hls && this._setup();
|
|
29331
29285
|
!this._manifestLoading && !this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src);
|
|
29332
|
-
|
|
29286
|
+
_superPropGet(HlsjsPlayback, "play", this, 3)([]);
|
|
29333
29287
|
this._startTimeUpdateTimer();
|
|
29334
29288
|
}
|
|
29335
29289
|
}, {
|
|
@@ -29342,7 +29296,7 @@
|
|
|
29342
29296
|
key: "stop",
|
|
29343
29297
|
value: function stop() {
|
|
29344
29298
|
this._stopTimeUpdateTimer();
|
|
29345
|
-
if (this._hls)
|
|
29299
|
+
if (this._hls) _superPropGet(HlsjsPlayback, "stop", this, 3)([]);
|
|
29346
29300
|
this._destroyHLSInstance();
|
|
29347
29301
|
}
|
|
29348
29302
|
}, {
|
|
@@ -29350,7 +29304,7 @@
|
|
|
29350
29304
|
value: function destroy() {
|
|
29351
29305
|
this._stopTimeUpdateTimer();
|
|
29352
29306
|
this._destroyHLSInstance();
|
|
29353
|
-
|
|
29307
|
+
_superPropGet(HlsjsPlayback, "destroy", this, 3)([]);
|
|
29354
29308
|
}
|
|
29355
29309
|
}, {
|
|
29356
29310
|
key: "_updatePlaybackType",
|
|
@@ -29562,7 +29516,6 @@
|
|
|
29562
29516
|
return Hls;
|
|
29563
29517
|
}
|
|
29564
29518
|
}]);
|
|
29565
|
-
return HlsjsPlayback;
|
|
29566
29519
|
}(core.HTML5Video);
|
|
29567
29520
|
HlsjsPlayback.canPlay = function (resource, mimeType) {
|
|
29568
29521
|
var resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || [];
|