shaka-player 4.9.10 → 4.9.12

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.
@@ -365,10 +365,10 @@ shaka.util.StreamUtils.supportedImageMimeTypes_=(new Map).set("image/svg+xml",!0
365
365
  shaka.util.StreamUtils.minImage_=(new Map).set("image/webp",shaka.util.StreamUtils.minWebPImage_).set("image/avif",shaka.util.StreamUtils.minAvifImage_);shaka.abr.SimpleAbrManager=function(){var a=this;this.switch_=null;this.enabled_=!1;this.bandwidthEstimator_=new shaka.abr.EwmaBandwidthEstimator;this.eventManager_=new shaka.util.EventManager;navigator.connection&&navigator.connection.addEventListener&&this.eventManager_.listen(navigator.connection,"change",function(){if(a.enabled_&&a.config_.useNetworkInformation){a.bandwidthEstimator_=new shaka.abr.EwmaBandwidthEstimator;a.config_&&a.bandwidthEstimator_.configure(a.config_.advanced);var b=a.chooseVariant();
366
366
  b&&navigator.onLine&&a.switch_(b,a.config_.clearBufferSwitch,a.config_.safeMarginSwitch)}});this.variants_=[];this.playbackRate_=1;this.startupComplete_=!1;this.resizeObserver_=this.mediaElement_=this.config_=this.lastTimeChosenMs_=null;this.resizeObserverTimer_=new shaka.util.Timer(function(){if(a.config_.restrictToElementSize){var b=a.chooseVariant();b&&a.switch_(b,a.config_.clearBufferSwitch,a.config_.safeMarginSwitch)}});this.cmsdManager_=null};
367
367
  shaka.abr.SimpleAbrManager.prototype.stop=function(){this.switch_=null;this.enabled_=!1;this.variants_=[];this.playbackRate_=1;this.mediaElement_=this.lastTimeChosenMs_=null;this.resizeObserver_&&(this.resizeObserver_.disconnect(),this.resizeObserver_=null);this.resizeObserverTimer_.stop();this.cmsdManager_=null};shaka.abr.SimpleAbrManager.prototype.release=function(){this.eventManager_.release();this.resizeObserverTimer_=null};shaka.abr.SimpleAbrManager.prototype.init=function(a){this.switch_=a};
368
- shaka.abr.SimpleAbrManager.prototype.chooseVariant=function(a){a=void 0===a?!1:a;var b=Infinity,c=Infinity;this.config_.restrictToScreenSize&&(c=this.config_.ignoreDevicePixelRatio?1:window.devicePixelRatio,b=window.screen.height*c,c*=window.screen.width);if(this.resizeObserver_&&this.config_.restrictToElementSize){var d=this.config_.ignoreDevicePixelRatio?1:window.devicePixelRatio;b=Math.min(b,this.mediaElement_.clientHeight*d);c=Math.min(c,this.mediaElement_.clientWidth*d)}var e=this.variants_.filter(function(m){return!shaka.util.StreamUtils.isFastSwitching(m)});
369
- e.length||(e=this.variants_);d=e;a&&e.length!=this.variants_.length&&(d=this.variants_.filter(function(m){return shaka.util.StreamUtils.isFastSwitching(m)}));a=this.filterAndSortVariants_(this.config_.restrictions,d,Infinity,Infinity);if(Infinity!=b||Infinity!=c){a=this.getResolutionList_(a);a=$jscomp.makeIterator(a);for(e=a.next();!e.done;e=a.next())if(e=e.value,e.height>=b&&e.width>=c){b=e.height;c=e.width;break}a=this.filterAndSortVariants_(this.config_.restrictions,d,b,c)}b=this.getBandwidthEstimate();
370
- d.length&&!a.length&&(shaka.log.warning("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),a=this.filterAndSortVariants_(null,d,Infinity,Infinity),a=[a[0]]);c=a[0]||null;for(d=0;d<a.length;d++){e=a[d];for(var f=isNaN(this.playbackRate_)?1:Math.abs(this.playbackRate_),g=f*e.bandwidth,h=g/this.config_.bandwidthDowngradeTarget,k={bandwidth:Infinity},l=d+1;l<a.length;l++)if(e.bandwidth!=a[l].bandwidth){k=a[l];break}f=f*k.bandwidth/this.config_.bandwidthUpgradeTarget;shaka.log.v2("Bandwidth ranges:",
371
- (g/1E6).toFixed(3),(h/1E6).toFixed(3),(f/1E6).toFixed(3));b>=h&&b<=f&&(c.bandwidth!=e.bandwidth||this.isSameBandwidthAndHigherResolution_(c,e))&&(c=e)}this.lastTimeChosenMs_=Date.now();return c};shaka.abr.SimpleAbrManager.prototype.enable=function(){this.enabled_=!0};shaka.abr.SimpleAbrManager.prototype.disable=function(){this.enabled_=!1};
368
+ shaka.abr.SimpleAbrManager.prototype.chooseVariant=function(a){a=void 0===a?!1:a;var b=Infinity,c=Infinity;this.config_.restrictToScreenSize&&(c=this.config_.ignoreDevicePixelRatio?1:window.devicePixelRatio,b=window.screen.height*c,c*=window.screen.width);if(this.resizeObserver_&&this.config_.restrictToElementSize){var d=this.config_.ignoreDevicePixelRatio?1:window.devicePixelRatio;b=Math.min(b,this.mediaElement_.clientHeight*d);c=Math.min(c,this.mediaElement_.clientWidth*d)}var e=this.variants_.filter(function(m){return m&&
369
+ !shaka.util.StreamUtils.isFastSwitching(m)});e.length||(e=this.variants_);d=e;a&&e.length!=this.variants_.length&&(d=this.variants_.filter(function(m){return m&&shaka.util.StreamUtils.isFastSwitching(m)}));a=this.filterAndSortVariants_(this.config_.restrictions,d,Infinity,Infinity);if(Infinity!=b||Infinity!=c){a=this.getResolutionList_(a);a=$jscomp.makeIterator(a);for(e=a.next();!e.done;e=a.next())if(e=e.value,e.height>=b&&e.width>=c){b=e.height;c=e.width;break}a=this.filterAndSortVariants_(this.config_.restrictions,
370
+ d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(shaka.log.warning("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),a=this.filterAndSortVariants_(null,d,Infinity,Infinity),a=[a[0]]);c=a[0]||null;for(d=0;d<a.length;d++){e=a[d];for(var f=isNaN(this.playbackRate_)?1:Math.abs(this.playbackRate_),g=f*e.bandwidth,h=g/this.config_.bandwidthDowngradeTarget,k={bandwidth:Infinity},l=d+1;l<a.length;l++)if(e.bandwidth!=a[l].bandwidth){k=a[l];break}f=f*k.bandwidth/this.config_.bandwidthUpgradeTarget;
371
+ shaka.log.v2("Bandwidth ranges:",(g/1E6).toFixed(3),(h/1E6).toFixed(3),(f/1E6).toFixed(3));b>=h&&b<=f&&(c.bandwidth!=e.bandwidth||this.isSameBandwidthAndHigherResolution_(c,e))&&(c=e)}this.lastTimeChosenMs_=Date.now();return c};shaka.abr.SimpleAbrManager.prototype.enable=function(){this.enabled_=!0};shaka.abr.SimpleAbrManager.prototype.disable=function(){this.enabled_=!1};
372
372
  shaka.abr.SimpleAbrManager.prototype.segmentDownloaded=function(a,b,c,d){a<this.config_.cacheLoadThreshold||(shaka.log.v2("Segment downloaded:","contentType="+(d&&d.contentType),"deltaTimeMs="+a,"numBytes="+b,"lastTimeChosenMs="+this.lastTimeChosenMs_,"enabled="+this.enabled_),goog.asserts.assert(0<=a,"expected a non-negative duration"),this.bandwidthEstimator_.sample(a,b),c&&null!=this.lastTimeChosenMs_&&this.enabled_&&this.suggestStreams_())};
373
373
  shaka.abr.SimpleAbrManager.prototype.trySuggestStreams=function(){null!=this.lastTimeChosenMs_&&this.enabled_&&this.suggestStreams_()};shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate=function(){var a=this.getDefaultBandwidth_();a=this.bandwidthEstimator_.getBandwidthEstimate(a);return this.cmsdManager_?this.cmsdManager_.getBandwidthEstimate(a):a};shaka.abr.SimpleAbrManager.prototype.setVariants=function(a){this.variants_=a};
374
374
  shaka.abr.SimpleAbrManager.prototype.playbackRateChanged=function(a){this.playbackRate_=a};shaka.abr.SimpleAbrManager.prototype.setMediaElement=function(a){var b=this;this.mediaElement_=a;this.resizeObserver_&&(this.resizeObserver_.disconnect(),this.resizeObserver_=null);this.mediaElement_&&"ResizeObserver"in window&&(this.resizeObserver_=new ResizeObserver(function(){b.resizeObserverTimer_.tickAfter(shaka.abr.SimpleAbrManager.RESIZE_OBSERVER_BATCH_TIME)}),this.resizeObserver_.observe(this.mediaElement_))};
@@ -949,8 +949,8 @@ shaka.media.StreamingEngine.prototype.switchTextStream=function(a){var b=this,c;
949
949
  shaka.media.StreamingEngine.prototype.reloadTextStream=function(){var a=this.mediaStates_.get(shaka.util.ManifestParserUtils.ContentType.TEXT);a&&this.switchInternal_(a.stream,!0,0,!0)};
950
950
  shaka.media.StreamingEngine.prototype.switchInternal_=function(a,b,c,d,e){var f=this,g=shaka.util.ManifestParserUtils.ContentType,h=this.mediaStates_.get(a.type);h||a.type!=g.TEXT?(goog.asserts.assert(h,"switch: expected mediaState to exist"),h&&(h.restoreStreamAfterTrickPlay&&(shaka.log.debug("switch during trick play mode",a),a.trickModeVideo?(h.restoreStreamAfterTrickPlay=a,a=a.trickModeVideo,shaka.log.debug("switch found trick play stream",a)):(h.restoreStreamAfterTrickPlay=null,shaka.log.debug("switch found no special trick play stream"))),
951
951
  h.stream!=a||d?(this.audioPrefetchMap_.has(a)?h.segmentPrefetch=this.audioPrefetchMap_.get(a):h.segmentPrefetch&&h.segmentPrefetch.switchStream(a),a.type==g.TEXT&&(d=shaka.util.MimeUtils.getFullType(a.mimeType,a.codecs),this.playerInterface_.mediaSourceEngine.reinitText(d,this.manifest_.sequenceMode,a.external)),this.audioPrefetchMap_.has(h.stream)||h.stream.closeSegmentIndex&&h.stream.closeSegmentIndex(),h.stream=a,h.segmentIterator=null,h.adaptation=!!e,a=shaka.media.StreamingEngine.logPrefix_(h),
952
- shaka.log.debug("switch: switching to Stream "+a),b&&(h.clearingBuffer?h.waitingToFlushBuffer=!0:h.performingUpdate?(h.waitingToClearBuffer=!0,h.clearBufferSafeMargin=c,h.waitingToFlushBuffer=!0):(this.cancelUpdate_(h),this.clearBuffer_(h,!0,c).catch(function(k){f.playerInterface_&&(goog.asserts.assert(k instanceof shaka.util.Error,"Wrong error type!"),f.playerInterface_.onError(k))}))),this.makeAbortDecision_(h).catch(function(k){f.playerInterface_&&(goog.asserts.assert(k instanceof shaka.util.Error,
953
- "Wrong error type!"),f.playerInterface_.onError(k))})):(b=shaka.media.StreamingEngine.logPrefix_(h),shaka.log.debug("switch: Stream "+b+" already active")))):this.loadNewTextStream_(a)};
952
+ shaka.log.debug("switch: switching to Stream "+a),b?h.clearingBuffer?h.waitingToFlushBuffer=!0:h.performingUpdate?(h.waitingToClearBuffer=!0,h.clearBufferSafeMargin=c,h.waitingToFlushBuffer=!0):(this.cancelUpdate_(h),this.clearBuffer_(h,!0,c).catch(function(k){f.playerInterface_&&(goog.asserts.assert(k instanceof shaka.util.Error,"Wrong error type!"),f.playerInterface_.onError(k))})):h.performingUpdate||h.updateTimer||this.scheduleUpdate_(h,0),this.makeAbortDecision_(h).catch(function(k){f.playerInterface_&&
953
+ (goog.asserts.assert(k instanceof shaka.util.Error,"Wrong error type!"),f.playerInterface_.onError(k))})):(b=shaka.media.StreamingEngine.logPrefix_(h),shaka.log.debug("switch: Stream "+b+" already active")))):this.loadNewTextStream_(a)};
954
954
  shaka.media.StreamingEngine.prototype.makeAbortDecision_=function(a){var b=this,c,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress){if(!a.operation)return e.return();c=a.stream;d=a.operation;return c.segmentIndex?e.jumpTo(2):e.yield(c.createSegmentIndex(),2)}if(a.operation!=d||a.stream!=c)return e.return();goog.asserts.assert(a.stream.segmentIndex,"Segment index should exist by now!");b.shouldAbortCurrentRequest_(a)&&(shaka.log.info("Aborting current segment request."),
955
955
  a.operation.abort());e.jumpToEnd()})};
