shaka-player 4.11.1 → 4.11.2

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.
@@ -73,9 +73,10 @@ $jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Obj
73
73
  $jscomp.polyfill("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}},"es9","es3");$jscomp.polyfill("Array.prototype.entries",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(b,c){return[b,c]})}},"es6","es3");
74
74
  $jscomp.polyfill("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}},"es6","es3");$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(b){var c=$jscomp.checkStringArgs(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}},"es6","es3");
75
75
  $jscomp.polyfill("Number.isFinite",function(a){return a?a:function(b){return"number"!==typeof b?!1:!isNaN(b)&&Infinity!==b&&-Infinity!==b}},"es6","es3");$jscomp.polyfill("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push(b[d]);return c}},"es8","es3");$jscomp.polyfill("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}},"es6","es3");$jscomp.polyfill("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991},"es6","es3");
76
- $jscomp.polyfill("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}},"es6","es3");$jscomp.atMethod=function(a){a=Math.trunc(a)||0;0>a&&(a+=this.length);if(!(0>a||a>=this.length))return this[a]};$jscomp.polyfill("Array.prototype.at",function(a){return a?a:$jscomp.atMethod},"es_next","es5");$jscomp.typedArrayAt=function(a){return a?a:$jscomp.atMethod};
77
- $jscomp.polyfill("Int8Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint8Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint8ClampedArray.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Int16Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint16Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Int32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");
78
- $jscomp.polyfill("Uint32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Float32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Float64Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("String.prototype.at",function(a){return a?a:$jscomp.atMethod},"es_next","es5");var COMPILED=!0,goog=goog||{};goog.global=this||self;
76
+ $jscomp.polyfill("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=$jscomp.checkStringArgs(this,b,"endsWith");b+="";void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}},"es6","es3");$jscomp.polyfill("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}},"es6","es3");
77
+ $jscomp.atMethod=function(a){a=Math.trunc(a)||0;0>a&&(a+=this.length);if(!(0>a||a>=this.length))return this[a]};$jscomp.polyfill("Array.prototype.at",function(a){return a?a:$jscomp.atMethod},"es_next","es5");$jscomp.typedArrayAt=function(a){return a?a:$jscomp.atMethod};$jscomp.polyfill("Int8Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint8Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");
78
+ $jscomp.polyfill("Uint8ClampedArray.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Int16Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint16Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Int32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Uint32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("Float32Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");
79
+ $jscomp.polyfill("Float64Array.prototype.at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("String.prototype.at",function(a){return a?a:$jscomp.atMethod},"es_next","es5");var COMPILED=!0,goog=goog||{};goog.global=this||self;
79
80
  goog.exportPath_=function(a,b,c,d){a=a.split(".");d=d||goog.global;a[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)if(a.length||void 0===b)d=d[e]&&d[e]!==Object.prototype[e]?d[e]:d[e]={};else if(!c&&goog.isObject(b)&&goog.isObject(d[e]))for(var f in b)b.hasOwnProperty(f)&&(d[e][f]=b[f]);else d[e]=b};
80
81
  goog.define=function(a,b){if(!COMPILED){var c=goog.global.CLOSURE_UNCOMPILED_DEFINES,d=goog.global.CLOSURE_DEFINES;c&&void 0===c.nodeType&&Object.prototype.hasOwnProperty.call(c,a)?b=c[a]:d&&void 0===d.nodeType&&Object.prototype.hasOwnProperty.call(d,a)&&(b=d[a])}return b};goog.FEATURESET_YEAR=2012;goog.DEBUG=!0;goog.LOCALE="en";goog.getLocale=function(){return goog.LOCALE};goog.TRUSTED_SITE=!0;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1;
81
82
  goog.provide=function(a){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');goog.constructNamespace_(a)};goog.constructNamespace_=function(a,b,c){if(!COMPILED){delete goog.implicitNamespaces_[a];for(var d=a;(d=d.substring(0,d.lastIndexOf(".")))&&!goog.getObjectByName(d);)goog.implicitNamespaces_[d]=!0}goog.exportPath_(a,b,c)};goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/;
@@ -352,9 +353,9 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
352
353
  ["EXIT_LOOP_MODE","\u505c\u6b62\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["EXIT_PICTURE_IN_PICTURE","\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN","\u5168\u87a2\u5e55"],["LANGUAGE","\u8a9e\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u74b0\u64ad\u653e"],["MORE_SETTINGS","\u986f\u793a\u66f4\u591a\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u7a2e\u8a9e\u8a00"],["MUTE","\u975c\u97f3"],["NOT_APPLICABLE","\u4e0d\u9069\u7528"],["OFF","\u95dc\u9589"],
353
354
  ["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["QUALITY","\u97f3\u8cea"],["RECENTER_VR","\u91cd\u65b0\u7f6e\u4e2d"],["REPLAY","\u91cd\u64ad"],["RESOLUTION","\u89e3\u6790\u5ea6"],["REWIND","\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["STATISTICS","\u7d71\u8a08\u8cc7\u6599"],["SUBTITLE_FORCED",
354
355
  "\u5f37\u5236\u986f\u793a"],["SURROUND","\u74b0\u5834\u97f3\u6548"],["TOGGLE_STEREOSCOPIC","\u5207\u63db\u7acb\u9ad4\u5f71\u50cf"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]))};
355
- shaka.ui.Locales.Ids={MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",MORE_SETTINGS:"MORE_SETTINGS",AD_STATISTICS:"AD_STATISTICS",BACK:"BACK",CAPTIONS:"CAPTIONS",PAUSE:"PAUSE",LOOP:"LOOP",SKIP_TO_LIVE:"SKIP_TO_LIVE",QUALITY:"QUALITY",FULL_SCREEN:"FULL_SCREEN",SUBTITLE_FORCED:"SUBTITLE_FORCED",OFF:"OFF",STATISTICS:"STATISTICS",AD_TIME:"AD_TIME",SURROUND:"SURROUND",PLAY:"PLAY",REPLAY:"REPLAY",MUTE:"MUTE",LANGUAGE:"LANGUAGE",NOT_APPLICABLE:"NOT_APPLICABLE",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",UNMUTE:"UNMUTE",
356
- LIVE:"LIVE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",RESOLUTION:"RESOLUTION",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",RECENTER_VR:"RECENTER_VR",AIRPLAY:"AIRPLAY",FAST_FORWARD:"FAST_FORWARD",VOLUME:"VOLUME",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",ON:"ON",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",DOWNLOAD_VIDEO_FRAME:"DOWNLOAD_VIDEO_FRAME",AD_DURATION:"AD_DURATION",CAST:"CAST",PLAYBACK_RATE:"PLAYBACK_RATE",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",AD_PROGRESS:"AD_PROGRESS",REWIND:"REWIND",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",
357
- SKIP_AD:"SKIP_AD",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",CHAPTERS:"CHAPTERS",AUTO_QUALITY:"AUTO_QUALITY",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",SEEK:"SEEK"};shaka.abr={};shaka.abr.Ewma=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a);this.totalWeight_=this.estimate_=0};shaka.abr.Ewma.prototype.updateAlpha=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a)};shaka.abr.Ewma.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);b=b*(1-c)+c*this.estimate_;isNaN(b)||(this.estimate_=b,this.totalWeight_+=a)};
356
+ shaka.ui.Locales.Ids={AD_TIME:"AD_TIME",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",FULL_SCREEN:"FULL_SCREEN",REPLAY:"REPLAY",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",AD_DURATION:"AD_DURATION",LOOP:"LOOP",SKIP_AD:"SKIP_AD",LANGUAGE:"LANGUAGE",AIRPLAY:"AIRPLAY",CHAPTERS:"CHAPTERS",DOWNLOAD_VIDEO_FRAME:"DOWNLOAD_VIDEO_FRAME",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",REWIND:"REWIND",RESOLUTION:"RESOLUTION",NOT_APPLICABLE:"NOT_APPLICABLE",
357
+ UNMUTE:"UNMUTE",ON:"ON",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",AD_PROGRESS:"AD_PROGRESS",LIVE:"LIVE",SUBTITLE_FORCED:"SUBTITLE_FORCED",SKIP_TO_LIVE:"SKIP_TO_LIVE",RECENTER_VR:"RECENTER_VR",OFF:"OFF",CAST:"CAST",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",STATISTICS:"STATISTICS",SEEK:"SEEK",CAPTIONS:"CAPTIONS",FAST_FORWARD:"FAST_FORWARD",PLAY:"PLAY",AD_STATISTICS:"AD_STATISTICS",AUTO_QUALITY:"AUTO_QUALITY",SURROUND:"SURROUND",MORE_SETTINGS:"MORE_SETTINGS",PLAYBACK_RATE:"PLAYBACK_RATE",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",
358
+ EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",MUTE:"MUTE",QUALITY:"QUALITY",BACK:"BACK",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",VOLUME:"VOLUME",PAUSE:"PAUSE"};shaka.abr={};shaka.abr.Ewma=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a);this.totalWeight_=this.estimate_=0};shaka.abr.Ewma.prototype.updateAlpha=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a)};shaka.abr.Ewma.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);b=b*(1-c)+c*this.estimate_;isNaN(b)||(this.estimate_=b,this.totalWeight_+=a)};
358
359
  shaka.abr.Ewma.prototype.getEstimate=function(){return this.estimate_/(1-Math.pow(this.alpha_,this.totalWeight_))};shaka.abr.EwmaBandwidthEstimator=function(){this.fast_=new shaka.abr.Ewma(2);this.slow_=new shaka.abr.Ewma(5);this.bytesSampled_=0;this.minTotalBytes_=128E3;this.minBytes_=16E3};shaka.abr.EwmaBandwidthEstimator.prototype.configure=function(a){this.minTotalBytes_=a.minTotalBytes;this.minBytes_=a.minBytes;this.fast_.updateAlpha(a.fastHalfLife);this.slow_.updateAlpha(a.slowHalfLife)};
359
360
  shaka.abr.EwmaBandwidthEstimator.prototype.sample=function(a,b){if(!(b<this.minBytes_)){var c=8E3*b/a;a/=1E3;this.bytesSampled_+=b;this.fast_.sample(a,c);this.slow_.sample(a,c)}};shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate=function(a){return this.bytesSampled_<this.minTotalBytes_?a:Math.min(this.fast_.getEstimate(),this.slow_.getEstimate())};shaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate=function(){return this.bytesSampled_>=this.minTotalBytes_};shaka.util.EventManager=function(){this.bindingMap_=new shaka.util.MultiMap};shaka.util.EventManager.prototype.release=function(){this.removeAll();this.bindingMap_=null};shaka.util.EventManager.prototype.listen=function(a,b,c,d){this.bindingMap_&&(a=new shaka.util.EventManager.Binding_(a,b,c,d),this.bindingMap_.push(b,a))};shaka.util.EventManager.prototype.listenOnce=function(a,b,c,d){var e=this,f=function(g){e.unlisten(a,b,f);c(g)};this.listen(a,b,f,d)};
360
361
  shaka.util.EventManager.prototype.unlisten=function(a,b,c){if(this.bindingMap_){var d=this.bindingMap_.get(b)||[];d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.unlisten(),this.bindingMap_.remove(b,e))}};shaka.util.EventManager.prototype.removeAll=function(){if(this.bindingMap_){var a=this.bindingMap_.getAll();a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b.value.unlisten();this.bindingMap_.clear()}};