956
956
  shaka.media.StreamingEngine.prototype.shouldAbortCurrentRequest_=function(a){goog.asserts.assert(a.operation,"Abort logic requires an ongoing operation!");goog.asserts.assert(a.stream&&a.stream.segmentIndex,"Abort logic requires a segment index");var b=this.playerInterface_.getPresentationTime(),c=this.playerInterface_.mediaSourceEngine.bufferEnd(a.type),d=this.getTimeNeeded_(a,b);d=a.stream.segmentIndex.find(d);var e=null==d?null:a.stream.segmentIndex.get(d);d=e?e.getSize():null;e&&!d&&(d=(e.getEndTime()-
@@ -1019,9 +1019,9 @@ shaka.log.v1(d,"evicted "+h+" seconds");k.jumpToEnd()})};shaka.media.StreamingEn
1019
1019
  shaka.media.StreamingEngine.prototype.fetch_=function(a,b,c){var d=this,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){switch(l.nextAddress){case 1:if(e=b.getSegmentData())return l.return(e);f=null;a.segmentPrefetch&&(f=a.segmentPrefetch.getPrefetchedSegment(b,c));f||(f=d.dispatchFetch_(b,a.stream,c));g=0;a.segmentIterator&&(g=a.segmentIterator.currentPosition());a.operation=f;return l.yield(f.promise,2);case 2:h=l.yieldResult;a.operation=null;k=h.data;if(!b.aesKey){l.jumpTo(3);
1020
1020
  break}return l.yield(d.aesDecrypt_(k,b.aesKey,g),4);case 4:k=l.yieldResult;case 3:return l.return(k)}})};shaka.media.StreamingEngine.prototype.dispatchFetch_=function(a,b,c){goog.asserts.assert(this.playerInterface_.netEngine,"Must have net engine");return shaka.media.StreamingEngine.dispatchFetch(a,b,c||null,this.config_.retryParameters,this.playerInterface_.netEngine)};