@@ -1001,10 +1002,10 @@ shaka.media.SegmentIterator.prototype.current=function(){var a=this.segmentIndex
1001
1002
  shaka.media.SegmentIterator.prototype.next=function(){var a=this.segmentIndex_.get(this.currentPosition_);this.reverse?a&&a.hasPartialSegments()?(this.currentPartialPosition_--,0>this.currentPartialPosition_&&(this.currentPosition_--,(a=this.segmentIndex_.get(this.currentPosition_))&&a.hasPartialSegments()?this.currentPartialPosition_=a.partialReferences.length-1:this.currentPartialPosition_=0)):(this.currentPosition_--,this.currentPartialPosition_=0):a&&a.hasPartialSegments()?(this.currentPartialPosition_++,
1002
1003
  a.hasAllPartialSegments()&&this.currentPartialPosition_==a.partialReferences.length&&(this.currentPosition_++,this.currentPartialPosition_=0)):(this.currentPosition_++,this.currentPartialPosition_=0);a=this.current();return{value:a,done:!a}};goog.exportSymbol("shaka.media.SegmentIterator",shaka.media.SegmentIterator);goog.exportProperty(shaka.media.SegmentIterator.prototype,"next",shaka.media.SegmentIterator.prototype.next);goog.exportProperty(shaka.media.SegmentIterator.prototype,"current",shaka.media.SegmentIterator.prototype.current);
1003
1004
  goog.exportProperty(shaka.media.SegmentIterator.prototype,"currentPosition",shaka.media.SegmentIterator.prototype.currentPosition);goog.exportProperty(shaka.media.SegmentIterator.prototype,"setReverse",shaka.media.SegmentIterator.prototype.setReverse);shaka.media.MetaSegmentIndex=function(){shaka.media.SegmentIndex.call(this,[]);this.indexes_=[]};$jscomp.inherits(shaka.media.MetaSegmentIndex,shaka.media.SegmentIndex);
1004
- shaka.media.MetaSegmentIndex.prototype.appendSegmentIndex=function(a){goog.asserts.assert(0==this.indexes_.length||0==a.getNumEvicted(),"Should not append a new segment index with already-evicted segments");this.indexes_.push(a)};shaka.media.MetaSegmentIndex.prototype.clone=function(){var a=new shaka.media.MetaSegmentIndex;a.indexes_=this.indexes_.slice();return a};
1005
- shaka.media.MetaSegmentIndex.prototype.release=function(){for(var a=$jscomp.makeIterator(this.indexes_),b=a.next();!b.done;b=a.next())b.value.release();this.indexes_=[]};shaka.media.MetaSegmentIndex.prototype.forEachTopLevelReference=function(a){for(var b=$jscomp.makeIterator(this.indexes_),c=b.next();!c.done;c=b.next())c.value.forEachTopLevelReference(a)};
1006
- shaka.media.MetaSegmentIndex.prototype.find=function(a){for(var b=0,c=$jscomp.makeIterator(this.indexes_),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};
1007
- shaka.media.MetaSegmentIndex.prototype.get=function(a){for(var b=0,c=!1,d=$jscomp.makeIterator(this.indexes_),e=d.next();!e.done;e=d.next()){e=e.value;goog.asserts.assert(!c||0==e.getNumEvicted(),"Should not see evicted segments after available segments");var f=e.get(a-b);if(f)return f;f=e.getNumReferences();b+=e.getNumEvicted()+f;c=c||0!=f}return null};shaka.media.MetaSegmentIndex.prototype.offset=function(a){goog.asserts.assert(!1,"offset() should not be used in MetaSegmentIndex!")};
1005
+ shaka.media.MetaSegmentIndex.prototype.evictEmpty=function(){for(;1<this.indexes_.length&&this.indexes_[0].isEmpty();){var a=this.indexes_.shift();this.numEvicted_+=a.getNumEvicted();a.release()}};shaka.media.MetaSegmentIndex.prototype.appendSegmentIndex=function(a){goog.asserts.assert(0==this.indexes_.length||0==a.getNumEvicted(),"Should not append a new segment index with already-evicted segments");this.indexes_.push(a)};
1006
+ shaka.media.MetaSegmentIndex.prototype.clone=function(){var a=new shaka.media.MetaSegmentIndex;a.indexes_=this.indexes_.slice();a.numEvicted_=this.numEvicted_;return a};shaka.media.MetaSegmentIndex.prototype.release=function(){for(var a=$jscomp.makeIterator(this.indexes_),b=a.next();!b.done;b=a.next())b.value.release();this.indexes_=[]};shaka.media.MetaSegmentIndex.prototype.forEachTopLevelReference=function(a){for(var b=$jscomp.makeIterator(this.indexes_),c=b.next();!c.done;c=b.next())c.value.forEachTopLevelReference(a)};
1007
+ shaka.media.MetaSegmentIndex.prototype.find=function(a){for(var b=this.numEvicted_,c=$jscomp.makeIterator(this.indexes_),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};
1008
+ shaka.media.MetaSegmentIndex.prototype.get=function(a){for(var b=this.numEvicted_,c=!1,d=$jscomp.makeIterator(this.indexes_),e=d.next();!e.done;e=d.next()){e=e.value;goog.asserts.assert(!c||0==e.getNumEvicted(),"Should not see evicted segments after available segments");var f=e.get(a-b);if(f)return f;f=e.getNumReferences();b+=e.getNumEvicted()+f;c=c||0!=f}return null};shaka.media.MetaSegmentIndex.prototype.offset=function(a){goog.asserts.assert(!1,"offset() should not be used in MetaSegmentIndex!")};
1008
1009
  shaka.media.MetaSegmentIndex.prototype.merge=function(a){goog.asserts.assert(!1,"merge() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.evict=function(a){goog.asserts.assert(!1,"evict() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.mergeAndEvict=function(a,b){goog.asserts.assert(!1,"mergeAndEvict() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.fit=function(a,b){goog.asserts.assert(!1,"fit() should not be used in MetaSegmentIndex!")};
1009
1010
  shaka.media.MetaSegmentIndex.prototype.updateEvery=function(a,b){goog.asserts.assert(!1,"updateEvery() should not be used in MetaSegmentIndex!")};goog.exportSymbol("shaka.media.MetaSegmentIndex",shaka.media.MetaSegmentIndex);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"updateEvery",shaka.media.MetaSegmentIndex.prototype.updateEvery);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"fit",shaka.media.MetaSegmentIndex.prototype.fit);
1010
1011
  goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"mergeAndEvict",shaka.media.MetaSegmentIndex.prototype.mergeAndEvict);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"evict",shaka.media.MetaSegmentIndex.prototype.evict);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"merge",shaka.media.MetaSegmentIndex.prototype.merge);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"offset",shaka.media.MetaSegmentIndex.prototype.offset);
@@ -1154,9 +1155,9 @@ c.reader.getPosition());if(b&&b.includes(d)||this.config_.dispatchAllEmsgBoxes)i
1154
1155
  d)&&(d=shaka.util.Id3Utils.getID3Frames(a),d.length))this.playerInterface_.onMetadata([{cueTime:l,data:a,frames:d,dts:l,pts:l}],0,b)};