1021
1021
  shaka.media.StreamingEngine.dispatchFetch=function(a,b,c,d,e){var f=shaka.net.NetworkingEngine.RequestType.SEGMENT,g=a instanceof shaka.media.SegmentReference?a:void 0,h=g?shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT:shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT;c=shaka.util.Networking.createSegmentRequest(a.getUris(),a.startByte,a.endByte,d,c);c.contentType=b.type;shaka.log.v2("fetching: reference=",a);return e.request(f,c,{type:h,stream:b,segment:g})};
1022
- shaka.media.StreamingEngine.prototype.clearBuffer_=function(a,b,c){var d=this,e,f,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){if(1==h.nextAddress)return e=shaka.media.StreamingEngine.logPrefix_(a),goog.asserts.assert(!a.performingUpdate&&null==a.updateTimer,e+" unexpected call to clearBuffer_()"),a.waitingToClearBuffer=!1,a.waitingToFlushBuffer=!1,a.clearBufferSafeMargin=0,a.clearingBuffer=!0,a.lastSegmentReference=null,a.lastInitSegmentReference=null,a.segmentIterator=null,shaka.log.debug(e,
1023
- "clearing buffer"),a.segmentPrefetch&&!d.audioPrefetchMap_.has(a.stream)&&a.segmentPrefetch.clearAll(),c?(f=d.playerInterface_.getPresentationTime(),g=d.playerInterface_.mediaSourceEngine.getDuration(),h.yield(d.playerInterface_.mediaSourceEngine.remove(a.type,f+c,g),3)):h.yield(d.playerInterface_.mediaSourceEngine.clear(a.type),4);if(3!=h.nextAddress)return d.destroyer_.ensureNotDestroyed(),b?h.yield(d.playerInterface_.mediaSourceEngine.flush(a.type),3):h.jumpTo(3);d.destroyer_.ensureNotDestroyed();
1024
- shaka.log.debug(e,"cleared buffer");a.clearingBuffer=!1;a.endOfStream=!1;a.performingUpdate||a.updateTimer||d.scheduleUpdate_(a,0);h.jumpToEnd()})};
1022
+ shaka.media.StreamingEngine.prototype.clearBuffer_=function(a,b,c){var d=this,e,f,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){if(1==h.nextAddress)return e=shaka.media.StreamingEngine.logPrefix_(a),goog.asserts.assert(!a.performingUpdate&&null==a.updateTimer,e+" unexpected call to clearBuffer_()"),a.waitingToClearBuffer=!1,a.waitingToFlushBuffer=!1,a.clearBufferSafeMargin=0,a.clearingBuffer=!0,a.lastSegmentReference=null,a.segmentIterator=null,shaka.log.debug(e,"clearing buffer"),
1023
+ a.segmentPrefetch&&!d.audioPrefetchMap_.has(a.stream)&&a.segmentPrefetch.clearAll(),c?(f=d.playerInterface_.getPresentationTime(),g=d.playerInterface_.mediaSourceEngine.getDuration(),h.yield(d.playerInterface_.mediaSourceEngine.remove(a.type,f+c,g),3)):h.yield(d.playerInterface_.mediaSourceEngine.clear(a.type),4);if(3!=h.nextAddress)return d.destroyer_.ensureNotDestroyed(),b?h.yield(d.playerInterface_.mediaSourceEngine.flush(a.type),3):h.jumpTo(3);d.destroyer_.ensureNotDestroyed();shaka.log.debug(e,
1024
+ "cleared buffer");a.clearingBuffer=!1;a.endOfStream=!1;a.performingUpdate||a.updateTimer||d.scheduleUpdate_(a,0);h.jumpToEnd()})};
1025
1025
  shaka.media.StreamingEngine.prototype.scheduleUpdate_=function(a,b){var c=this,d=shaka.media.StreamingEngine.logPrefix_(a),e=a.type;e!=shaka.util.ManifestParserUtils.ContentType.TEXT||this.mediaStates_.has(e)?(shaka.log.v2(d,"updating in "+b+" seconds"),goog.asserts.assert(null==a.updateTimer,d+" did not expect update to be scheduled"),a.updateTimer=(new shaka.util.DelayedTick(function(){var f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){if(1==g.nextAddress)return g.setCatchFinallyBlocks(2),
1026
1026
  g.yield(c.onUpdate_(a),4);if(2!=g.nextAddress)return g.leaveTryBlock(0);f=g.enterCatchBlock();if(c.playerInterface_)c.playerInterface_.onError(f);g.jumpToEnd()})})).tickAfter(b)):shaka.log.v1(d,"Text stream is unloaded. No update is needed.")};shaka.media.StreamingEngine.prototype.cancelUpdate_=function(a){null!=a.updateTimer&&(a.updateTimer.stop(),a.updateTimer=null)};
1027
1027
  shaka.media.StreamingEngine.prototype.abortOperations_=function(a){return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){return a.operation?b.yield(a.operation.abort(),0):b.jumpTo(0)})};
@@ -1287,8 +1287,8 @@ this.bufferObserver_.update(b,a)&&this.updateBufferState_()};shaka.Player.protot
1287
1287
  shaka.Player.prototype.createCmcd_=function(){var a=this;return new shaka.util.CmcdManager({getBandwidthEstimate:function(){return a.abrManager_?a.abrManager_.getBandwidthEstimate():NaN},getBufferedInfo:function(){return a.getBufferedInfo()},getCurrentTime:function(){return a.video_?a.video_.currentTime:0},getPlaybackRate:function(){return a.getPlaybackRate()},getNetworkingEngine:function(){return a.getNetworkingEngine()},getVariantTracks:function(){return a.getVariantTracks()},isLive:function(){return a.isLive()}},
1288
1288
  this.config_.cmcd)};shaka.Player.prototype.createCmsd_=function(){return new shaka.util.CmsdManager(this.config_.cmsd)};
1289
1289
  shaka.Player.prototype.createStreamingEngine=function(){var a=this;goog.asserts.assert(this.abrManager_&&this.mediaSourceEngine_&&this.manifest_,"Must not be destroyed");return new shaka.media.StreamingEngine(this.manifest_,{getPresentationTime:function(){return a.playhead_?a.playhead_.getTime():0},getBandwidthEstimate:function(){return a.abrManager_.getBandwidthEstimate()},getPlaybackRate:function(){return a.getPlaybackRate()},mediaSourceEngine:this.mediaSourceEngine_,netEngine:this.networkingEngine_,
1290
- onError:function(b){return a.onError_(b)},onEvent:function(b){return a.dispatchEvent(b)},onManifestUpdate:function(){return a.onManifestUpdate_()},onSegmentAppended:function(b,c){a.onSegmentAppended_(b.startTime,b.endTime,c.type);a.abrManager_&&c.fastSwitching&&b.isPartial()&&b.isLastPartial()&&a.abrManager_.trySuggestStreams()},onInitSegmentAppended:function(b,c){(c=c.getMediaQuality())&&a.qualityObserver_&&a.qualityObserver_.addMediaQualityChange(c,b)},beforeAppendSegment:function(b,c){return a.drmEngine_.parseInbandPssh(b,
1291
- c)},onMetadata:function(b,c,d){a.processTimedMetadataMediaSrc_(b,c,d)},disableStream:function(b,c){return a.disableStream(b,c)}})};
1290
+ onError:function(b){return a.onError_(b)},onEvent:function(b){return a.dispatchEvent(b)},onManifestUpdate:function(){return a.onManifestUpdate_()},onSegmentAppended:function(b,c){a.onSegmentAppended_(b.startTime,b.endTime,c.type,c.codecs.includes(","));a.abrManager_&&c.fastSwitching&&b.isPartial()&&b.isLastPartial()&&a.abrManager_.trySuggestStreams()},onInitSegmentAppended:function(b,c){(c=c.getMediaQuality())&&a.qualityObserver_&&a.qualityObserver_.addMediaQualityChange(c,b)},beforeAppendSegment:function(b,
1291
+ c){return a.drmEngine_.parseInbandPssh(b,c)},onMetadata:function(b,c,d){a.processTimedMetadataMediaSrc_(b,c,d)},disableStream:function(b,c){return a.disableStream(b,c)}})};
1292
1292
  shaka.Player.prototype.configure=function(a,b){goog.asserts.assert(this.config_,"Config must not be null!");goog.asserts.assert("object"==typeof a||2==arguments.length,"String configs should have values!");2==arguments.length&&"string"==typeof a&&(a=shaka.util.ConfigUtils.convertToConfigObject(a,b));goog.asserts.assert("object"==typeof a,"Should be an object!");a.streaming&&"forceTransmuxTS"in a.streaming&&(shaka.Deprecate.deprecateFeature(5,"streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),
1293
1293
  a.mediaSource.mediaSource=a.streaming.forceTransmuxTS,delete a.streaming.forceTransmuxTS);a.streaming&&"forceTransmux"in a.streaming&&(shaka.Deprecate.deprecateFeature(5,"streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource.mediaSource=a.streaming.forceTransmux,delete a.streaming.forceTransmux);a.streaming&&"useNativeHlsOnSafari"in a.streaming&&shaka.Deprecate.deprecateFeature(5,"streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");
1294
1294
  if(a.mediaSource&&"sourceBufferExtraFeatures"in a.mediaSource){shaka.Deprecate.deprecateFeature(5,"mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");var c=a.mediaSource.sourceBufferExtraFeatures;a.mediaSource.addExtraFeaturesToSourceBuffer=function(){return c};delete a.mediaSource.sourceBufferExtraFeatures}a.streaming&&a.streaming.lowLatencyMode&&(void 0==a.streaming.inaccurateManifestTolerance&&(a.streaming.inaccurateManifestTolerance=
@@ -1397,21 +1397,21 @@ shaka.Player.prototype.onSeek_=function(){this.playheadObservers_&&this.playhead
1397
1397
  shaka.Player.prototype.updateAbrManagerVariants_=function(){try{goog.asserts.assert(this.manifest_,"Manifest should exist by now!"),this.manifestFilterer_.checkRestrictedVariants(this.manifest_)}catch(b){return this.onError_(b),!1}var a=shaka.util.StreamUtils.getPlayableVariants(this.manifest_.variants);a=this.currentAdaptationSetCriteria_.create(a);this.abrManager_.setVariants(Array.from(a.values()));return!0};
1398
1398
  shaka.Player.prototype.chooseVariant_=function(a){a=void 0===a?!1:a;return this.updateAbrManagerVariants_()?this.abrManager_.chooseVariant(a):null};
1399
1399
  shaka.Player.prototype.checkVariants_=function(){goog.asserts.assert(this.manifest_,"Should have manifest!");for(var a=Date.now()/1E3,b=!1,c=function(f){var g="";f.video&&(g+="video:"+f.video.id);f.audio&&(g=g+(g?"&":"")+("audio:"+f.audio.id));return g},d=$jscomp.makeIterator(this.manifest_.variants),e=d.next();!e.done;e=d.next())e=e.value,0<e.disabledUntilTime&&e.disabledUntilTime<=a&&(e.disabledUntilTime=0,b=!0,shaka.log.v2("Re-enabled variant with "+c(e)));this.manifest_.variants.every(function(f){goog.asserts.assert(0<=
1400
- f.disabledUntilTime,"|variant.disableTimeUntilTime| must always be >= 0");return 0===f.disabledUntilTime})&&this.checkVariantsTimer_.stop();b&&this.chooseVariantAndSwitch_(!0,void 0,!1,!1)};shaka.Player.prototype.chooseTextStream_=function(){return shaka.util.StreamUtils.filterStreamsByLanguageAndRole(this.manifest_.textStreams,this.currentTextLanguage_,this.currentTextRole_,this.currentTextForced_)[0]||null};
1400
+ f.disabledUntilTime,"|variant.disableTimeUntilTime| must always be >= 0");return 0===f.disabledUntilTime})&&this.checkVariantsTimer_.stop();b&&this.chooseVariantAndSwitch_(!1,void 0,!1,!1)};shaka.Player.prototype.chooseTextStream_=function(){return shaka.util.StreamUtils.filterStreamsByLanguageAndRole(this.manifest_.textStreams,this.currentTextLanguage_,this.currentTextRole_,this.currentTextForced_)[0]||null};
1401
1401
  shaka.Player.prototype.chooseVariantAndSwitch_=function(a,b,c,d){a=void 0===a?!0:a;b=void 0===b?0:b;c=void 0===c?!1:c;d=void 0===d?!0:d;goog.asserts.assert(this.config_,"Must not be destroyed");var e=this.chooseVariant_();e&&this.switchVariant_(e,d,a,b,c)};
1402
1402
  shaka.Player.prototype.switchVariant_=function(a,b,c,d,e){e=void 0===e?!1:e;var f=this.streamingEngine_.getCurrentVariant();if(a==f)shaka.log.debug("Variant already selected."),c&&this.streamingEngine_.switchVariant(a,c,d,!0);else if(this.addVariantToSwitchHistory_(a,b),this.streamingEngine_.switchVariant(a,c,d,e,b),c=null,f&&(c=shaka.util.StreamUtils.variantToTrack(f)),a=shaka.util.StreamUtils.variantToTrack(a),b)this.onAdaptation_(c,a);else this.onVariantChanged_(c,a)};
1403
1403
  shaka.Player.prototype.switchHtml5Track_=function(a){goog.asserts.assert(this.video_&&this.video_.audioTracks,"Video and video.audioTracks should not be null!");var b=Array.from(this.video_.audioTracks).find(function(c){return c.enabled});a.enabled=!0;b&&(a.id!==b.id&&(b.enabled=!1),b=shaka.util.StreamUtils.html5AudioTrackToTrack(b),a=shaka.util.StreamUtils.html5AudioTrackToTrack(a),this.onVariantChanged_(b,a))};
1404
1404
  shaka.Player.prototype.setInitialTextState_=function(a,b){b?(a.audio&&this.shouldInitiallyShowText_(a.audio,b)&&(this.isTextVisible_=!0),this.isTextVisible_&&(this.mediaSourceEngine_.getTextDisplayer().setTextVisibility(!0),goog.asserts.assert(this.shouldStreamText_(),"Should be streaming text")),this.onTextTrackVisibility_()):this.isTextVisible_=!1};
1405
1405
  shaka.Player.prototype.shouldInitiallyShowText_=function(a,b){var c=shaka.config.AutoShowText;if(this.config_.autoShowText==c.NEVER)return!1;if(this.config_.autoShowText==c.ALWAYS)return!0;var d=shaka.util.LanguageUtils,e=d.normalize(this.config_.preferredTextLanguage);b=d.normalize(b.language);if(this.config_.autoShowText==c.IF_PREFERRED_TEXT_LANGUAGE)return d.areLanguageCompatible(b,e);if(this.config_.autoShowText==c.IF_SUBTITLES_MAY_BE_NEEDED)return a=d.normalize(a.language),d.areLanguageCompatible(b,
1406
1406
  e)&&!d.areLanguageCompatible(a,b);shaka.log.alwaysWarn("Invalid autoShowText setting!");return!1};shaka.Player.prototype.onManifestUpdate_=function(){this.parser_&&this.parser_.update&&this.parser_.update()};
1407
- shaka.Player.prototype.onSegmentAppended_=function(a,b,c){if(this.playhead_){this.playhead_.notifyOfBufferingChange();var d=this.mediaSourceEngine_.bufferStart(c);!this.isLive()&&this.video_.paused&&null!=d&&0<d&&this.playhead_.getTime()<d&&this.playhead_.setStartTime(d)}this.pollBufferState_();a=(new Map).set("start",a).set("end",b).set("contentType",c);this.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.SegmentAppended,a))};
1407
+ shaka.Player.prototype.onSegmentAppended_=function(a,b,c,d){if(this.playhead_){this.playhead_.notifyOfBufferingChange();var e=this.mediaSourceEngine_.bufferStart(c);!this.isLive()&&this.video_.paused&&null!=e&&0<e&&this.playhead_.getTime()<e&&this.playhead_.setStartTime(e)}this.pollBufferState_();a=(new Map).set("start",a).set("end",b).set("contentType",c).set("isMuxed",d);this.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.SegmentAppended,a))};
1408
1408
  shaka.Player.prototype.switch_=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;shaka.log.debug("switch_");goog.asserts.assert(this.config_.abr.enabled,"AbrManager should not call switch while disabled!");this.manifest_&&this.streamingEngine_&&a!=this.streamingEngine_.getCurrentVariant()&&this.switchVariant_(a,!0,b,c)};