1155
1156
  shaka.media.StreamingEngine.prototype.parsePrft_=function(a,b){if(!this.parsedPrftEventRaised_&&a.initSegmentReference.timescale){goog.asserts.assert(0==b.version||1==b.version,"PRFT version can only be 0 or 1");b=shaka.util.Mp4BoxParsers.parsePRFTInaccurate(b.reader,b.version);a=a.initSegmentReference.timescale;var c=this.convertNtp(b.ntpTimestamp);a={wallClockTime:c,programStartDate:new Date(c-b.mediaTime/a*1E3)};b=shaka.util.FakeEvent.EventName.Prft;a=(new Map).set("detail",a);b=new shaka.util.FakeEvent(b,
1156
1157
  a);this.playerInterface_.onEvent(b);this.parsedPrftEventRaised_=!0}};shaka.media.StreamingEngine.prototype.convertNtp=function(a){var b=new Date(Date.UTC(1900,0,1,0,0,0));return(new Date(b.getTime()+a)).getTime()};
1157
- shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress){d=shaka.media.StreamingEngine.logPrefix_(a);shaka.log.v2(d,"checking buffer length");e=Math.max(c.config_.bufferBehind,c.manifest_.presentationTimeline.getMaxSegmentDuration());f=c.playerInterface_.mediaSourceEngine.bufferStart(a.type);if(null==f)return shaka.log.v2(d,"buffer behind okay because nothing buffered:","presentationTime="+b,
1158
- "bufferBehind="+e),k.return();g=b-f;h=g-e;if(h<=c.config_.evictionGoal)return shaka.log.v2(d,"buffer behind okay:","presentationTime="+b,"bufferedBehind="+g,"bufferBehind="+e,"evictionGoal="+c.config_.evictionGoal,"underflow="+Math.abs(h)),k.return();shaka.log.v1(d,"buffer behind too large:","presentationTime="+b,"bufferedBehind="+g,"bufferBehind="+e,"evictionGoal="+c.config_.evictionGoal,"overflow="+h);return k.yield(c.playerInterface_.mediaSourceEngine.remove(a.type,f,f+h),2)}c.destroyer_.ensureNotDestroyed();
1159
- shaka.log.v1(d,"evicted "+h+" seconds");k.jumpToEnd()})};shaka.media.StreamingEngine.isEmbeddedText_=function(a){var b=shaka.util.MimeUtils,c=b.CEA608_CLOSED_CAPTION_MIMETYPE;b=b.CEA708_CLOSED_CAPTION_MIMETYPE;return a&&a.type==shaka.util.ManifestParserUtils.ContentType.TEXT&&(a.stream.mimeType==c||a.stream.mimeType==b)};
1158
+ shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){d=a.stream.segmentIndex;d instanceof shaka.media.MetaSegmentIndex&&d.evictEmpty();e=shaka.media.StreamingEngine.logPrefix_(a);shaka.log.v2(e,"checking buffer length");f=Math.max(c.config_.bufferBehind,c.manifest_.presentationTimeline.getMaxSegmentDuration());g=c.playerInterface_.mediaSourceEngine.bufferStart(a.type);if(null==g)return shaka.log.v2(e,
1159
+ "buffer behind okay because nothing buffered:","presentationTime="+b,"bufferBehind="+f),l.return();h=b-g;k=h-f;if(k<=c.config_.evictionGoal)return shaka.log.v2(e,"buffer behind okay:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"underflow="+Math.abs(k)),l.return();shaka.log.v1(e,"buffer behind too large:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"overflow="+k);return l.yield(c.playerInterface_.mediaSourceEngine.remove(a.type,
1160
+ g,g+k),2)}c.destroyer_.ensureNotDestroyed();shaka.log.v1(e,"evicted "+k+" seconds");l.jumpToEnd()})};shaka.media.StreamingEngine.isEmbeddedText_=function(a){var b=shaka.util.MimeUtils,c=b.CEA608_CLOSED_CAPTION_MIMETYPE;b=b.CEA708_CLOSED_CAPTION_MIMETYPE;return a&&a.type==shaka.util.ManifestParserUtils.ContentType.TEXT&&(a.stream.mimeType==c||a.stream.mimeType==b)};
1160
1161
  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);
1161
1162
  break}return l.yield(shaka.media.SegmentUtils.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,d){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)};
1162
1163
  shaka.media.StreamingEngine.dispatchFetch=function(a,b,c,d,e,f){f=void 0===f?!1:f;var g=shaka.net.NetworkingEngine.RequestType.SEGMENT,h=a instanceof shaka.media.SegmentReference?a:void 0,k=h?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(g,c,{type:k,stream:b,segment:h,
@@ -1616,7 +1617,7 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
1616
1617
  goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.configure);goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);goog.exportProperty(shaka.Player.prototype,"destroyAllPreloads",shaka.Player.prototype.destroyAllPreloads);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);
1617
1618
  goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);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);
1618
1619
  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);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);
1619
- 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);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.11.1-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
1620
+ 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);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.11.2-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
1620
1621
  shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.errors_=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_++};shaka.ads.AdsStats.prototype.incrementErrors=function(){this.errors_++};
1621
1622
  shaka.ads.AdsStats.prototype.getAverageLoadTime_=function(){return this.loadTimes_.length?this.loadTimes_.reduce(function(a,b){return a+b},0)/this.loadTimes_.length:0};shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,averageLoadTime:this.getAverageLoadTime_(),started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_,errors:this.errors_}};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.needsSkipUI=function(){return!1};
1622
1623
  shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};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()};
@@ -2175,12 +2176,13 @@ shaka.util.PeriodCombiner.extendOutputStream_(f,0,d,e,0);return f};
2175
2176
  shaka.util.PeriodCombiner.extendOutputStream_=function(a,b,c,d,e){var f=shaka.util.ManifestParserUtils.ContentType,g=shaka.util.LanguageUtils,h=a.matchedStreams;goog.asserts.assert(a.matchedStreams,"matchedStreams should be non-null");for(b+=e;b<h.length;b++){var k=h[b];c(a,k);var l=!0;a.type==f.AUDIO&&0==g.relatedness(a.language,k.language)&&(l=!1);if(l&&(d[b-e].delete(k),k.fullMimeTypes))for(k=$jscomp.makeIterator(k.fullMimeTypes.values()),l=k.next();!l.done;l=k.next())a.fullMimeTypes.add(l.value)}};