1409
1409
  shaka.Player.prototype.onAdaptation_=function(a,b){a=(new Map).set("oldTrack",a).set("newTrack",b);this.lcevcDec_&&this.lcevcDec_.updateVariant(b,this.getManifestType());b=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Adaptation,a);this.delayDispatchEvent_(b)};shaka.Player.prototype.onTracksChanged_=function(){var a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.TracksChanged);this.delayDispatchEvent_(a)};
1410
1410
  shaka.Player.prototype.onVariantChanged_=function(a,b){a=(new Map).set("oldTrack",a).set("newTrack",b);this.lcevcDec_&&this.lcevcDec_.updateVariant(b,this.getManifestType());b=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.VariantChanged,a);this.delayDispatchEvent_(b)};shaka.Player.prototype.onTextChanged_=function(){var a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.TextChanged);this.delayDispatchEvent_(a)};
1411
1411
  shaka.Player.prototype.onTextTrackVisibility_=function(){var a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.TextTrackVisibility);this.delayDispatchEvent_(a)};shaka.Player.prototype.onAbrStatusChanged_=function(){this.config_.abr.enabled||this.restoreDisabledVariants_();var a=(new Map).set("newStatus",this.config_.abr.enabled);this.delayDispatchEvent_(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.AbrStatusChanged,a))};
1412
1412
  shaka.Player.prototype.restoreDisabledVariants_=function(a){a=void 0===a?!0:a;if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE){goog.asserts.assert(this.manifest_,"Should have manifest!");shaka.log.v2("Restoring all disabled streams...");this.checkVariantsTimer_.stop();for(var b=$jscomp.makeIterator(this.manifest_.variants),c=b.next();!c.done;c=b.next())c.value.disabledUntilTime=0;a&&this.updateAbrManagerVariants_()}};
1413
1413
  shaka.Player.prototype.disableStream=function(a,b){if(!this.config_.abr.enabled||this.loadMode_===shaka.Player.LoadMode.DESTROYED||!navigator.onLine)return!1;if(this.manifest_.variants.some(function(g){return(g=g[a.type])&&g.id!==a.id?shaka.util.StreamUtils.isAudio(a)?a.language===g.language:!0:!1})){for(var c=!1,d=$jscomp.makeIterator(this.manifest_.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.disabledUntilTime=Date.now()/1E3+b,c=!0,shaka.log.v2("Disabled stream "+
1414
- a.type+":"+a.id+" for "+b+" seconds..."))}goog.asserts.assert(c,"Must have disabled stream");this.checkVariantsTimer_.tickEvery(1);b=this.getBufferedInfo().video.reduce(function(g,h){return g+h.end-h.start},0);this.chooseVariantAndSwitch_(!0,b,!0,!1);return!0}shaka.log.warning("No alternate stream found for active "+a.type+" stream. Will ignore request to disable stream...");return!1};
1414
+ a.type+":"+a.id+" for "+b+" seconds..."))}goog.asserts.assert(c,"Must have disabled stream");this.checkVariantsTimer_.tickEvery(1);b=this.getBufferedInfo().video.reduce(function(g,h){return g+h.end-h.start},0);this.chooseVariantAndSwitch_(!1,b,!0,!1);return!0}shaka.log.warning("No alternate stream found for active "+a.type+" stream. Will ignore request to disable stream...");return!1};
1415
1415
  shaka.Player.prototype.onError_=function(a){var b=this,c,d,e,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){switch(g.nextAddress){case 1:goog.asserts.assert(a instanceof shaka.util.Error,"Wrong error type!");if(b.loadMode_==shaka.Player.LoadMode.DESTROYED)return g.return();c=!0;if(!(b.fullyLoaded_&&b.manifest_&&b.streamingEngine_)||a.code!=shaka.util.Error.Code.VIDEO_ERROR&&a.code!=shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED&&a.code!=shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW&&
1416
1416
  a.code!=shaka.util.Error.Code.TRANSMUXING_FAILED){g.jumpTo(2);break}g.setCatchFinallyBlocks(3);return g.yield(b.streamingEngine_.resetMediaSource(),5);case 5:d=g.yieldResult;c=!d;g.leaveTryBlock(2);break;case 3:g.enterCatchBlock(),c=!0;case 2:if(!c)return g.return();a.severity===shaka.util.Error.Severity.CRITICAL&&b.restoreDisabledVariants_(!1);e=shaka.util.FakeEvent.EventName.Error;f=shaka.Player.makeEvent_(e,(new Map).set("detail",a));b.dispatchEvent(f);f.defaultPrevented&&(a.handled=!0);g.jumpToEnd()}})};
1417
1417
  shaka.Player.prototype.onRegionEvent_=function(a,b,c){c=void 0===c?this:c;b={schemeIdUri:b.schemeIdUri,value:b.value,startTime:b.startTime,endTime:b.endTime,id:b.id,eventElement:b.eventElement,eventNode:b.eventNode};b=(new Map).set("detail",b);c.dispatchEvent(shaka.Player.makeEvent_(a,b))};
@@ -1443,7 +1443,7 @@ goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.pro
1443
1443
  goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);
1444
1444
  goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);goog.exportProperty(shaka.Player.prototype,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);
1445
1445
  goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);
1446
- shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.10-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};
1446
+ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.12-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};
1447
1447
  shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_}};shaka.ads.ClientSideAd=function(a,b,c){var d=this;this.ad_=a;this.manager_=b;this.video_=c;this.isPaused_=!1;this.volume_=this.manager_.getVolume();this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.PAUSED,function(){d.isPaused_=!0});this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.RESUMED,function(){d.isPaused_=!1})};shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};
1448
1448
  shaka.ads.ClientSideAd.prototype.getMinSuggestedDuration=function(){return this.ad_.getMinSuggestedDuration()};shaka.ads.ClientSideAd.prototype.getRemainingTime=function(){return this.manager_.getRemainingTime()};shaka.ads.ClientSideAd.prototype.isPaused=function(){return this.isPaused_};shaka.ads.ClientSideAd.prototype.isSkippable=function(){return 0<=this.ad_.getSkipTimeOffset()};
1449
1449
  shaka.ads.ClientSideAd.prototype.getTimeUntilSkippable=function(){var a=this.ad_.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};shaka.ads.ClientSideAd.prototype.canSkipNow=function(){return this.manager_.getAdSkippableState()};shaka.ads.ClientSideAd.prototype.skip=function(){return this.manager_.skip()};shaka.ads.ClientSideAd.prototype.setPaused=function(a){this.isPaused_=a};shaka.ads.ClientSideAd.prototype.pause=function(){return this.manager_.pause()};
@@ -1481,20 +1481,24 @@ shaka.ads.AdManager.AD_LOADED)});this.eventManager_.listen(this.imaAdsManager_,g
1481
1481
  function(c){b(c,shaka.ads.AdManager.AD_RECOVERABLE_ERROR)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.AD_BREAK_READY,function(c){b(c,shaka.ads.AdManager.AD_BREAK_READY)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.INTERACTION,function(c){b(c,shaka.ads.AdManager.AD_INTERACTION)})};
1482
1482
  shaka.ads.ClientSideAdManager.prototype.onAdStart_=function(a){goog.asserts.assert(this.imaAdsManager_,"Should have an ads manager at this point!");var b=a.getAd();b?(this.ad_=new shaka.ads.ClientSideAd(b,this.imaAdsManager_,this.video_),a=(new Map).set("ad",this.ad_).set("sdkAdObject",b).set("originalEvent",a),this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.AD_STARTED,a)),this.ad_.isLinear()&&(this.adContainer_.setAttribute("ad-active","true"),this.config_.customPlayheadTracker||this.video_.pause(),
1483
1483
  this.video_.muted?this.ad_.setInitialMuted(this.video_.volume):this.ad_.setVolume(this.video_.volume))):shaka.log.alwaysWarn("The IMA SDK fired a "+a.type+" event with no associated ad. Unable to play ad!")};