2176
2177
  shaka.util.PeriodCombiner.cloneStream_=function(a){var b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=function(){return Promise.resolve()};b.closeSegmentIndex=function(){b.segmentIndex&&(b.segmentIndex.release(),b.segmentIndex=null);if(b.matchedStreams)for(var c=$jscomp.makeIterator(b.matchedStreams),d=c.next();!d.done;d=c.next())d=d.value,d.segmentIndex&&(d.segmentIndex.release(),d.segmentIndex=null)};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set;
2177
2178
  b.closedCaptions=null;b.trickModeVideo=null;return b};shaka.util.PeriodCombiner.cloneStreamDB_=function(a){a=Object.assign({},a);a.roles=a.roles.slice();a.keyIds=new Set;a.segments=[];a.variantIds=[];a.closedCaptions=null;return a};
2178
- shaka.util.PeriodCombiner.concatenateStreams_=function(a,b){var c=function(f,g){f||(f=[]);g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next())h=h.value,f.includes(h)||f.push(h);return f};a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));c=$jscomp.makeIterator(b.keyIds);for(var d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.originalId=null==a.originalId?b.originalId:a.originalId+(","+(b.originalId||""));c=shaka.util.DrmUtils.getCommonDrmInfos(a.drmInfos,
2179
- b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.INCONSISTENT_DRM_ACROSS_PERIODS);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),c=$jscomp.makeIterator(b.closedCaptions),d=c.next();!d.done;d=c.next()){var e=$jscomp.makeIterator(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}a.bandwidth&&
2180
- b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=shaka.util.PeriodCombiner.cloneStream_(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=function(){if(a.trickModeVideo.segmentIndex)return Promise.resolve();var f=new shaka.media.MetaSegmentIndex;goog.asserts.assert(a.trickModeVideo.matchedStreams,"trickmode matched streams should exist");for(var g=$jscomp.makeIterator(a.trickModeVideo.matchedStreams),
2181
- h=g.next();!h.done;h=g.next())h=h.value,goog.asserts.assert(h.segmentIndex,"trickmode segment index should exist"),f.appendSegmentIndex(h.segmentIndex);a.trickModeVideo.segmentIndex=f;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),shaka.util.PeriodCombiner.concatenateStreams_(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),shaka.util.PeriodCombiner.concatenateStreams_(a.trickModeVideo,b))};
2182
- shaka.util.PeriodCombiner.concatenateStreamDBs_=function(a,b){var c=a.roles;c||(c=[]);for(var d=$jscomp.makeIterator(b.roles),e=d.next();!e.done;e=d.next())e=e.value,c.includes(e)||c.push(e);a.roles=c;c=$jscomp.makeIterator(b.keyIds);for(d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.encrypted=a.encrypted&&b.encrypted;a.segments.push.apply(a.segments,$jscomp.arrayFromIterable(b.segments));if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),b=$jscomp.makeIterator(b.closedCaptions),
2183
- c=b.next();!c.done;c=b.next())d=$jscomp.makeIterator(c.value),c=d.next().value,d=d.next().value,a.closedCaptions.set(c,d)};shaka.util.PeriodCombiner.prototype.findMatchesInAllPeriods_=function(a,b,c){c=(void 0===c?0:c)?b.matchedStreams:[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=this.findBestMatchInPeriod_(d.value,b);if(!d)return;c.push(d)}b.matchedStreams=c};
2179
+ shaka.util.PeriodCombiner.concatenateStreams_=function(a,b){var c=function(f,g){f||(f=[]);g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next())h=h.value,f.includes(h)||f.push(h);return f};a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));c=$jscomp.makeIterator(b.keyIds);for(var d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);null==a.originalId?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=
2180
+ ","+c);c=shaka.util.DrmUtils.getCommonDrmInfos(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.INCONSISTENT_DRM_ACROSS_PERIODS);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),c=$jscomp.makeIterator(b.closedCaptions),d=c.next();!d.done;d=c.next()){var e=$jscomp.makeIterator(d.value);d=
2181
+ e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=shaka.util.PeriodCombiner.cloneStream_(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=function(){if(a.trickModeVideo.segmentIndex)return Promise.resolve();var f=new shaka.media.MetaSegmentIndex;goog.asserts.assert(a.trickModeVideo.matchedStreams,"trickmode matched streams should exist");
2182
+ for(var g=$jscomp.makeIterator(a.trickModeVideo.matchedStreams),h=g.next();!h.done;h=g.next())h=h.value,goog.asserts.assert(h.segmentIndex,"trickmode segment index should exist"),f.appendSegmentIndex(h.segmentIndex);a.trickModeVideo.segmentIndex=f;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),shaka.util.PeriodCombiner.concatenateStreams_(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),shaka.util.PeriodCombiner.concatenateStreams_(a.trickModeVideo,
2183
+ b))};
2184
+ shaka.util.PeriodCombiner.concatenateStreamDBs_=function(a,b){var c=a.roles;c||(c=[]);for(var d=$jscomp.makeIterator(b.roles),e=d.next();!e.done;e=d.next())e=e.value,c.includes(e)||c.push(e);a.roles=c;c=$jscomp.makeIterator(b.keyIds);for(d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.encrypted=a.encrypted&&b.encrypted;a.segments.push.apply(a.segments,$jscomp.arrayFromIterable(b.segments));if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),b=$jscomp.makeIterator(b.closedCaptions),c=
2185
+ b.next();!c.done;c=b.next())d=$jscomp.makeIterator(c.value),c=d.next().value,d=d.next().value,a.closedCaptions.set(c,d)};shaka.util.PeriodCombiner.prototype.findMatchesInAllPeriods_=function(a,b,c){c=(void 0===c?0:c)?b.matchedStreams:[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=this.findBestMatchInPeriod_(d.value,b);if(!d)return;c.push(d)}b.matchedStreams=c};
2184
2186
  shaka.util.PeriodCombiner.prototype.findBestMatchInPeriod_=function(a,b){var c=this,d={audio:shaka.util.PeriodCombiner.generateAudioKey_,video:shaka.util.PeriodCombiner.generateVideoKey_,text:shaka.util.PeriodCombiner.generateTextKey_,image:shaka.util.PeriodCombiner.generateImageKey_}[b.type],e=null,f=d(b);if(a.has(f))e=a.get(f);else{f={audio:function(l,m){return c.areAVStreamsCompatible_(l,m)},video:function(l,m){return c.areAVStreamsCompatible_(l,m)},text:shaka.util.PeriodCombiner.areTextStreamsCompatible_,
2185
2187
  image:shaka.util.PeriodCombiner.areImageStreamsCompatible_}[b.type];for(var g={audio:shaka.util.PeriodCombiner.isAudioStreamBetterMatch_,video:shaka.util.PeriodCombiner.isVideoStreamBetterMatch_,text:shaka.util.PeriodCombiner.isTextStreamBetterMatch_,image:shaka.util.PeriodCombiner.isImageStreamBetterMatch_}[b.type],h=$jscomp.makeIterator(a.values()),k=h.next();!k.done;k=h.next())k=k.value,!f(b,k)||b.fastSwitching!=k.fastSwitching||e&&!g(b,e,k)||(e=k)}this.useStreamOnce_&&!shaka.util.PeriodCombiner.isDummy_(e)&&
2186
2188
  a.delete(d(e));return e};shaka.util.PeriodCombiner.areAVStreamsExactMatch_=function(a,b){return a.mimeType!=b.mimeType?!1:shaka.util.PeriodCombiner.getCodec_(a.codecs)===shaka.util.PeriodCombiner.getCodec_(b.codecs)};shaka.util.PeriodCombiner.prototype.setAllowMultiTypeVariants=function(a){this.multiTypeVariantsAllowed_=a};shaka.util.PeriodCombiner.prototype.setUseStreamOnce=function(a){this.useStreamOnce_=a};
@@ -2309,8 +2311,8 @@ shaka.dash.DashParser.prototype.parseUtcTiming_=function(a,b){var c=this,d,e,f,g
2309
2311
  switch(k){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return p.jumpTo(7);case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return p.jumpTo(8);case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),p.return(isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":shaka.log.alwaysWarn("NTP UTCTiming scheme is not supported");
2310
2312
  break;default:shaka.log.alwaysWarn("Unrecognized scheme in UTCTiming element",k)}p.jumpTo(9);break;case 7:return p.yield(c.requestForTiming_(a,l,"HEAD"),10);case 10:return p.return(p.yieldResult);case 8:return p.yield(c.requestForTiming_(a,l,"GET"),11);case 11:return p.return(p.yieldResult);case 9:p.leaveTryBlock(3);break;case 5:n=p.enterCatchBlock(),shaka.log.warning("Error fetching time from UTCTiming elem",n.message);case 3:g=f.next();p.jumpTo(2);break;case 4:return shaka.log.alwaysWarn("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),
2311
2313
  p.return(0)}})};
2312
- shaka.dash.DashParser.prototype.parseEventStream_=function(a,b,c,d){var e=shaka.util.TXml,f=shaka.util.TXml.parseNonNegativeInt,g=c.attributes.schemeIdUri||"",h=c.attributes.value||"",k=e.parseAttr(c,"timescale",f)||1;c=$jscomp.makeIterator(e.findChildren(c,"Event"));for(var l=c.next();!l.done;l=c.next()){l=l.value;var m=e.parseAttr(l,"presentationTime",f)||0,n=e.parseAttr(l,"duration",f)||0;m=m/k+a;n=m+n/k;null!=b&&(m=Math.min(m,a+b),n=Math.min(n,a+b));n<d||(l={schemeIdUri:g,value:h,startTime:m,
2313
- endTime:n,id:l.attributes.id||"",eventElement:e.txmlNodeToDomElement(l),eventNode:l},this.playerInterface_.onTimelineRegionAdded(l))}};
2314
+ shaka.dash.DashParser.prototype.parseEventStream_=function(a,b,c,d){var e=shaka.util.TXml,f=shaka.util.TXml.parseNonNegativeInt,g=c.attributes.schemeIdUri||"",h=c.attributes.value||"",k=e.parseAttr(c,"timescale",f)||1,l=e.parseAttr(c,"presentationTimeOffset",f)||0;c=$jscomp.makeIterator(e.findChildren(c,"Event"));for(var m=c.next();!m.done;m=c.next()){m=m.value;var n=e.parseAttr(m,"presentationTime",f)||0,p=e.parseAttr(m,"duration",f)||0;n=Math.max((n-l)/k+a,a);p=n+p/k;null!=b&&(n=Math.min(n,a+b),
2315
+ p=Math.min(p,a+b));p<d||(m={schemeIdUri:g,value:h,startTime:n,endTime:p,id:m.attributes.id||"",eventElement:e.txmlNodeToDomElement(m),eventNode:e.cloneNode(m)},this.playerInterface_.onTimelineRegionAdded(m))}};
2314
2316
  shaka.dash.DashParser.prototype.requestSegment_=function(a,b,c,d){var e=this,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress)return f=shaka.net.NetworkingEngine.RequestType.SEGMENT,g=d?shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT:shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT,h=shaka.util.Networking.createSegmentRequest(a,b,c,e.config_.retryParameters),l.yield(e.makeNetworkRequest_(h,f,{type:g}),2);k=l.yieldResult;return l.return(k.data)})};
2315
2317
  shaka.dash.DashParser.guessContentType_=function(a,b){b=shaka.util.MimeUtils.getFullType(a,b);return shaka.text.TextEngine.isTypeSupported(b)?shaka.util.ManifestParserUtils.ContentType.TEXT:a.split("/")[0]};shaka.dash.DashParser.prototype.makeNetworkRequest_=function(a,b,c){c||(c={});c.isPreload=this.isPreloadFn_();a=this.playerInterface_.networkingEngine.request(b,a,c);this.operationManager_.manage(a);return a.promise};
2316
2318
  shaka.dash.DashParser.prototype.updatePatchLocationNodes_=function(a){shaka.util.TXml.modifyNodes(this.patchLocationNodes_,a)};