1484
- shaka.ads.ClientSideAdManager.prototype.onAdComplete_=function(a){this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.AD_STOPPED,(new Map).set("originalEvent",a)));this.ad_&&this.ad_.isLinear()&&(this.adContainer_.removeAttribute("ad-active"),this.config_.customPlayheadTracker||this.video_.ended||this.video_.play())};shaka.ads.MediaTailorAd=function(a,b,c,d,e){this.ad_=a;this.video_=e;this.adPosition_=b;this.totalAds_=c;this.isLinear_=d;this.isSkipped_=!1};shaka.ads.MediaTailorAd.prototype.getDuration=function(){return this.ad_.durationInSeconds};shaka.ads.MediaTailorAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};shaka.ads.MediaTailorAd.prototype.getRemainingTime=function(){return this.ad_.startTimeInSeconds+this.ad_.durationInSeconds-this.video_.currentTime};
1485
- shaka.ads.MediaTailorAd.prototype.isPaused=function(){return this.video_.paused};shaka.ads.MediaTailorAd.prototype.isSkippable=function(){return this.ad_.skipOffset?!0:!1};shaka.ads.MediaTailorAd.prototype.getTimeUntilSkippable=function(){if(!this.ad_.skipOffset)return this.getRemainingTime();var a=this.getRemainingTime()-this.ad_.skipOffset;return Math.max(a,0)};shaka.ads.MediaTailorAd.prototype.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};
1486
- shaka.ads.MediaTailorAd.prototype.skip=function(){this.isSkipped_=!0;this.video_.currentTime+=this.getRemainingTime()};shaka.ads.MediaTailorAd.prototype.pause=function(){return this.video_.pause()};shaka.ads.MediaTailorAd.prototype.play=function(){return this.video_.play()};shaka.ads.MediaTailorAd.prototype.getVolume=function(){return this.video_.volume};shaka.ads.MediaTailorAd.prototype.setVolume=function(a){this.video_.volume=a};shaka.ads.MediaTailorAd.prototype.isMuted=function(){return this.video_.muted};
1487
- shaka.ads.MediaTailorAd.prototype.isLinear=function(){return this.isLinear_};shaka.ads.MediaTailorAd.prototype.resize=function(a,b){};shaka.ads.MediaTailorAd.prototype.setMuted=function(a){this.video_.muted=a};shaka.ads.MediaTailorAd.prototype.getSequenceLength=function(){return this.totalAds_?this.totalAds_:1};shaka.ads.MediaTailorAd.prototype.getPositionInSequence=function(){return this.adPosition_?this.adPosition_:1};shaka.ads.MediaTailorAd.prototype.getTitle=function(){return this.ad_.adTitle};
1488
- shaka.ads.MediaTailorAd.prototype.getDescription=function(){return""};shaka.ads.MediaTailorAd.prototype.getVastMediaBitrate=function(){return 0};shaka.ads.MediaTailorAd.prototype.getVastMediaHeight=function(){return 0};shaka.ads.MediaTailorAd.prototype.getVastMediaWidth=function(){return 0};shaka.ads.MediaTailorAd.prototype.getAdId=function(){return this.ad_.adId};shaka.ads.MediaTailorAd.prototype.getCreativeAdId=function(){return this.ad_.creativeId};
1489
- shaka.ads.MediaTailorAd.prototype.getAdvertiserName=function(){return""};shaka.ads.MediaTailorAd.prototype.getMediaUrl=function(){return null};shaka.ads.MediaTailorAd.prototype.getTimeOffset=function(){return 0};shaka.ads.MediaTailorAd.prototype.getPodIndex=function(){return 0};shaka.ads.MediaTailorAd.prototype.release=function(){this.totalAds_=this.adPosition_=this.video_=this.ad_=null};shaka.ads.MediaTailorAd.prototype.isSkipped=function(){return this.isSkipped_};
1490
- goog.exportSymbol("shaka.ads.MediaTailorAd",shaka.ads.MediaTailorAd);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"release",shaka.ads.MediaTailorAd.prototype.release);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getPodIndex",shaka.ads.MediaTailorAd.prototype.getPodIndex);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getTimeOffset",shaka.ads.MediaTailorAd.prototype.getTimeOffset);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getMediaUrl",shaka.ads.MediaTailorAd.prototype.getMediaUrl);
1491
- goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getAdvertiserName",shaka.ads.MediaTailorAd.prototype.getAdvertiserName);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getCreativeAdId",shaka.ads.MediaTailorAd.prototype.getCreativeAdId);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getAdId",shaka.ads.MediaTailorAd.prototype.getAdId);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVastMediaWidth",shaka.ads.MediaTailorAd.prototype.getVastMediaWidth);
1492
- goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVastMediaHeight",shaka.ads.MediaTailorAd.prototype.getVastMediaHeight);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVastMediaBitrate",shaka.ads.MediaTailorAd.prototype.getVastMediaBitrate);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getDescription",shaka.ads.MediaTailorAd.prototype.getDescription);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getTitle",shaka.ads.MediaTailorAd.prototype.getTitle);
1493
- goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getPositionInSequence",shaka.ads.MediaTailorAd.prototype.getPositionInSequence);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getSequenceLength",shaka.ads.MediaTailorAd.prototype.getSequenceLength);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"setMuted",shaka.ads.MediaTailorAd.prototype.setMuted);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"resize",shaka.ads.MediaTailorAd.prototype.resize);
1494
- goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isLinear",shaka.ads.MediaTailorAd.prototype.isLinear);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isMuted",shaka.ads.MediaTailorAd.prototype.isMuted);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"setVolume",shaka.ads.MediaTailorAd.prototype.setVolume);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVolume",shaka.ads.MediaTailorAd.prototype.getVolume);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"play",shaka.ads.MediaTailorAd.prototype.play);
1495
- goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"pause",shaka.ads.MediaTailorAd.prototype.pause);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"skip",shaka.ads.MediaTailorAd.prototype.skip);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"canSkipNow",shaka.ads.MediaTailorAd.prototype.canSkipNow);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getTimeUntilSkippable",shaka.ads.MediaTailorAd.prototype.getTimeUntilSkippable);
1496
- goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isSkippable",shaka.ads.MediaTailorAd.prototype.isSkippable);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isPaused",shaka.ads.MediaTailorAd.prototype.isPaused);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getRemainingTime",shaka.ads.MediaTailorAd.prototype.getRemainingTime);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getMinSuggestedDuration",shaka.ads.MediaTailorAd.prototype.getMinSuggestedDuration);
1497
- goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getDuration",shaka.ads.MediaTailorAd.prototype.getDuration);shaka.ads.MediaTailorAdManager=function(a,b,c,d){this.adContainer_=a;this.networkingEngine_=b;this.video_=c;this.streamPromise_=null;this.streamRequestStartTime_=NaN;this.onEvent_=d;this.isLive_=!1;this.snapForwardTime_=null;this.adBreaks_=[];this.playedAds_=[];this.mediaTailorAdBreak_=this.mediaTailorAd_=this.ad_=null;this.staticResources_=new Map;this.adListeners_=[];this.eventsSent=[];this.trackingUrl_="";this.firstTrackingRequest_=!0;this.backupUrl_="";this.currentCuePoints_=[];this.eventManager_=
1484
+ shaka.ads.ClientSideAdManager.prototype.onAdComplete_=function(a){this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.AD_STOPPED,(new Map).set("originalEvent",a)));this.ad_&&this.ad_.isLinear()&&(this.adContainer_.removeAttribute("ad-active"),this.config_.customPlayheadTracker||this.video_.ended||this.video_.play())};shaka.util.TextParser=function(a){this.data_=a||"";this.position_=0};shaka.util.TextParser.prototype.atEnd=function(){return this.position_==this.data_.length};shaka.util.TextParser.prototype.readLine=function(){return this.readRegexReturnCapture_(/(.*?)(\n|$)/gm,1)};shaka.util.TextParser.prototype.readWord=function(){return this.readRegexReturnCapture_(/[^ \t\n]*/gm,0)};shaka.util.TextParser.prototype.skipWhitespace=function(){this.readRegex(/[ \t]+/gm)};
1485
+ shaka.util.TextParser.prototype.readRegex=function(a){a=this.indexOf_(a);if(this.atEnd()||null==a||a.position!=this.position_)return null;this.position_+=a.length;return a.results};shaka.util.TextParser.prototype.readRegexReturnCapture_=function(a,b){return this.atEnd()?null:(a=this.readRegex(a))?a[b]:null};
1486
+ shaka.util.TextParser.prototype.indexOf_=function(a){goog.asserts.assert(a.global,"global flag should be set");a.lastIndex=this.position_;a=a.exec(this.data_);return null==a?null:{position:a.index,length:a[0].length,results:a}};shaka.ads.MediaTailorAd=function(a,b,c,d,e){this.ad_=a;this.skipOffset_=this.parseTime_(this.ad_.skipOffset);this.video_=e;this.adPosition_=b;this.totalAds_=c;this.isLinear_=d;this.isSkipped_=!1};shaka.ads.MediaTailorAd.prototype.getDuration=function(){return this.ad_.durationInSeconds};shaka.ads.MediaTailorAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};
1487
+ shaka.ads.MediaTailorAd.prototype.getRemainingTime=function(){return this.ad_.startTimeInSeconds+this.ad_.durationInSeconds-this.video_.currentTime};shaka.ads.MediaTailorAd.prototype.isPaused=function(){return this.video_.paused};shaka.ads.MediaTailorAd.prototype.isSkippable=function(){return"number"==typeof this.skipOffset_?!0:!1};
1488
+ shaka.ads.MediaTailorAd.prototype.getTimeUntilSkippable=function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var a=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(a,0)};shaka.ads.MediaTailorAd.prototype.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};shaka.ads.MediaTailorAd.prototype.skip=function(){this.isSkipped_=!0;this.video_.currentTime+=this.getRemainingTime()};shaka.ads.MediaTailorAd.prototype.pause=function(){return this.video_.pause()};
1489
+ shaka.ads.MediaTailorAd.prototype.play=function(){return this.video_.play()};shaka.ads.MediaTailorAd.prototype.getVolume=function(){return this.video_.volume};shaka.ads.MediaTailorAd.prototype.setVolume=function(a){this.video_.volume=a};shaka.ads.MediaTailorAd.prototype.isMuted=function(){return this.video_.muted};shaka.ads.MediaTailorAd.prototype.isLinear=function(){return this.isLinear_};shaka.ads.MediaTailorAd.prototype.resize=function(a,b){};
1490
+ shaka.ads.MediaTailorAd.prototype.setMuted=function(a){this.video_.muted=a};shaka.ads.MediaTailorAd.prototype.getSequenceLength=function(){return this.totalAds_?this.totalAds_:1};shaka.ads.MediaTailorAd.prototype.getPositionInSequence=function(){return this.adPosition_?this.adPosition_:1};shaka.ads.MediaTailorAd.prototype.getTitle=function(){return this.ad_.adTitle};shaka.ads.MediaTailorAd.prototype.getDescription=function(){return""};shaka.ads.MediaTailorAd.prototype.getVastMediaBitrate=function(){return 0};
1491
+ shaka.ads.MediaTailorAd.prototype.getVastMediaHeight=function(){return 0};shaka.ads.MediaTailorAd.prototype.getVastMediaWidth=function(){return 0};shaka.ads.MediaTailorAd.prototype.getAdId=function(){return this.ad_.adId};shaka.ads.MediaTailorAd.prototype.getCreativeAdId=function(){return this.ad_.creativeId};shaka.ads.MediaTailorAd.prototype.getAdvertiserName=function(){return""};shaka.ads.MediaTailorAd.prototype.getMediaUrl=function(){return null};
1492
+ shaka.ads.MediaTailorAd.prototype.getTimeOffset=function(){return 0};shaka.ads.MediaTailorAd.prototype.getPodIndex=function(){return 0};shaka.ads.MediaTailorAd.prototype.release=function(){this.totalAds_=this.adPosition_=this.video_=this.ad_=null};shaka.ads.MediaTailorAd.prototype.isSkipped=function(){return this.isSkipped_};
1493
+ shaka.ads.MediaTailorAd.prototype.parseTime_=function(a){if(!a)return null;a=(new shaka.util.TextParser(a)).readRegex(shaka.ads.MediaTailorAd.timeFormat_);if(null==a)return null;var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:(Number(a[4])||0)/1E3+c+60*b+3600*(Number(a[1])||0)};goog.exportSymbol("shaka.ads.MediaTailorAd",shaka.ads.MediaTailorAd);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"release",shaka.ads.MediaTailorAd.prototype.release);
1494
+ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getPodIndex",shaka.ads.MediaTailorAd.prototype.getPodIndex);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getTimeOffset",shaka.ads.MediaTailorAd.prototype.getTimeOffset);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getMediaUrl",shaka.ads.MediaTailorAd.prototype.getMediaUrl);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getAdvertiserName",shaka.ads.MediaTailorAd.prototype.getAdvertiserName);
1495
+ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getCreativeAdId",shaka.ads.MediaTailorAd.prototype.getCreativeAdId);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getAdId",shaka.ads.MediaTailorAd.prototype.getAdId);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVastMediaWidth",shaka.ads.MediaTailorAd.prototype.getVastMediaWidth);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVastMediaHeight",shaka.ads.MediaTailorAd.prototype.getVastMediaHeight);
1496
+ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVastMediaBitrate",shaka.ads.MediaTailorAd.prototype.getVastMediaBitrate);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getDescription",shaka.ads.MediaTailorAd.prototype.getDescription);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getTitle",shaka.ads.MediaTailorAd.prototype.getTitle);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getPositionInSequence",shaka.ads.MediaTailorAd.prototype.getPositionInSequence);
1497
+ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getSequenceLength",shaka.ads.MediaTailorAd.prototype.getSequenceLength);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"setMuted",shaka.ads.MediaTailorAd.prototype.setMuted);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"resize",shaka.ads.MediaTailorAd.prototype.resize);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isLinear",shaka.ads.MediaTailorAd.prototype.isLinear);
1498
+ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isMuted",shaka.ads.MediaTailorAd.prototype.isMuted);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"setVolume",shaka.ads.MediaTailorAd.prototype.setVolume);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVolume",shaka.ads.MediaTailorAd.prototype.getVolume);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"play",shaka.ads.MediaTailorAd.prototype.play);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"pause",shaka.ads.MediaTailorAd.prototype.pause);
1499
+ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"skip",shaka.ads.MediaTailorAd.prototype.skip);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"canSkipNow",shaka.ads.MediaTailorAd.prototype.canSkipNow);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getTimeUntilSkippable",shaka.ads.MediaTailorAd.prototype.getTimeUntilSkippable);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isSkippable",shaka.ads.MediaTailorAd.prototype.isSkippable);
1500
+ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isPaused",shaka.ads.MediaTailorAd.prototype.isPaused);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getRemainingTime",shaka.ads.MediaTailorAd.prototype.getRemainingTime);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getMinSuggestedDuration",shaka.ads.MediaTailorAd.prototype.getMinSuggestedDuration);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getDuration",shaka.ads.MediaTailorAd.prototype.getDuration);
1501
+ shaka.ads.MediaTailorAd.timeFormat_=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;shaka.ads.MediaTailorAdManager=function(a,b,c,d){this.adContainer_=a;this.networkingEngine_=b;this.video_=c;this.streamPromise_=null;this.streamRequestStartTime_=NaN;this.onEvent_=d;this.isLive_=!1;this.snapForwardTime_=null;this.adBreaks_=[];this.playedAds_=[];this.mediaTailorAdBreak_=this.mediaTailorAd_=this.ad_=null;this.staticResources_=new Map;this.adListeners_=[];this.eventsSent=[];this.trackingUrl_="";this.firstTrackingRequest_=!0;this.backupUrl_="";this.currentCuePoints_=[];this.eventManager_=
1498
1502
  new shaka.util.EventManager};shaka.ads.MediaTailorAdManager.prototype.streamRequest=function(a,b,c){if(this.streamPromise_)return Promise.reject(new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.ADS,shaka.util.Error.Code.CURRENT_DAI_REQUEST_NOT_FINISHED));this.streamPromise_=new shaka.util.PublicPromise;this.requestSessionInfo_(a,b);this.backupUrl_=c||"";this.streamRequestStartTime_=Date.now()/1E3;return this.streamPromise_};