@@ -2888,13 +2890,14 @@ k=shaka.text.TtmlTextParser.getElementsFromCollection_(u,"region",f,"")[0];if(u.
2888
2890
  shaka.text.TtmlTextParser.parseCueRegion_=function(a,b,c){var d=shaka.text.TtmlTextParser,e=new shaka.text.CueRegion,f=a.attributes["xml:id"];if(!f)return shaka.log.warning("TtmlTextParser parser encountered a region with no id. Region will be ignored."),null;e.id=f;f=null;c&&(f=d.percentValues_.exec(c)||d.pixelValues_.exec(c));c=f?Number(f[1]):null;f=f?Number(f[2]):null;var g,h=d.getStyleAttributeFromRegion_(a,b,"extent");if(h){var k=(g=d.percentValues_.exec(h))||d.pixelValues_.exec(h);null!=k&&
2889
2891
  (e.width=Number(k[1]),e.height=Number(k[2]),g||(null!=c&&(e.width=100*e.width/c),null!=f&&(e.height=100*e.height/f)),e.widthUnits=g||null!=c?shaka.text.CueRegion.units.PERCENTAGE:shaka.text.CueRegion.units.PX,e.heightUnits=g||null!=f?shaka.text.CueRegion.units.PERCENTAGE:shaka.text.CueRegion.units.PX)}if(a=d.getStyleAttributeFromRegion_(a,b,"origin"))if(k=(g=d.percentValues_.exec(a))||d.pixelValues_.exec(a),null!=k)e.viewportAnchorX=Number(k[1]),e.viewportAnchorY=Number(k[2]),g?h||(e.width=100-e.viewportAnchorX,
2890
2892
  e.widthUnits=shaka.text.CueRegion.units.PERCENTAGE,e.height=100-e.viewportAnchorY,e.heightUnits=shaka.text.CueRegion.units.PERCENTAGE):(null!=f&&(e.viewportAnchorY=100*e.viewportAnchorY/f),null!=c&&(e.viewportAnchorX=100*e.viewportAnchorX/c)),e.viewportAnchorUnits=g||null!=c?shaka.text.CueRegion.units.PERCENTAGE:shaka.text.CueRegion.units.PX;return e};
2893
+ shaka.text.TtmlTextParser.convertTTMLrgbaToHTMLrgba_=function(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(","),4==b.length)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a};
2891
2894
  shaka.text.TtmlTextParser.addStyle_=function(a,b,c,d,e,f,g,h){var k=shaka.text.TtmlTextParser,l=shaka.util.TXml,m=shaka.text.Cue;g=g||h;"rtl"==k.getStyleAttribute_(b,c,f,"direction",g)&&(a.direction=m.direction.HORIZONTAL_RIGHT_TO_LEFT);h=k.getStyleAttribute_(b,c,f,"writingMode",g);"tb"==h||"tblr"==h?a.writingMode=m.writingMode.VERTICAL_LEFT_TO_RIGHT:"tbrl"==h?a.writingMode=m.writingMode.VERTICAL_RIGHT_TO_LEFT:"rltb"==h||"rl"==h?a.direction=m.direction.HORIZONTAL_RIGHT_TO_LEFT:h&&(a.direction=m.direction.HORIZONTAL_LEFT_TO_RIGHT);
2892
2895
  (h=k.getStyleAttribute_(b,c,f,"textAlign",!0))?(a.positionAlign=k.textAlignToPositionAlign_[h],a.lineAlign=k.textAlignToLineAlign_[h],goog.asserts.assert(h.toUpperCase()in m.textAlign,h.toUpperCase()+" Should be in Cue.textAlign values!"),a.textAlign=m.textAlign[h.toUpperCase()]):a.textAlign=m.textAlign.CENTER;if(h=k.getStyleAttribute_(b,c,f,"displayAlign",!0))goog.asserts.assert(h.toUpperCase()in m.displayAlign,h.toUpperCase()+" Should be in Cue.displayAlign values!"),a.displayAlign=m.displayAlign[h.toUpperCase()];
2893
- if(h=k.getStyleAttribute_(b,c,f,"color",g))a.color=h;if(h=k.getStyleAttribute_(b,c,f,"backgroundColor",g))a.backgroundColor=h;if(h=k.getStyleAttribute_(b,c,f,"border",g))a.border=h;if(h=k.getStyleAttribute_(b,c,f,"fontFamily",g))switch(h){case "monospaceSerif":a.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":a.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":a.fontFamily="sans-serif";break;case "monospaceSansSerif":a.fontFamily=
2894
- "Consolas,monospace";break;case "proportionalSerif":a.fontFamily="serif";break;default:a.fontFamily=h.split(",").filter(function(n){return"default"!=n}).join(",")}(h=k.getStyleAttribute_(b,c,f,"fontWeight",g))&&"bold"==h&&(a.fontWeight=m.fontWeight.BOLD);h=k.getStyleAttribute_(b,c,f,"wrapOption",g);a.wrapLine=h&&"noWrap"==h?!1:!0;(h=k.getStyleAttribute_(b,c,f,"lineHeight",g))&&h.match(k.unitValues_)&&(a.lineHeight=h);(h=k.getStyleAttribute_(b,c,f,"fontSize",g))&&(h.match(k.unitValues_)||h.match(k.percentValue_))&&
2895
- (a.fontSize=h);if(h=k.getStyleAttribute_(b,c,f,"fontStyle",g))goog.asserts.assert(h.toUpperCase()in m.fontStyle,h.toUpperCase()+" Should be in Cue.fontStyle values!"),a.fontStyle=m.fontStyle[h.toUpperCase()];d?(e=d.attributes.imageType||d.attributes.imagetype,m=d.attributes.encoding,d=l.getTextContents(d).trim(),"PNG"==e&&"Base64"==m&&d&&(a.backgroundImage="data:image/png;base64,"+d)):e&&(a.backgroundImage=e);if(d=k.getStyleAttribute_(b,c,f,"textOutline",g))d=d.split(" "),d[0].match(k.unitValues_)?
2896
- a.textStrokeColor=a.color:(a.textStrokeColor=d[0],d.shift()),d[0]&&d[0].match(k.unitValues_)?a.textStrokeWidth=d[0]:a.textStrokeColor="";(d=k.getStyleAttribute_(b,c,f,"letterSpacing",g))&&d.match(k.unitValues_)&&(a.letterSpacing=d);(d=k.getStyleAttribute_(b,c,f,"linePadding",g))&&d.match(k.unitValues_)&&(a.linePadding=d);if(d=k.getStyleAttribute_(b,c,f,"opacity",g))a.opacity=parseFloat(d);(d=k.getStyleAttributeFromRegion_(c,f,"textDecoration"))&&k.addTextDecoration_(a,d);(d=k.getStyleAttributeFromElement_(b,
2897
- f,"textDecoration"))&&k.addTextDecoration_(a,d);if(d=k.getStyleAttribute_(b,c,f,"textCombine",g))a.textCombineUpright=d;switch(k.getStyleAttribute_(b,c,f,"ruby",g)){case "container":a.rubyTag="ruby";break;case "text":a.rubyTag="rt"}};
2896
+ if(h=k.getStyleAttribute_(b,c,f,"color",g))a.color=k.convertTTMLrgbaToHTMLrgba_(h);if(h=k.getStyleAttribute_(b,c,f,"backgroundColor",g))a.backgroundColor=k.convertTTMLrgbaToHTMLrgba_(h);if(h=k.getStyleAttribute_(b,c,f,"border",g))a.border=h;if(h=k.getStyleAttribute_(b,c,f,"fontFamily",g))switch(h){case "monospaceSerif":a.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":a.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":a.fontFamily=
2897
+ "sans-serif";break;case "monospaceSansSerif":a.fontFamily="Consolas,monospace";break;case "proportionalSerif":a.fontFamily="serif";break;default:a.fontFamily=h.split(",").filter(function(n){return"default"!=n}).join(",")}(h=k.getStyleAttribute_(b,c,f,"fontWeight",g))&&"bold"==h&&(a.fontWeight=m.fontWeight.BOLD);h=k.getStyleAttribute_(b,c,f,"wrapOption",g);a.wrapLine=h&&"noWrap"==h?!1:!0;(h=k.getStyleAttribute_(b,c,f,"lineHeight",g))&&h.match(k.unitValues_)&&(a.lineHeight=h);(h=k.getStyleAttribute_(b,
2898
+ c,f,"fontSize",g))&&(h.match(k.unitValues_)||h.match(k.percentValue_))&&(a.fontSize=h);if(h=k.getStyleAttribute_(b,c,f,"fontStyle",g))goog.asserts.assert(h.toUpperCase()in m.fontStyle,h.toUpperCase()+" Should be in Cue.fontStyle values!"),a.fontStyle=m.fontStyle[h.toUpperCase()];d?(e=d.attributes.imageType||d.attributes.imagetype,m=d.attributes.encoding,d=l.getTextContents(d).trim(),"PNG"==e&&"Base64"==m&&d&&(a.backgroundImage="data:image/png;base64,"+d)):e&&(a.backgroundImage=e);if(d=k.getStyleAttribute_(b,
2899
+ c,f,"textOutline",g))d=d.split(" "),d[0].match(k.unitValues_)?a.textStrokeColor=a.color:(a.textStrokeColor=k.convertTTMLrgbaToHTMLrgba_(d[0]),d.shift()),d[0]&&d[0].match(k.unitValues_)?a.textStrokeWidth=d[0]:a.textStrokeColor="";(d=k.getStyleAttribute_(b,c,f,"letterSpacing",g))&&d.match(k.unitValues_)&&(a.letterSpacing=d);(d=k.getStyleAttribute_(b,c,f,"linePadding",g))&&d.match(k.unitValues_)&&(a.linePadding=d);if(d=k.getStyleAttribute_(b,c,f,"opacity",g))a.opacity=parseFloat(d);(d=k.getStyleAttributeFromRegion_(c,
2900
+ f,"textDecoration"))&&k.addTextDecoration_(a,d);(d=k.getStyleAttributeFromElement_(b,f,"textDecoration"))&&k.addTextDecoration_(a,d);if(d=k.getStyleAttribute_(b,c,f,"textCombine",g))a.textCombineUpright=d;switch(k.getStyleAttribute_(b,c,f,"ruby",g)){case "container":a.rubyTag="ruby";break;case "text":a.rubyTag="rt"}};
2898
2901
  shaka.text.TtmlTextParser.addTextDecoration_=function(a,b){var c=shaka.text.Cue;b=$jscomp.makeIterator(b.split(" "));for(var d=b.next();!d.done;d=b.next())switch(d.value){case "underline":a.textDecoration.includes(c.textDecoration.UNDERLINE)||a.textDecoration.push(c.textDecoration.UNDERLINE);break;case "noUnderline":a.textDecoration.includes(c.textDecoration.UNDERLINE)&&shaka.util.ArrayUtils.remove(a.textDecoration,c.textDecoration.UNDERLINE);break;case "lineThrough":a.textDecoration.includes(c.textDecoration.LINE_THROUGH)||
2899
2902
  a.textDecoration.push(c.textDecoration.LINE_THROUGH);break;case "noLineThrough":a.textDecoration.includes(c.textDecoration.LINE_THROUGH)&&shaka.util.ArrayUtils.remove(a.textDecoration,c.textDecoration.LINE_THROUGH);break;case "overline":a.textDecoration.includes(c.textDecoration.OVERLINE)||a.textDecoration.push(c.textDecoration.OVERLINE);break;case "noOverline":a.textDecoration.includes(c.textDecoration.OVERLINE)&&shaka.util.ArrayUtils.remove(a.textDecoration,c.textDecoration.OVERLINE)}};
2900
2903
  shaka.text.TtmlTextParser.getStyleAttribute_=function(a,b,c,d,e){e=void 0===e?!0:e;var f=shaka.text.TtmlTextParser;return(a=f.getStyleAttributeFromElement_(a,c,d))?a:e?f.getStyleAttributeFromRegion_(b,c,d):null};shaka.text.TtmlTextParser.getStyleAttributeFromRegion_=function(a,b,c){if(!a)return null;var d=shaka.util.TXml.getAttributeNSList(a,shaka.text.TtmlTextParser.styleNs_,c);return d?d:shaka.text.TtmlTextParser.getInheritedStyleAttribute_(a,b,c)};