1499
1503
  shaka.ads.MediaTailorAdManager.prototype.addTrackingUrl=function(a){this.trackingUrl_=a;this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.ADS_LOADED,(new Map).set("loadTime",0)))};
1500
1504
  shaka.ads.MediaTailorAdManager.prototype.stop=function(){for(var a=$jscomp.makeIterator(this.adListeners_),b=a.next();!b.done;b=a.next())b=b.value,this.eventManager_.unlisten(b.target,b.type,b.listener);this.onEnded_();this.adListeners_=[];this.eventsSent=[];this.trackingUrl_="";this.firstTrackingRequest_=!0;this.backupUrl_="";this.snapForwardTime_=null;this.adBreaks_=[];this.playedAds_=[];this.staticResources_.clear()};
@@ -2072,9 +2076,7 @@ shaka.hls.Tag.prototype.addAttribute=function(a){this.attributes.push(a)};shaka.
2072
2076
  shaka.hls.Tag.prototype.getRequiredAttrValue=function(a){var b=this.getAttribute(a);if(!b)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING,a);return b.value};shaka.hls.Tag.prototype.setName=function(a){this.name=a};shaka.hls.Segment=function(a,b,c){c=void 0===c?[]:c;this.tags=b;this.verbatimSegmentUri=a;this.partialSegments=c};shaka.hls.Attribute=function(a,b){this.name=a;this.value=b};shaka.hls.Utils=function(){};shaka.hls.Utils.filterTagsByName=function(a,b){return a.filter(function(c){return c.name==b})};shaka.hls.Utils.filterTagsByType=function(a,b){return a.filter(function(c){return c.getRequiredAttrValue("TYPE")==b})};shaka.hls.Utils.getFirstTagWithName=function(a,b){a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.name===b)return c;return null};
2073
2077
  shaka.hls.Utils.getFirstTagWithNameAsNumber=function(a,b,c){c=void 0===c?0:c;return(a=shaka.hls.Utils.getFirstTagWithName(a,b))?Number(a.value):c};shaka.hls.Utils.constructSegmentUris=function(a,b,c){return b?shaka.hls.Utils.constructUris(a,[b],c):[]};shaka.hls.Utils.constructUris=function(a,b,c){if(!b.length)return[];b=shaka.util.ManifestParserUtils.resolveUris(a,b);a=[];b=$jscomp.makeIterator(b);for(var d=b.next();!d.done;d=b.next())a.push(shaka.hls.Utils.variableSubstitution(d.value,c));return a};
2074
2078
  shaka.hls.Utils.variableSubstitution=function(a,b){if(!b||!b.size)return a;a=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}");var c=a.match(/{\$\w*}/g);if(c){c=$jscomp.makeIterator(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=d.slice(2,d.length-1),f=b.get(e);if(f)a=a.replace(d,f);else throw shaka.log.error("A variable has been found that is not declared",e),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_VARIABLE_NOT_FOUND,
2075
- e);}}return a};shaka.hls.Utils.isComment=function(a){return/^#(?!EXT)/m.test(a)};shaka.util.TextParser=function(a){this.data_=a||"";this.position_=0};shaka.util.TextParser.prototype.atEnd=function(){return this.position_==this.data_.length};shaka.util.TextParser.prototype.readLine=function(){return this.readRegexReturnCapture_(/(.*?)(\n|$)/gm,1)};shaka.util.TextParser.prototype.readWord=function(){return this.readRegexReturnCapture_(/[^ \t\n]*/gm,0)};shaka.util.TextParser.prototype.skipWhitespace=function(){this.readRegex(/[ \t]+/gm)};
2076
- shaka.util.TextParser.prototype.readRegex=function(a){a=this.indexOf_(a);if(this.atEnd()||null==a||a.position!=this.position_)return null;this.position_+=a.length;return a.results};shaka.util.TextParser.prototype.readRegexReturnCapture_=function(a,b){return this.atEnd()?null:(a=this.readRegex(a))?a[b]:null};
2077
- shaka.util.TextParser.prototype.indexOf_=function(a){goog.asserts.assert(a.global,"global flag should be set");a.lastIndex=this.position_;a=a.exec(this.data_);return null==a?null:{position:a.index,length:a[0].length,results:a}};shaka.hls.ManifestTextParser=function(){this.globalId_=0};
2079
+ e);}}return a};shaka.hls.Utils.isComment=function(a){return/^#(?!EXT)/m.test(a)};shaka.hls.ManifestTextParser=function(){this.globalId_=0};
2078
2080
  shaka.hls.ManifestTextParser.prototype.parsePlaylist=function(a){var b=shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS,c=shaka.hls.ManifestTextParser.SEGMENT_TAGS;a=shaka.util.StringUtils.fromUTF8(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var d=a.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(d[0]))throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING);a=shaka.hls.PlaylistType.MASTER;for(var e=!0,
2079
2081
  f=$jscomp.makeIterator(d),g=f.next();!g.done;g=f.next())if(g=g.value,shaka.hls.Utils.isComment(g)||e)e=!1;else if(g=this.parseTag_(g),--this.globalId_,b.includes(g.name)){a=shaka.hls.PlaylistType.MEDIA;break}else"EXT-X-STREAM-INF"==g.name&&(e=!0);b=[];e=!0;for(f=0;f<d.length;f++){var h=d[f];g=d[f+1];if(shaka.hls.Utils.isComment(h)||e)e=!1;else{h=this.parseTag_(h);if(c.includes(h.name)){if(a!=shaka.hls.PlaylistType.MEDIA)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,
2080
2082
  shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);c=d.splice(f,d.length-f);c=this.parseSegments_(c,b);return new shaka.hls.Playlist(a,b,c)}b.push(h);"EXT-X-STREAM-INF"==h.name&&(e=new shaka.hls.Attribute("URI",g),h.addAttribute(e),e=!0)}}return new shaka.hls.Playlist(a,b)};