shaka-player 4.12.0 → 4.12.1

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.
@@ -4002,7 +4002,7 @@ declare namespace shaka.util.Error {
4002
4002
  UNEXPECTED_TEST_REQUEST = 1009.0 ,
4003
4003
  UNSUPPORTED_EXTERNAL_THUMBNAILS_URI = 2017.0 ,
4004
4004
  UNSUPPORTED_SCHEME = 1000.0 ,
4005
- VAST_INVALID_XML = 4001.0 ,
4005
+ VAST_INVALID_XML = 10007.0 ,
4006
4006
  VIDEO_ERROR = 3016.0 ,
4007
4007
  WEBM_CUES_ELEMENT_MISSING = 3007.0 ,
4008
4008
  WEBM_CUE_TIME_ELEMENT_MISSING = 3013.0 ,
@@ -4002,7 +4002,7 @@ declare namespace shaka.util.Error {
4002
4002
  UNEXPECTED_TEST_REQUEST = 1009.0 ,
4003
4003
  UNSUPPORTED_EXTERNAL_THUMBNAILS_URI = 2017.0 ,
4004
4004
  UNSUPPORTED_SCHEME = 1000.0 ,
4005
- VAST_INVALID_XML = 4001.0 ,
4005
+ VAST_INVALID_XML = 10007.0 ,
4006
4006
  VIDEO_ERROR = 3016.0 ,
4007
4007
  WEBM_CUES_ELEMENT_MISSING = 3007.0 ,
4008
4008
  WEBM_CUE_TIME_ELEMENT_MISSING = 3013.0 ,
@@ -400,7 +400,7 @@ shaka.util.Error.Code = {
400
400
  'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004,
401
401
  'MT_AD_MANAGER_NOT_INITIALIZED': 10005,
402
402
  'INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED': 10006,
403
- 'VAST_INVALID_XML': 4001
403
+ 'VAST_INVALID_XML': 10007
404
404
  };
405
405
  /**
406
406
  * A timer allows a single function to be executed at a later time or at
@@ -197,7 +197,7 @@ DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPOR
197
197
  AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,
198
198
  LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,
199
199
  ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,
200
- MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:4001};goog.exportProperty(shaka.util.Error,"Code",shaka.util.Error.Code);shaka.util.Lazy=function(a){this.gen_=a;this.value_=void 0};shaka.util.Lazy.prototype.value=function(){void 0==this.value_&&(this.value_=this.gen_(),goog.asserts.assert(void 0!=this.value_,"Unable to create lazy value"));return this.value_};shaka.util.Lazy.prototype.reset=function(){this.value_=void 0};shaka.util.DrmUtils=function(){};shaka.util.DrmUtils.isBrowserSupported=function(){return!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration};shaka.util.DrmUtils.areDrmCompatible=function(a,b){return a.length&&b.length&&a!==b?0<shaka.util.DrmUtils.getCommonDrmInfos(a,b).length:!0};
200
+ MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007};goog.exportProperty(shaka.util.Error,"Code",shaka.util.Error.Code);shaka.util.Lazy=function(a){this.gen_=a;this.value_=void 0};shaka.util.Lazy.prototype.value=function(){void 0==this.value_&&(this.value_=this.gen_(),goog.asserts.assert(void 0!=this.value_,"Unable to create lazy value"));return this.value_};shaka.util.Lazy.prototype.reset=function(){this.value_=void 0};shaka.util.DrmUtils=function(){};shaka.util.DrmUtils.isBrowserSupported=function(){return!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration};shaka.util.DrmUtils.areDrmCompatible=function(a,b){return a.length&&b.length&&a!==b?0<shaka.util.DrmUtils.getCommonDrmInfos(a,b).length:!0};
201
201
  shaka.util.DrmUtils.getCommonDrmInfos=function(a,b){if(!a.length)return b;if(!b.length)return a;var c=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.keySystem==f.keySystem){e=new Map;var g=(d.initData||[]).concat(f.initData||[]);g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next())h=h.value,e.set(h.keyId,h);e=Array.from(e.values());g=d.keyIds&&f.keyIds?new Set([].concat($jscomp.arrayFromIterable(d.keyIds),
202
202
  $jscomp.arrayFromIterable(f.keyIds))):d.keyIds||f.keyIds;c.push({keySystem:d.keySystem,licenseServerUri:d.licenseServerUri||f.licenseServerUri,distinctiveIdentifierRequired:d.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,persistentStateRequired:d.persistentStateRequired||f.persistentStateRequired,videoRobustness:d.videoRobustness||f.videoRobustness,audioRobustness:d.audioRobustness||f.audioRobustness,serverCertificate:d.serverCertificate||f.serverCertificate,serverCertificateUri:d.serverCertificateUri||
203
203
  f.serverCertificateUri,initData:e,keyIds:g});break}}return c};shaka.util.DrmUtils.keySystem=function(a){return a?a.keySystem:""};shaka.util.DrmUtils.isPlayReadyKeySystem=function(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1};shaka.util.DrmUtils.isFairPlayKeySystem=function(a){return a?!!a.match(/^com\.apple\.fps/):!1};shaka.util.DrmUtils.generateKeySystemCacheKey_=function(a,b,c){return a+"#"+b+"#"+c};
@@ -354,9 +354,9 @@ a.insert("tr",new Map([["AD_DURATION","Reklam s\u00fcresi"],["AD_PROGRESS","[AD_
354
354
  ["ENTER_LOOP_MODE","\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["ENTER_PICTURE_IN_PICTURE","\u9032\u5165\u5b50\u6bcd\u756b\u9762"],["EXIT_FULL_SCREEN","\u9000\u51fa\u5168\u87a2\u5e55\u6a21\u5f0f"],["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"],
355
355
  ["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"],["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",
356
356
  "\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","\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"]]))};
357
- shaka.ui.Locales.Ids={ON:"ON",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",CHAPTERS:"CHAPTERS",PAUSE:"PAUSE",UNMUTE:"UNMUTE",FULL_SCREEN:"FULL_SCREEN",MUTE:"MUTE",SEEK:"SEEK",FAST_FORWARD:"FAST_FORWARD",STATISTICS:"STATISTICS",AD_DURATION:"AD_DURATION",SUBTITLE_FORCED:"SUBTITLE_FORCED",AD_STATISTICS:"AD_STATISTICS",SKIP_AD:"SKIP_AD",AD_PROGRESS:"AD_PROGRESS",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",BACK:"BACK",MORE_SETTINGS:"MORE_SETTINGS",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",
358
- PLAY:"PLAY",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",RECENTER_VR:"RECENTER_VR",VOLUME:"VOLUME",SKIP_TO_LIVE:"SKIP_TO_LIVE",NOT_APPLICABLE:"NOT_APPLICABLE",PLAYBACK_RATE:"PLAYBACK_RATE",SURROUND:"SURROUND",AIRPLAY:"AIRPLAY",QUALITY:"QUALITY",LANGUAGE:"LANGUAGE",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",REPLAY:"REPLAY",RESOLUTION:"RESOLUTION",AUTO_QUALITY:"AUTO_QUALITY",CAPTIONS:"CAPTIONS",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",LIVE:"LIVE",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",
359
- REWIND:"REWIND",LOOP:"LOOP",DOWNLOAD_VIDEO_FRAME:"DOWNLOAD_VIDEO_FRAME",OFF:"OFF",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",CAST:"CAST",AD_TIME:"AD_TIME"};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)};
357
+ shaka.ui.Locales.Ids={PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",RECENTER_VR:"RECENTER_VR",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",AD_DURATION:"AD_DURATION",AIRPLAY:"AIRPLAY",PAUSE:"PAUSE",AD_TIME:"AD_TIME",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",NOT_APPLICABLE:"NOT_APPLICABLE",REPLAY:"REPLAY",CAPTIONS:"CAPTIONS",PLAY:"PLAY",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",BACK:"BACK",PLAYBACK_RATE:"PLAYBACK_RATE",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",MORE_SETTINGS:"MORE_SETTINGS",AD_STATISTICS:"AD_STATISTICS",
358
+ AUTO_QUALITY:"AUTO_QUALITY",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",CAST:"CAST",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",LIVE:"LIVE",LANGUAGE:"LANGUAGE",RESOLUTION:"RESOLUTION",FAST_FORWARD:"FAST_FORWARD",OFF:"OFF",SURROUND:"SURROUND",UNMUTE:"UNMUTE",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",SKIP_AD:"SKIP_AD",SUBTITLE_FORCED:"SUBTITLE_FORCED",STATISTICS:"STATISTICS",AD_PROGRESS:"AD_PROGRESS",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",MUTE:"MUTE",ON:"ON",CHAPTERS:"CHAPTERS",VOLUME:"VOLUME",
359
+ EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",DOWNLOAD_VIDEO_FRAME:"DOWNLOAD_VIDEO_FRAME",LOOP:"LOOP",SEEK:"SEEK",SKIP_TO_LIVE:"SKIP_TO_LIVE",QUALITY:"QUALITY",FULL_SCREEN:"FULL_SCREEN",REWIND:"REWIND"};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)};
360
360
  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)};
361
361
  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)};
362
362
  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()}};
@@ -576,7 +576,7 @@ shaka.net.NetworkingEngine.prototype.filterRequest_=function(a,b,c){var d=shaka.
576
576
  shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.REQUEST_FILTER_ERROR,h);})};shaka.net.NetworkingEngine.prototype.makeRequestWithRetry_=function(a,b,c,d){var e=new shaka.net.Backoff(b.retryParameters,!1);return this.send_(a,b,c,e,0,null,d)};
577
577
  shaka.net.NetworkingEngine.prototype.send_=function(a,b,c,d,e,f,g){var h=this;this.forceHTTP_&&(b.uris[e]=b.uris[e].replace("https://","http://"));this.forceHTTPS_&&(b.uris[e]=b.uris[e].replace("http://","https://"));if(0<e&&this.onRetry_)this.onRetry_(a,c,b.uris[e],b.uris[e-1]);var k=new goog.Uri(b.uris[e]),l=k.getScheme(),m=!1;l||(l=shaka.net.NetworkingEngine.getLocationProtocol_(),goog.asserts.assert(":"==l[l.length-1],"location.protocol expected to end with a colon!"),l=l.slice(0,-1),k.setScheme(l),
578
578
  b.uris[e]=k.toString());l=l.toLowerCase();var n=(l=shaka.net.NetworkingEngine.schemes_[l])?l.plugin:null;if(!n)return shaka.util.AbortableOperation.failed(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.UNSUPPORTED_SCHEME,k));var p=l.progressSupport,q=null,r=null,t=!1,u=!1,v;return shaka.util.AbortableOperation.notAbortable(d.attempt()).chain(function(){if(h.destroyed_)return shaka.util.AbortableOperation.aborted();v=Date.now();var w=
579
- shaka.net.NetworkingEngine.RequestType.SEGMENT,x=0;b.requestStartTime=Date.now();var y=n(b.uris[e],b,a,function(A,B,D){q&&q.stop();r&&r.tickAfter(C/1E3);if(h.onProgressUpdated_&&a==w){x++;b.packetNumber=x;var H=h.allowSwitch_(c);h.onProgressUpdated_(A,B,H,b);m=!0;g.setBytes(D)}},function(A){if(h.onHeadersReceived_)h.onHeadersReceived_(A,b,a);u=!0;b.timeToFirstByte=Date.now()-b.requestStartTime},{minBytesForProgressEvents:h.minBytesForProgressEvents_});if(!p)return y;var z=b.retryParameters.connectionTimeout;
579
+ shaka.net.NetworkingEngine.RequestType.SEGMENT,x=0;b.requestStartTime=Date.now();var y=n(b.uris[e],b,a,function(A,B,D){q&&q.stop();r&&r.tickAfter(C/1E3);if(h.onProgressUpdated_&&a==w){x++;b.packetNumber=x;var H=h.allowSwitch_(c);h.onProgressUpdated_(A,B,H,b);m=!0;g.setBytes(D)}},function(A){u=!0;b.timeToFirstByte=Date.now()-b.requestStartTime;if(h.onHeadersReceived_)h.onHeadersReceived_(A,b,a)},{minBytesForProgressEvents:h.minBytesForProgressEvents_});if(!p)return y;var z=b.retryParameters.connectionTimeout;
580
580
  z&&(q=new shaka.util.Timer(function(){t=!0;y.abort()}),q.tickAfter(z/1E3));var C=b.retryParameters.stallTimeout;C&&(r=new shaka.util.Timer(function(){t=!0;y.abort()}));return y}).chain(function(w){q&&q.stop();r&&r.stop();void 0==w.timeMs&&(w.timeMs=Date.now()-v);var x={response:w,gotProgress:m};if(!u&&h.onHeadersReceived_)h.onHeadersReceived_(w.headers,b,a);return x},function(w){q&&q.stop();r&&r.stop();if(h.onDownloadFailed_){var x=null,y=0;w instanceof shaka.util.Error&&(x=w,w.code==shaka.util.Error.Code.BAD_HTTP_STATUS&&
581
581
  (y=w.data[1]));h.onDownloadFailed_(b,x,y,t)}if(h.destroyed_)return shaka.util.AbortableOperation.aborted();t&&(w=new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.TIMEOUT,b.uris[e],a));if(w instanceof shaka.util.Error){if(w.code==shaka.util.Error.Code.OPERATION_ABORTED)throw w;if(w.code==shaka.util.Error.Code.ATTEMPTS_EXHAUSTED)throw goog.asserts.assert(f,"Should have last error"),f;if(w.severity==shaka.util.Error.Severity.RECOVERABLE)return x=
582
582
  (new Map).set("error",w),x=new shaka.util.FakeEvent("retry",x),h.dispatchEvent(x),e=(e+1)%b.uris.length,h.send_(a,b,c,d,e,w,g)}throw w;})};
@@ -1279,13 +1279,13 @@ shaka.text.SimpleTextDisplayer.removeWhere_=function(a,b){var c=a.mode,d="showin
1279
1279
  goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"setTextVisibility",shaka.text.SimpleTextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"isTextVisible",shaka.text.SimpleTextDisplayer.prototype.isTextVisible);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"destroy",shaka.text.SimpleTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"append",shaka.text.SimpleTextDisplayer.prototype.append);
1280
1280
  goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"remove",shaka.text.SimpleTextDisplayer.prototype.remove);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"configure",shaka.text.SimpleTextDisplayer.prototype.configure);shaka.text.StubTextDisplayer=function(){};shaka.text.StubTextDisplayer.prototype.configure=function(a){};shaka.text.StubTextDisplayer.prototype.remove=function(a,b){};shaka.text.StubTextDisplayer.prototype.append=function(a){};shaka.text.StubTextDisplayer.prototype.destroy=function(){};shaka.text.StubTextDisplayer.prototype.isTextVisible=function(){return!1};shaka.text.StubTextDisplayer.prototype.setTextVisibility=function(a){};shaka.text.StubTextDisplayer.prototype.setTextLanguage=function(a){};
1281
1281
  goog.exportSymbol("shaka.text.StubTextDisplayer",shaka.text.StubTextDisplayer);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"setTextLanguage",shaka.text.StubTextDisplayer.prototype.setTextLanguage);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"setTextVisibility",shaka.text.StubTextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"isTextVisible",shaka.text.StubTextDisplayer.prototype.isTextVisible);
1282
- goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"destroy",shaka.text.StubTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"append",shaka.text.StubTextDisplayer.prototype.append);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"remove",shaka.text.StubTextDisplayer.prototype.remove);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"configure",shaka.text.StubTextDisplayer.prototype.configure);shaka.text.UITextDisplayer=function(a,b,c){var d=this;goog.asserts.assert(b,"videoContainer should be valid.");this.isTextVisible_=!1;this.cues_=[];this.video_=a;this.videoContainer_=b;this.aspectRatio_=null;this.textContainer_=shaka.util.Dom.createHTMLElement("div");this.textContainer_.classList.add("shaka-text-container");this.textContainer_.style.textAlign="center";this.textContainer_.style.display="flex";this.textContainer_.style.flexDirection="column";this.textContainer_.style.alignItems="center";
1283
- this.textContainer_.style.justifyContent="flex-end";this.videoContainer_.appendChild(this.textContainer_);c&&c.captionsUpdatePeriod||shaka.Deprecate.deprecateFeature(5,"UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config.");a=c&&c.captionsUpdatePeriod?c.captionsUpdatePeriod:.25;this.captionsTimer_=(new shaka.util.Timer(function(){d.video_.paused||d.updateCaptions_()})).tickEvery(a);this.currentCuesMap_=new Map;this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(document,
1284
- "fullscreenchange",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"seeking",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"resize",function(){var e=d.video_,f=e.videoWidth;e=e.videoHeight;d.aspectRatio_=f&&e?f/e:null});this.resizeObserver_=null;"ResizeObserver"in window&&(this.resizeObserver_=new ResizeObserver(function(){d.updateCaptions_(!0)}),this.resizeObserver_.observe(this.textContainer_));this.regionElements_=new Map};
1285
- shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
1282
+ goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"destroy",shaka.text.StubTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"append",shaka.text.StubTextDisplayer.prototype.append);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"remove",shaka.text.StubTextDisplayer.prototype.remove);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"configure",shaka.text.StubTextDisplayer.prototype.configure);shaka.text.UITextDisplayer=function(a,b,c){var d=this;goog.asserts.assert(b,"videoContainer should be valid.");document.fullscreenEnabled||shaka.log.alwaysWarn("Using UITextDisplayer in a browser without Fullscreen API support causes subtitles to not be rendered in fullscreen");this.isTextVisible_=!1;this.cues_=[];this.video_=a;this.videoContainer_=b;this.aspectRatio_=null;this.textContainer_=shaka.util.Dom.createHTMLElement("div");this.textContainer_.classList.add("shaka-text-container");this.textContainer_.style.textAlign=
1283
+ "center";this.textContainer_.style.display="flex";this.textContainer_.style.flexDirection="column";this.textContainer_.style.alignItems="center";this.textContainer_.style.justifyContent="flex-end";this.videoContainer_.appendChild(this.textContainer_);c&&c.captionsUpdatePeriod||shaka.Deprecate.deprecateFeature(5,"UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config.");a=c&&c.captionsUpdatePeriod?c.captionsUpdatePeriod:.25;this.captionsTimer_=(new shaka.util.Timer(function(){d.video_.paused||
1284
+ d.updateCaptions_()})).tickEvery(a);this.currentCuesMap_=new Map;this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(document,"fullscreenchange",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"seeking",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"resize",function(){var e=d.video_,f=e.videoWidth;e=e.videoHeight;d.aspectRatio_=f&&e?f/e:null});this.resizeObserver_=null;"ResizeObserver"in window&&(this.resizeObserver_=new ResizeObserver(function(){d.updateCaptions_(!0)}),
1285
+ this.resizeObserver_.observe(this.textContainer_));this.regionElements_=new Map};shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
1286
1286
  shaka.text.UITextDisplayer.prototype.append=function(a){var b=[].concat($jscomp.arrayFromIterable(this.cues_));a=$jscomp.makeIterator(shaka.text.Utils.removeDuplicates(a));for(var c=a.next(),d={};!c.done;d={cue$jscomp$22:void 0},c=a.next())d.cue$jscomp$22=c.value,b.some(function(e){return function(f){return shaka.text.Cue.equal(f,e.cue$jscomp$22)}}(d))||this.cues_.push(d.cue$jscomp$22);this.updateCaptions_()};
1287
1287
  shaka.text.UITextDisplayer.prototype.destroy=function(){if(!this.textContainer_)return Promise.resolve();this.videoContainer_.removeChild(this.textContainer_);this.textContainer_=null;this.isTextVisible_=!1;this.cues_=[];this.captionsTimer_&&this.captionsTimer_.stop();this.currentCuesMap_.clear();this.eventManager_&&(this.eventManager_.release(),this.eventManager_=null);this.resizeObserver_&&(this.resizeObserver_.disconnect(),this.resizeObserver_=null);return Promise.resolve()};
1288
- shaka.text.UITextDisplayer.prototype.remove=function(a,b){if(!this.textContainer_)return!1;var c=this.cues_.length;this.cues_=this.cues_.filter(function(d){return d.startTime<a||d.endTime>=b});this.updateCaptions_(c>this.cues_.length);return!0};shaka.text.UITextDisplayer.prototype.isTextVisible=function(){return this.isTextVisible_};shaka.text.UITextDisplayer.prototype.setTextVisibility=function(a){this.isTextVisible_=a};
1288
+ shaka.text.UITextDisplayer.prototype.remove=function(a,b){if(!this.textContainer_)return!1;var c=this.cues_.length;this.cues_=this.cues_.filter(function(d){return d.startTime<a||d.endTime>=b});this.updateCaptions_(c>this.cues_.length);return!0};shaka.text.UITextDisplayer.prototype.isTextVisible=function(){return this.isTextVisible_};shaka.text.UITextDisplayer.prototype.setTextVisibility=function(a){this.isTextVisible_=a;this.updateCaptions_(!0)};
1289
1289
  shaka.text.UITextDisplayer.prototype.setTextLanguage=function(a){a&&"und"!=a?this.textContainer_.setAttribute("lang",a):this.textContainer_.setAttribute("lang","")};shaka.text.UITextDisplayer.prototype.isElementUnderTextContainer_=function(a){for(;null!=a;){if(a==this.textContainer_)return!0;a=a.parentElement}return!1};
1290
1290
  shaka.text.UITextDisplayer.prototype.updateCuesRecursive_=function(a,b,c,d){var e=!1,f=[],g=[];a=$jscomp.makeIterator(a);for(var h=a.next();!h.done;h=a.next()){h=h.value;d.push(h);var k=this.currentCuesMap_.get(h),l=h.startTime<=c&&h.endTime>c,m=k?k.wrapper:null;k&&(f.push(k.cueElement),k.regionElement&&f.push(k.regionElement),l||(e=!0,this.currentCuesMap_.delete(h),k=null));l&&(g.push(h),k?this.isElementUnderTextContainer_(m)||(e=!0):(this.createCue_(h,d),k=this.currentCuesMap_.get(h),m=k.wrapper,
1291
1291
  e=!0));0<h.nestedCues.length&&m&&this.updateCuesRecursive_(h.nestedCues,m,c,d);k=d.pop();goog.asserts.assert(k==h,"Parent cues should be kept in order")}if(e){c=$jscomp.makeIterator(f);for(d=c.next();!d.done;d=c.next())d=d.value,d.parentElement&&d.parentElement.removeChild(d);g.sort(function(n,p){return n.startTime!=p.startTime?n.startTime-p.startTime:n.endTime-p.endTime});g=$jscomp.makeIterator(g);for(c=g.next();!c.done;c=g.next())c=this.currentCuesMap_.get(c.value),goog.asserts.assert(c,"cueRegistry should exist."),
@@ -1557,8 +1557,8 @@ shaka.Player.prototype.setMaxHardwareResolution=function(a,b){this.maxHwRes_.wid
1557
1557
  shaka.Player.prototype.getManifest=function(){shaka.log.alwaysWarn("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for.");return this.manifest_};shaka.Player.prototype.getManifestParserFactory=function(){return this.parserFactory_};
1558
1558
  shaka.Player.prototype.getFetchedPlaybackInfo=function(){var a={video:null,audio:null,text:null};if(this.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE)return a;var b=shaka.util.ManifestParserUtils.ContentType,c=this.streamingEngine_.getCurrentVariant(),d=this.streamingEngine_.getCurrentTextStream(),e=this.video_.currentTime;c=$jscomp.makeIterator([c.video,c.audio,d]);for(d=c.next();!d.done;d=c.next())if((d=d.value)&&d.segmentIndex){var f=d.segmentIndex.find(e);f=d.segmentIndex.get(f);f={codecs:f.codecs||
1559
1559
  d.codecs,mimeType:f.mimeType||d.mimeType,bandwidth:f.bandwidth||d.bandwidth};d.type==b.VIDEO?(f.width=d.width,f.height=d.height,a.video=f):d.type==b.AUDIO?a.audio=f:d.type==b.TEXT&&(a.text=f)}return a};shaka.Player.prototype.addVariantToSwitchHistory_=function(a,b){this.stats_.getSwitchHistory().updateCurrentVariant(a,b)};shaka.Player.prototype.addTextStreamToSwitchHistory_=function(a,b){this.stats_.getSwitchHistory().updateCurrentText(a,b)};
1560
- shaka.Player.prototype.defaultConfig_=function(){var a=this,b=shaka.util.PlayerConfiguration.createDefault();b.streaming.failureCallback=function(c){a.defaultStreamingFailureCallback_(c)};b.textDisplayFactory=function(){if(a.videoContainer_){var c=a.getConfiguration();return new shaka.text.UITextDisplayer(a.video_,a.videoContainer_,c.textDisplayer)}if(HTMLMediaElement.prototype.addTextTrack)return new shaka.text.SimpleTextDisplayer(a.video_,shaka.Player.TextTrackLabel);shaka.log.warning("Text tracks are not supported by the browser, disabling.");
1561
- return new shaka.text.StubTextDisplayer};return b};shaka.Player.prototype.setVideoContainer=function(a){this.videoContainer_=a};
1560
+ shaka.Player.prototype.defaultConfig_=function(){var a=this,b=shaka.util.PlayerConfiguration.createDefault();b.streaming.failureCallback=function(c){a.defaultStreamingFailureCallback_(c)};b.textDisplayFactory=function(){var c=shaka.util.Platform;if(!a.videoContainer_||c.safariVersion()&&!document.fullscreenEnabled){if(HTMLMediaElement.prototype.addTextTrack)return new shaka.text.SimpleTextDisplayer(a.video_,shaka.Player.TextTrackLabel);shaka.log.warning("Text tracks are not supported by the browser, disabling.");
1561
+ return new shaka.text.StubTextDisplayer}c=a.getConfiguration();return new shaka.text.UITextDisplayer(a.video_,a.videoContainer_,c.textDisplayer)};return b};shaka.Player.prototype.setVideoContainer=function(a){this.videoContainer_=a};
1562
1562
  shaka.Player.prototype.defaultStreamingFailureCallback_=function(a){if(this.isLive()){var b=null;a.code==shaka.util.Error.Code.BAD_HTTP_STATUS||a.code==shaka.util.Error.Code.HTTP_ERROR?(b=1,this.config_.streaming.lowLatencyMode&&(b=.1)):a.code==shaka.util.Error.Code.TIMEOUT&&(b=.1);null!=b&&(a.severity=shaka.util.Error.Severity.RECOVERABLE,shaka.log.warning("Live streaming error. Retrying automatically..."),this.retryStreaming(b))}};
1563
1563
  shaka.Player.prototype.makeTextStreamsForClosedCaptions_=function(a){for(var b=shaka.util.ManifestParserUtils.ContentType,c=shaka.util.ManifestParserUtils.TextStreamKind,d=shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE,e=shaka.util.MimeUtils.CEA708_CLOSED_CAPTION_MIMETYPE,f=new Set,g=$jscomp.makeIterator(a.textStreams),h=g.next();!h.done;h=g.next())h=h.value,h.mimeType!=d&&h.mimeType!=e||f.add(h.originalId);g=$jscomp.makeIterator(a.variants);for(h=g.next();!h.done;h=g.next())if((h=h.value.video)&&
1564
1564
  h.closedCaptions)for(var k=$jscomp.makeIterator(h.closedCaptions.keys()),l=k.next();!l.done;l=k.next())if(l=l.value,!f.has(l)){var m=l.startsWith("CC")?d:e,n=new shaka.media.MetaSegmentIndex,p=h.closedCaptions.get(l);m={id:this.nextExternalStreamId_++,originalId:l,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:n,mimeType:m,codecs:"",kind:c.CLOSED_CAPTION,encrypted:!1,drmInfos:[],keyIds:new Set,language:p,originalLanguage:p,label:null,type:b.TEXT,primary:!1,trickModeVideo:null,
@@ -1570,9 +1570,9 @@ var c=this.config_.streaming.liveSync.targetLatencyTolerance,d=this.config_.stre
1570
1570
  shaka.Player.prototype.onRateChange_=function(){var a=this.video_.playbackRate;0!=a&&(this.playRateController_&&this.playRateController_.set(a),a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.RateChange),this.dispatchEvent(a))};
1571
1571
  shaka.Player.prototype.updateStateHistory_=function(){if(this.stats_&&this.bufferObserver_){var a=shaka.media.BufferingObserver.State,b=this.stats_.getStateHistory(),c="playing";this.bufferObserver_.getState()==a.STARVING?c="buffering":this.video_.ended?c="ended":this.video_.paused&&(c="paused");b.update(c)&&(a=shaka.util.FakeEvent.EventName.StateChanged,c=(new Map).set("newstate",c),this.dispatchEvent(shaka.Player.makeEvent_(a,c)))}};
1572
1572
  shaka.Player.prototype.onTimeUpdate_=function(){var a=this.video_.playbackRate,b=this.isLive();if(this.config_.streaming.vodDynamicPlaybackRate&&!b){var c=this.config_.streaming.vodDynamicPlaybackRateLowBufferRate,d=this.getBufferFullness(),e=this.config_.streaming.vodDynamicPlaybackRateBufferRatio;d<=e?a!=c&&(shaka.log.debug("Buffer fullness ratio ("+d+") is less than the vodDynamicPlaybackRateBufferRatio ("+e+"). Updating playbackRate to "+c),this.trickPlay(c,!1)):1==d&&a!==this.playRateController_.getDefaultRate()&&
1573
- (shaka.log.debug("Buffer is full. Cancel trick play."),this.cancelTrickPlay())}if(b&&(b=this.seekRange(),Number.isFinite(b.end)&&!(this.video_.currentTime<b.start))){c=this.config_.streaming.liveSync.targetLatencyTolerance;d=this.config_.streaming.liveSync.dynamicTargetLatency.enabled;e=this.config_.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(this.config_.streaming.liveSync&&this.config_.streaming.liveSync.enabled){var f=this.config_.streaming.liveSync.targetLatency;var g=f+c;var h=
1574
- Math.max(0,f-c);var k=this.config_.streaming.liveSync.maxPlaybackRate;var l=this.config_.streaming.liveSync.minPlaybackRate}else this.manifest_&&this.manifest_.serviceDescription&&(f=this.manifest_.serviceDescription.targetLatency,null!=this.manifest_.serviceDescription.targetLatency?g=this.manifest_.serviceDescription.targetLatency+c:null!=this.manifest_.serviceDescription.maxLatency&&(g=this.manifest_.serviceDescription.maxLatency),null!=this.manifest_.serviceDescription.targetLatency?h=Math.max(0,
1575
- this.manifest_.serviceDescription.targetLatency-c):null!=this.manifest_.serviceDescription.minLatency&&(h=this.manifest_.serviceDescription.minLatency),k=this.manifest_.serviceDescription.maxPlaybackRate||this.config_.streaming.liveSync.maxPlaybackRate,l=this.manifest_.serviceDescription.minPlaybackRate||this.config_.streaming.liveSync.minPlaybackRate);this.currentTargetLatency_||"number"!==typeof f||(this.currentTargetLatency_=f);var m=this.config_.streaming.liveSync.dynamicTargetLatency.maxAttempts;
1573
+ (shaka.log.debug("Buffer is full. Cancel trick play."),this.cancelTrickPlay())}if(b&&(b=this.seekRange(),Number.isFinite(b.end)&&!(this.video_.currentTime<b.start||this.video_.paused))){c=this.config_.streaming.liveSync.targetLatencyTolerance;d=this.config_.streaming.liveSync.dynamicTargetLatency.enabled;e=this.config_.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(this.config_.streaming.liveSync&&this.config_.streaming.liveSync.enabled){var f=this.config_.streaming.liveSync.targetLatency;
1574
+ var g=f+c;var h=Math.max(0,f-c);var k=this.config_.streaming.liveSync.maxPlaybackRate;var l=this.config_.streaming.liveSync.minPlaybackRate}else this.manifest_&&this.manifest_.serviceDescription&&(f=this.manifest_.serviceDescription.targetLatency,null!=this.manifest_.serviceDescription.targetLatency?g=this.manifest_.serviceDescription.targetLatency+c:null!=this.manifest_.serviceDescription.maxLatency&&(g=this.manifest_.serviceDescription.maxLatency),null!=this.manifest_.serviceDescription.targetLatency?
1575
+ h=Math.max(0,this.manifest_.serviceDescription.targetLatency-c):null!=this.manifest_.serviceDescription.minLatency&&(h=this.manifest_.serviceDescription.minLatency),k=this.manifest_.serviceDescription.maxPlaybackRate||this.config_.streaming.liveSync.maxPlaybackRate,l=this.manifest_.serviceDescription.minPlaybackRate||this.config_.streaming.liveSync.minPlaybackRate);this.currentTargetLatency_||"number"!==typeof f||(this.currentTargetLatency_=f);var m=this.config_.streaming.liveSync.dynamicTargetLatency.maxAttempts;
1576
1576
  d&&this.targetLatencyReached_&&null!==this.currentTargetLatency_&&"number"===typeof f&&this.rebufferingCount_<m&&Date.now()-this.targetLatencyReached_>1E3*e&&(e=this.config_.streaming.liveSync.dynamicTargetLatency.minLatency,this.currentTargetLatency_=Math.max(this.currentTargetLatency_-(f-e)/2,e+c),this.targetLatencyReached_=Date.now());d&&null!==this.currentTargetLatency_&&(g=this.currentTargetLatency_+c,h=this.currentTargetLatency_-c);f=b.end-this.video_.currentTime;c=0;this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&
1577
1577
  (d=this.video_.buffered,0<d.length&&(c=d.end(d.length-1),c=Math.max(k,c-b.end)));b=this.config_.streaming.liveSync.panicMode;d=1E3*this.config_.streaming.liveSync.panicThreshold;e=Date.now()-this.bufferObserver_.getLastRebufferTime();b&&!l&&(l=this.config_.streaming.liveSync.minPlaybackRate);b&&l&&e<=d?a!=l&&(shaka.log.debug("Time since last rebuffer ("+e+"s) is less than the live sync panicThreshold ("+d+"s). Updating playbackRate to "+l),this.trickPlay(l,!1)):g&&k&&f-c>g?(a!=k&&(shaka.log.debug("Latency ("+
1578
1578
  f+"s) is greater than live sync maxLatency ("+g+"s). Updating playbackRate to "+k),this.trickPlay(k,!1)),this.targetLatencyReached_=null):h&&l&&f-c<h?(a!=l&&(shaka.log.debug("Latency ("+f+"s) is smaller than live sync minLatency ("+h+"s). Updating playbackRate to "+l),this.trickPlay(l,!1)),this.targetLatencyReached_=null):a!==this.playRateController_.getDefaultRate()&&(this.cancelTrickPlay(),this.targetLatencyReached_=Date.now())}};
@@ -1634,7 +1634,7 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
1634
1634
  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);
1635
1635
  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);
1636
1636
  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);
1637
- 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.12.0-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
1637
+ 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.12.1-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
1638
1638
  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_++};
1639
1639
  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};
1640
1640
  shaka.ads.ClientSideAd.prototype.isClientRendering=function(){return!0};shaka.ads.ClientSideAd.prototype.isUsingAnotherMediaElement=function(){return!0};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_};
@@ -1710,22 +1710,22 @@ shaka.ads.InterstitialAdManager.prototype.determineIfUsingBaseVideo_=function(){
1710
1710
  this.video_=this.adVideo_))}};shaka.ads.InterstitialAdManager.prototype.stop=function(){this.adEventManager_&&this.adEventManager_.removeAll();this.interstitialIds_.clear();this.interstitials_.clear();this.player_.destroyAllPreloads();this.preloadManagerInterstitials_.clear();this.player_.detach();this.playingAd_=!1;this.lastPlayedAd_=this.lastTime_=null};
1711
1711
  shaka.ads.InterstitialAdManager.prototype.release=function(){this.stop();this.eventManager_&&this.eventManager_.release();this.adEventManager_&&this.adEventManager_.release();this.adContainer_&&shaka.util.Dom.removeAllChildren(this.adContainer_);this.timeUpdateTimer_&&(this.timeUpdateTimer_.stop(),this.timeUpdateTimer_=null);this.pollTimer_&&(this.pollTimer_.stop(),this.pollTimer_=null);this.player_.destroy()};
1712
1712
  shaka.ads.InterstitialAdManager.prototype.addMetadata=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return b.updatePlayerConfig_(),d.yield(b.getInterstitialsInfo_(a),2);c=d.yieldResult;c.length?b.addInterstitials(c):shaka.log.alwaysWarn("Unsupported HLS interstitial",a);d.jumpToEnd()})};
1713
- shaka.ads.InterstitialAdManager.prototype.addRegion=function(a){for(var b,c,d=$jscomp.makeIterator(a.eventNode.children),e=d.next();!e.done;e=d.next()){var f=e.value;if("AlternativeMPD"==f.tagName&&(e=f.attributes.uri,f=f.attributes.mode,e)){b=e;c=f;break}}b?(d="replace"==c,c="insert"==c,d||c?this.addInterstitials([{id:null,startTime:a.startTime,endTime:d?a.endTime:null,uri:b,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:c?0:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:d&&
1713
+ shaka.ads.InterstitialAdManager.prototype.addRegion=function(a){for(var b,c,d=$jscomp.makeIterator(a.eventNode.children),e=d.next();!e.done;e=d.next()){var f=e.value;if("AlternativeMPD"==f.tagName&&(e=f.attributes.uri,f=f.attributes.mode,e)){b=e;c=f;break}}b?(d="replace"==c,c="insert"==c,d||c?this.addInterstitials([{id:null,startTime:a.startTime,endTime:a.endTime,uri:b,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:c?0:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:d&&
1714
1714
  !c}]):shaka.log.warning("Unsupported MPD alternate",a)):shaka.log.alwaysWarn("Unsupported MPD alternate",a)};
1715
1715
  shaka.ads.InterstitialAdManager.prototype.addAdUrlInterstitial=function(a){var b=this,c,d,e,f,g,h,k,l,m,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){switch(p.nextAddress){case 1:return c=shaka.net.NetworkingEngine,d={type:c.AdvancedRequestType.INTERSTITIAL_AD_URL},p.yield(b.makeAdRequest_(a,d),2);case 2:e=p.yieldResult;f=shaka.util.TXml.parseXml(e,"VAST,vmap:VMAP");if(!f)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.ADS,shaka.util.Error.Code.VAST_INVALID_XML);
1716
1716
  g=[];if("VAST"==f.tagName){g=shaka.ads.Utils.parseVastToInterstitials(f,b.lastTime_);p.jumpTo(3);break}if("vmap:VMAP"!=f.tagName){p.jumpTo(3);break}h=$jscomp.makeIterator(shaka.ads.Utils.parseVMAP(f));k=h.next();case 5:if(k.done){p.jumpTo(3);break}l=k.value;return p.yield(b.makeAdRequest_(l.uri,d),8);case 8:m=p.yieldResult;n=shaka.util.TXml.parseXml(m,"VAST");if(!n)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.ADS,shaka.util.Error.Code.VAST_INVALID_XML);g.push.apply(g,
1717
1717
  $jscomp.arrayFromIterable(shaka.ads.Utils.parseVastToInterstitials(n,l.time)));k=h.next();p.jumpTo(5);break;case 3:b.addInterstitials(g),p.jumpToEnd()}})};
1718
1718
  shaka.ads.InterstitialAdManager.prototype.addInterstitials=function(a){var b=!1;a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=c.id||JSON.stringify(c);if(!this.interstitialIds_.has(d)){b=!0;this.interstitialIds_.add(d);this.interstitials_.add(c);d=!1;if(c.pre&&null==this.lastTime_)d=!0;else if(0==c.startTime&&!c.canJump)d=!0;else if(null!=this.lastTime_){var e=c.startTime-this.lastTime_;0<e&&10>=e&&(d=!0)}d&&(this.preloadManagerInterstitials_.has(c)||this.preloadManagerInterstitials_.set(c,
1719
1719
  this.player_.preload(c.uri)))}}b&&this.cuepointsChanged_()};shaka.ads.InterstitialAdManager.prototype.createMediaElement_=function(){var a=document.createElement(this.baseVideo_.tagName);a.autoplay=!0;a.style.position="absolute";a.style.top="0";a.style.left="0";a.style.width="100%";a.style.height="100%";a.style.backgroundColor="rgb(0, 0, 0)";a.setAttribute("playsinline","");return a};
1720
- shaka.ads.InterstitialAdManager.prototype.getCurrentInterstitial_=function(a,b,c){var d=0,e=null;if(this.interstitials_.size&&null!=this.lastTime_){var f=this.baseVideo_.ended,g=Array.from(this.interstitials_).sort(function(m,n){return n.startTime-m.startTime});g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=!1;if(a)k=h.pre;else if(f)k=h.post;else if(!h.pre&&!h.post){var l=this.lastTime_-Math.round(1E3*h.startTime)/1E3;0<l&&(1>=l||!h.canJump)&&(k=1<l&&c&&!c.pre&&!c.post&&
1720
+ shaka.ads.InterstitialAdManager.prototype.getCurrentInterstitial_=function(a,b,c){var d=0,e=null;if(this.interstitials_.size&&null!=this.lastTime_){var f=this.baseVideo_.ended,g=Array.from(this.interstitials_).sort(function(m,n){return n.startTime-m.startTime});g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=!1;if(a)k=h.pre;else if(f)k=h.post;else if(!h.pre&&!h.post){var l=this.lastTime_-Math.round(1E3*h.startTime)/1E3;0<l&&(1>=l||!h.canJump)&&(k=c&&!c.pre&&!c.post&&
1721
1721
  c.startTime>=h.startTime?!1:!0)}if(k){if(d==b){e=h;break}d++}}}return e};
1722
1722
  shaka.ads.InterstitialAdManager.prototype.setupAd_=function(a,b,c,d,e){e=void 0===e?0:e;var f=this,g,h,k,l,m,n,p,q,r,t,u,v,w,x,y,z,C;return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){switch(A.nextAddress){case 1:f.determineIfUsingBaseVideo_();goog.asserts.assert(f.video_,"Must have video");f.lastPlayedAd_=a;shaka.log.info("Starting interstitial",a.startTime,"at",f.lastTime_);g=Date.now();!f.video_.parentElement&&f.adContainer_&&f.adContainer_.appendChild(f.video_);1==c&&1==b&&(b=Array.from(f.interstitials_).filter(function(B){return a.pre?
1723
1723
  B.pre==a.pre:a.post?B.post==a.post:.001>Math.abs(B.startTime-a.startTime)}).length);if(a.once||a.pre)e++,f.interstitials_.delete(a),f.cuepointsChanged_();f.playingAd_=!0;if(!f.usingBaseVideo_||1!=c){A.jumpTo(2);break}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_PAUSE_REQUESTED,(new Map).set("saveLivePosition",!0)));h=new shaka.util.PublicPromise;k=function(B){return $jscomp.asyncExecutePromiseGeneratorProgram(function(D){if(1==D.nextAddress)return"detach"!=B.state?D.jumpTo(0):shaka.util.Platform.isSmartTV()?
1724
1724
  D.yield(new Promise(function(H){return(new shaka.util.Timer(H)).tickAfter(.1)}),3):D.jumpTo(3);h.resolve();f.adEventManager_.unlisten(f.basePlayer_,"onstatechange",k);D.jumpToEnd()})};f.adEventManager_.listen(f.basePlayer_,"onstatechange",k);return A.yield(h,2);case 2:f.usingBaseVideo_||(f.baseVideo_.pause(),null!=a.resumeOffset&&0!=a.resumeOffset&&(f.baseVideo_.currentTime+=a.resumeOffset));l=!1;m=null;n=function(){if(!f.usingBaseVideo_&&null==a.resumeOffset)if(a.timelineRange&&a.endTime&&Infinity!=
1725
1725
  a.endTime)f.baseVideo_.currentTime!=a.endTime&&(f.baseVideo_.currentTime=a.endTime);else{var B=Date.now();f.baseVideo_.currentTime+=(B-d)/1E3;d=B}};p=function(){var B,D;return $jscomp.asyncExecutePromiseGeneratorProgram(function(H){if(1==H.nextAddress)return n(),m&&m.stop(),goog.asserts.assert("number"==typeof e,"Should be an number!"),(B=f.getCurrentInterstitial_(a.pre,c-e))?(f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED)),f.adEventManager_.removeAll(),f.setupAd_(B,b,++c,d,e),H.jumpTo(0)):
1726
- f.usingBaseVideo_?H.yield(f.player_.detach(),4):H.yield(f.player_.unload(),4);f.usingBaseVideo_&&(D=a.resumeOffset,null==D&&(D=a.timelineRange&&a.endTime&&Infinity!=a.endTime?a.endTime-(f.lastTime_||0):(Date.now()-d)/1E3),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED,(new Map).set("offset",D))));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));f.adEventManager_.removeAll();f.playingAd_=!1;f.usingBaseVideo_||(n(),f.baseVideo_.ended||f.baseVideo_.play());
1727
- f.determineIfUsingBaseVideo_();H.jumpToEnd()})};q=function(B){return $jscomp.asyncExecutePromiseGeneratorProgram(function(D){if(l)return D.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_ERROR,(new Map).set("originalEvent",B)));return D.yield(p(),0)})};r=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(1==B.nextAddress){if(l)return B.return();l=!0;return B.yield(p(),2)}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_COMPLETE));B.jumpToEnd()})};
1728
- t=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(l)return B.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIPPED));return B.yield(p(),0)})};u=new shaka.ads.InterstitialAd(f.video_,a.isSkippable,a.skipOffset,a.skipFor,t,b,c,!f.usingBaseVideo_);f.usingBaseVideo_||(u.setMuted(f.baseVideo_.muted),u.setVolume(f.baseVideo_.volume));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STARTED,(new Map).set("ad",u)));if(v=u.canSkipNow())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));
1726
+ f.usingBaseVideo_?H.yield(f.player_.detach(),4):H.yield(f.player_.unload(),4);f.usingBaseVideo_&&(D=a.resumeOffset,null==D&&(D=a.timelineRange&&a.endTime&&Infinity!=a.endTime?a.endTime-(f.lastTime_||0):(Date.now()-d)/1E3),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED,(new Map).set("offset",D))));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));f.adEventManager_.removeAll();f.playingAd_=!1;f.usingBaseVideo_?f.cuepointsChanged_():(n(),f.baseVideo_.ended||
1727
+ f.baseVideo_.play());f.determineIfUsingBaseVideo_();H.jumpToEnd()})};q=function(B){return $jscomp.asyncExecutePromiseGeneratorProgram(function(D){if(l)return D.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_ERROR,(new Map).set("originalEvent",B)));return D.yield(p(),0)})};r=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(1==B.nextAddress){if(l)return B.return();l=!0;return B.yield(p(),2)}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_COMPLETE));
1728
+ B.jumpToEnd()})};t=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(l)return B.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIPPED));return B.yield(p(),0)})};u=new shaka.ads.InterstitialAd(f.video_,a.isSkippable,a.skipOffset,a.skipFor,t,b,c,!f.usingBaseVideo_);f.usingBaseVideo_||(u.setMuted(f.baseVideo_.muted),u.setVolume(f.baseVideo_.volume));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STARTED,(new Map).set("ad",u)));if(v=u.canSkipNow())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));
1729
1729
  w=new Set;f.adEventManager_.listenOnce(f.player_,"error",q);f.adEventManager_.listen(f.video_,"timeupdate",function(){var B=f.video_.duration;if(B){var D=u.canSkipNow();if(v!=D&&0<u.getRemainingTime()&&0<u.getDuration())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));v=D;B=100*f.video_.currentTime/B;25<=B&&!w.has("firstquartile")?(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_FIRST_QUARTILE)),w.add("firstquartile")):50<=B&&!w.has("midpoint")?(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MIDPOINT)),
1730
1730
  w.add("midpoint")):75<=B&&!w.has("thirdquartile")&&(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_THIRD_QUARTILE)),w.add("thirdquartile"))}});f.adEventManager_.listenOnce(f.player_,"complete",r);f.adEventManager_.listen(f.video_,"play",function(){f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_RESUMED))});f.adEventManager_.listen(f.video_,"pause",function(){var B=f.player_.getConfiguration();if(f.video_.currentTime>=B.playRangeEnd)r();else f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_PAUSED))});
1731
1731
  f.adEventManager_.listen(f.video_,"volumechange",function(){if(f.video_.muted)f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MUTED));else f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_VOLUME_CHANGED))});A.setCatchFinallyBlocks(4);f.updatePlayerConfig_();a.startTime&&a.endTime&&Infinity!=a.endTime&&a.startTime!=a.endTime&&(x=a.endTime-a.startTime,0<x&&f.player_.configure("playRangeEnd",x));a.playoutLimit&&(m=(new shaka.util.Timer(function(){u.skip()})).tickAfter(a.playoutLimit),f.player_.configure("playRangeEnd",
@@ -2258,12 +2258,12 @@ d.parseAttr(a,"publishTime",d.parseDate)||0;c.patchLocationNodes_=d.findChildren
2258
2258
  c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(v),w=d.getContents(u))(x=d.parseAttr(u,"queryBeforeStart",d.parseBoolean,!1))?t=c.contentSteeringManager_.requestInfo(w):c.contentSteeringManager_.requestInfo(w);y=$jscomp.makeIterator(g.keys());for(z=y.next();!z.done;z=y.next())C=z.value,A=g.get(C),c.contentSteeringManager_.addLocation("Location",C,A)}B=d.findChildren(a,"BaseURL");D=!1;if(c.contentSteeringManager_)for(H=$jscomp.makeIterator(B),G=H.next();!G.done;G=
2259
2259
  H.next())E=G.value,F=E.attributes.serviceLocation,I=d.getContents(E),F&&I&&(c.contentSteeringManager_.addLocation("BaseURL",F,I),D=!0);c.lastCalculatedBaseUris_=null;D&&c.contentSteeringManager_||(K=B.map(d.getContents),c.lastCalculatedBaseUris_=shaka.util.ManifestParserUtils.resolveUris(e,K));J=function(){return c.contentSteeringManager_&&D?c.contentSteeringManager_.getLocations("BaseURL"):c.lastCalculatedBaseUris_?c.lastCalculatedBaseUris_:[]};c.manifestPatchContext_.getBaseUris=J;M=0;B&&B.length&&
2260
2260
  (M=d.parseAttr(B[0],"availabilityTimeOffset",d.parseFloat)||0);c.manifestPatchContext_.availabilityTimeOffset=M;L=c.config_.dash.ignoreMinBufferTime;O=0;L||(O=d.parseAttr(a,"minBufferTime",d.parseDuration)||0);c.updatePeriod_=d.parseAttr(a,"minimumUpdatePeriod",d.parseDuration,-1);Q=d.parseAttr(a,"availabilityStartTime",d.parseDate);N=d.parseAttr(a,"timeShiftBufferDepth",d.parseDuration);T=c.config_.dash.ignoreSuggestedPresentationDelay;R=null;T||(R=d.parseAttr(a,"suggestedPresentationDelay",d.parseDuration));
2261
- S=c.config_.dash.ignoreMaxSegmentDuration;V=null;S||(V=d.parseAttr(a,"maxSegmentDuration",d.parseDuration));U=a.attributes.type||"static";c.manifest_&&c.manifest_.presentationTimeline&&(c.isTransitionFromDynamicToStatic_=c.manifest_.presentationTimeline.isLive()&&"static"==U);c.manifestPatchContext_.type=U;c.cleanStreamMap_();if(c.manifest_)for(P=c.manifest_.presentationTimeline,X=$jscomp.makeIterator(Object.values(c.streamMap_)),Z=X.next();!Z.done;Z=X.next())W=Z.value,W.segmentIndex&&W.segmentIndex.evict(P.getSegmentAvailabilityStart());
2261
+ S=c.config_.dash.ignoreMaxSegmentDuration;V=null;S||(V=d.parseAttr(a,"maxSegmentDuration",d.parseDuration));U=a.attributes.type||"static";c.manifest_&&c.manifest_.presentationTimeline&&(c.isTransitionFromDynamicToStatic_=c.manifest_.presentationTimeline.isLive()&&"static"==U);c.manifestPatchContext_.type=U;if(c.manifest_)for(P=c.manifest_.presentationTimeline,X=$jscomp.makeIterator(Object.values(c.streamMap_)),Z=X.next();!Z.done;Z=X.next())W=Z.value,W.segmentIndex&&W.segmentIndex.evict(P.getSegmentAvailabilityStart());
2262
2262
  else Y=c.config_.defaultPresentationDelay||1.5*O,ca=null!=R?R:Y,P=new shaka.media.PresentationTimeline(Q,ca,c.config_.dash.autoCorrectDrift);P.setStatic("static"==U);(aa=P.isLive())&&!isNaN(c.config_.availabilityWindowOverride)&&(N=c.config_.availabilityWindowOverride);null==N&&(N=Infinity);P.setSegmentAvailabilityDuration(N);da=a.attributes.profiles||"";c.manifestPatchContext_.profiles=da.split(",");ha={dynamic:"static"!=U,presentationTimeline:P,period:null,periodInfo:null,adaptationSet:null,representation:null,
2263
2263
  bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:M,mediaPresentationDuration:null,profiles:da.split(","),roles:null,urlParams:function(){return""}};c.gapCount_=0;fa=c.parsePeriods_(ha,J,a,!1);ia=fa.duration;ea=fa.periods;("static"!=U||c.isTransitionFromDynamicToStatic_)&&fa.durationDerivedFromPeriods||P.setDuration(ia||Infinity);c.isLowLatency_&&!c.lowLatencyMode_&&(na=c.playerInterface_.isAutoLowLatencyMode())&&(c.playerInterface_.enableLowLatencyMode(),c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());
2264
2264
  c.lowLatencyMode_&&P.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_);P.notifyMaxSegmentDuration(V||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&P.assertIsValid();return ba.yield(t,2);case 2:c.lowLatencyMode_&&(O=0,ja=null!=R?R:c.config_.defaultPresentationDelay,P.setDelay(ja));if(!c.manifest_)return ba.yield(c.periodCombiner_.combinePeriods(ea,ha.dynamic),6);c.manifest_.periodCount=ea.length;c.manifest_.gapCount=c.gapCount_;return ba.yield(c.postPeriodProcessing_(ea,!1),4);case 6:c.manifest_=
2265
2265
  {presentationTimeline:P,variants:c.periodCombiner_.getVariants(),textStreams:c.periodCombiner_.getTextStreams(),imageStreams:c.periodCombiner_.getImageStreams(),offlineSessionIds:[],minBufferTime:O||0,sequenceMode:c.config_.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:shaka.media.ManifestParser.DASH,serviceDescription:c.parseServiceDescription_(a),nextUrl:c.parseMpdChaining_(a),periodCount:ea.length,gapCount:c.gapCount_,isLowLatency:c.isLowLatency_,startTime:null};if(!P.usingPresentationStartTime()){ba.jumpTo(7);
2266
- break}ka=shaka.util.TXml;la=ka.findChildren(a,"UTCTiming");return ba.yield(c.parseUtcTiming_(J,la),8);case 8:ma=ba.yieldResult;if(!c.playerInterface_)return ba.return();P.setClockOffset(ma);case 7:P.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),ba.jumpToEnd()}})};
2266
+ break}ka=shaka.util.TXml;la=ka.findChildren(a,"UTCTiming");return ba.yield(c.parseUtcTiming_(J,la),8);case 8:ma=ba.yieldResult;if(!c.playerInterface_)return ba.return();P.setClockOffset(ma);case 7:P.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),c.cleanStreamMap_(),ba.jumpToEnd()}})};
2267
2267
  shaka.dash.DashParser.prototype.postPeriodProcessing_=function(a,b){var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress)return e.yield(c.periodCombiner_.combinePeriods(a,!0,b),2);c.manifest_.variants=c.periodCombiner_.getVariants();d=c.periodCombiner_.getTextStreams();0<d.length&&(c.manifest_.textStreams=d);c.manifest_.imageStreams=c.periodCombiner_.getImageStreams();c.playerInterface_.filter(c.manifest_);e.jumpToEnd()})};
2268
2268
  shaka.dash.DashParser.prototype.processPatchManifest_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,y,z,C,A,B,D,H,G,E,F,I;return $jscomp.asyncExecutePromiseGeneratorProgram(function(K){if(1==K.nextAddress){c=shaka.util.TXml;d=a.attributes.mpdId;e=c.parseAttr(a,"originalPublishTime",c.parseDate);if(!d||d!==b.manifestPatchContext_.mpdId||e!==b.manifestPatchContext_.publishTime)throw b.patchLocationNodes_=[],new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.MANIFEST,
2269
2269
  shaka.util.Error.Code.DASH_INVALID_PATCH);f=[];g=[];h=new Set;k=$jscomp.makeIterator(c.getChildNodes(a));for(l=k.next();!l.done;l=k.next()){m=l.value;n=!0;p=c.parseXpath(m.attributes.sel||"");q=p[p.length-1];r=c.getContents(m)||"";if("MPD"===q.name)"mediaPresentationDuration"===q.attribute?(t=c.getContents(m)||"",b.parsePatchMediaPresentationDurationChange_(t)):"type"===q.attribute?b.parsePatchMpdTypeChange_(r):"publishTime"===q.attribute?b.manifestPatchContext_.publishTime=c.parseDate(r)||0:null===
@@ -2287,7 +2287,8 @@ shaka.dash.DashParser.prototype.parsePeriods_=function(a,b,c,d){var e=shaka.util
2287
2287
  !this.lastManifestUpdatePeriodIds_.includes(q)&&l+1!=c.length)shaka.log.debug("Skipping Period with ID "+q+" as its start time is smaller than the largest period start time that has been seen, and ID is unseen before");else{null!==p&&(null===this.largestPeriodStartTime_||p>this.largestPeriodStartTime_)&&(this.largestPeriodStartTime_=p);k=this.parsePeriod_(a,b,{start:p,duration:t,node:m,isLastPeriod:null==t||!n});h.push(k);a.period.id&&t&&(this.periodDurations_[a.period.id]=t);if(null==t){n&&shaka.log.warning("Skipping Period",
2288
2288
  l+1,"and any subsequent Periods:","Period",l+1,"does not have a valid start time.",n);k=null;break}k=p+t}}if(d)for(a=$jscomp.makeIterator(h),b=a.next();!b.done;b=a.next())b=b.value.id,this.lastManifestUpdatePeriodIds_.includes(b)||this.lastManifestUpdatePeriodIds_.push(b);else this.lastManifestUpdatePeriodIds_=h.map(function(v){return v.id});return null!=f?(null!=k&&Math.abs(k-g-f)>shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS&&shaka.log.warning("@mediaPresentationDuration does not match the total duration ",
2289
2289
  "of all Periods."),{periods:h,duration:f+g,durationDerivedFromPeriods:!1}):{periods:h,duration:k,durationDerivedFromPeriods:!0}};
2290
- shaka.dash.DashParser.prototype.cleanStreamMap_=function(){var a=this,b=Object.keys(this.indexStreamMap_).filter(function(f){return!a.lastManifestUpdatePeriodIds_.includes(f)});b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=$jscomp.makeIterator(this.indexStreamMap_[c]),e=d.next();!e.done;e=d.next())e=e.value,this.periodCombiner_&&this.periodCombiner_.deleteStream(this.streamMap_[e],c),delete this.streamMap_[e];delete this.indexStreamMap_[c]}};
2290
+ shaka.dash.DashParser.prototype.cleanStreamMap_=function(){var a=this,b=Object.keys(this.indexStreamMap_).filter(function(h){return!a.lastManifestUpdatePeriodIds_.includes(h)});b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=!0,e=$jscomp.makeIterator(this.indexStreamMap_[c]),f=e.next();!f.done;f=e.next()){f=f.value;var g=this.streamMap_[f];g.segmentIndex&&!g.segmentIndex.isEmpty()?d=!1:(this.periodCombiner_&&this.periodCombiner_.deleteStream(this.streamMap_[f],
2291
+ c),delete this.streamMap_[f])}d&&delete this.indexStreamMap_[c]}};
2291
2292
  shaka.dash.DashParser.prototype.parsePeriod_=function(a,b,c){var d=this,e=shaka.util.Functional,f=shaka.util.TXml,g=shaka.util.ManifestParserUtils.ContentType;goog.asserts.assert(c.node,"periodInfo.node should exist");a.period=this.createFrame_(c.node,null,b);a.periodInfo=c;a.period.availabilityTimeOffset=a.availabilityTimeOffset;a.period.id||(shaka.log.info("No Period ID given for Period with start time "+c.start+", Assigning a default"),a.period.id="__shaka_period_"+c.start);var h=f.findChildren(c.node,
2292
2293
  "EventStream");b=a.presentationTimeline.getSegmentAvailabilityStart();h=$jscomp.makeIterator(h);for(var k=h.next();!k.done;k=h.next())this.parseEventStream_(c.start,c.duration,k.value,b);b=f.findChildren(c.node,"SupplementalProperty");b=$jscomp.makeIterator(b);for(h=b.next();!h.done;h=b.next())if(h=h.value,"urn:mpeg:dash:urlparam:2014"==h.attributes.schemeIdUri&&(h=this.getURLParametersFunction_(h)))a.urlParams=h;e=f.findChildren(c.node,"AdaptationSet").map(function(m,n){return d.parseAdaptationSet_(a,
2293
2294
  n,m)}).filter(e.isNotNull);if(a.dynamic){c=[];f=$jscomp.makeIterator(e);for(b=f.next();!b.done;b=f.next())for(b=$jscomp.makeIterator(b.value.representationIds),h=b.next();!h.done;h=b.next())c.push(h.value);f=new Set(c);if(c.length!=f.size)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);}c=e.filter(function(m){return!m.trickModeFor});e=e.filter(function(m){return m.trickModeFor});if(!this.config_.disableIFrames)for(e=
@@ -3544,8 +3545,8 @@ this.eventManager.listen(this.player,"loaded",function(){c.updatePlaybackRateSel
3544
3545
  $jscomp.inherits(shaka.ui.PlaybackRateSelection,shaka.ui.SettingsMenu);shaka.ui.PlaybackRateSelection.prototype.updateLocalizedStrings_=function(){var a=shaka.ui.Locales.Ids;this.backButton.ariaLabel=this.localization.resolve(a.BACK);this.button.ariaLabel=this.localization.resolve(a.PLAYBACK_RATE);this.nameSpan.textContent=this.localization.resolve(a.PLAYBACK_RATE);this.backSpan.textContent=this.localization.resolve(a.PLAYBACK_RATE)};
3545
3546
  shaka.ui.PlaybackRateSelection.prototype.updatePlaybackRateSelection_=function(a){var b=this,c=shaka.ui.Utils.getDescendantIfExists(this.menu,"material-icons-round shaka-chosen-item");if(c){var d=c.parentElement;d.removeAttribute("aria-selected");d.getElementsByTagName("span")[0].classList.remove("shaka-chosen-item");d.removeChild(c)}if(c=Array.from(this.menu.querySelectorAll("span")).find(function(e){return b.playbackRates_.get(e.textContent)==a}))d=c.parentElement,d.appendChild(shaka.ui.Utils.checkmarkIcon()),
3546
3547
  d.ariaSelected="true",c.classList.add("shaka-chosen-item");this.currentSelection.textContent=a+"x";this.button.setAttribute("shaka-status",a+"x")};
3547
- shaka.ui.PlaybackRateSelection.prototype.addPlaybackRates_=function(){for(var a=this,b=$jscomp.makeIterator(this.playbackRates_.keys()),c=b.next(),d={};!c.done;d={rateStr:void 0},c=b.next()){d.rateStr=c.value;c=shaka.util.Dom.createButton();var e=shaka.util.Dom.createHTMLElement("span");e.textContent=d.rateStr;c.appendChild(e);this.eventManager.listen(c,"click",function(f){return function(){a.video.playbackRate=a.playbackRates_.get(f.rateStr);a.video.defaultPlaybackRate=a.playbackRates_.get(f.rateStr)}}(d));
3548
- this.menu.appendChild(c)}shaka.ui.Utils.focusOnTheChosenItem(this.menu)};goog.exportSymbol("shaka.ui.PlaybackRateSelection",shaka.ui.PlaybackRateSelection);shaka.ui.PlaybackRateSelection.Factory=function(){};shaka.ui.PlaybackRateSelection.Factory.prototype.create=function(a,b){return new shaka.ui.PlaybackRateSelection(a,b)};shaka.ui.OverflowMenu.registerElement("playback_rate",new shaka.ui.PlaybackRateSelection.Factory);shaka.ui.Controls.registerElement("playback_rate",new shaka.ui.PlaybackRateSelection.Factory);shaka.ui.PresentationTimeTracker=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.currentTime_=shaka.util.Dom.createButton();this.currentTime_.classList.add("shaka-current-time");this.setValue_("0:00");this.parent.appendChild(this.currentTime_);this.eventManager.listen(this.currentTime_,"click",function(){c.player.isLive()&&(c.video.currentTime=c.player.seekRange().end)});this.eventManager.listen(this.player,"loading",function(){shaka.ui.Utils.setDisplay(c.currentTime_,!0)});this.eventManager.listen(this.controls,
3548
+ shaka.ui.PlaybackRateSelection.prototype.addPlaybackRates_=function(){for(var a=this,b=$jscomp.makeIterator(this.playbackRates_.keys()),c=b.next(),d={};!c.done;d={rateStr:void 0},c=b.next()){d.rateStr=c.value;c=shaka.util.Dom.createButton();var e=shaka.util.Dom.createHTMLElement("span");e.textContent=d.rateStr;c.appendChild(e);this.eventManager.listen(c,"click",function(f){return function(){var g=a.playbackRates_.get(f.rateStr);1==g?a.player.cancelTrickPlay():a.player.trickPlay(g,!1)}}(d));this.menu.appendChild(c)}shaka.ui.Utils.focusOnTheChosenItem(this.menu)};
3549
+ goog.exportSymbol("shaka.ui.PlaybackRateSelection",shaka.ui.PlaybackRateSelection);shaka.ui.PlaybackRateSelection.Factory=function(){};shaka.ui.PlaybackRateSelection.Factory.prototype.create=function(a,b){return new shaka.ui.PlaybackRateSelection(a,b)};shaka.ui.OverflowMenu.registerElement("playback_rate",new shaka.ui.PlaybackRateSelection.Factory);shaka.ui.Controls.registerElement("playback_rate",new shaka.ui.PlaybackRateSelection.Factory);shaka.ui.PresentationTimeTracker=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.currentTime_=shaka.util.Dom.createButton();this.currentTime_.classList.add("shaka-current-time");this.setValue_("0:00");this.parent.appendChild(this.currentTime_);this.eventManager.listen(this.currentTime_,"click",function(){c.player.isLive()&&(c.video.currentTime=c.player.seekRange().end)});this.eventManager.listen(this.player,"loading",function(){shaka.ui.Utils.setDisplay(c.currentTime_,!0)});this.eventManager.listen(this.controls,
3549
3550
  "timeandseekrangeupdated",function(){c.updateTime_()});this.eventManager.listen(this.player,"trackschanged",function(){c.onTracksChanged_()});this.eventManager.listen(this.adManager,shaka.ads.Utils.AD_STARTED,function(){shaka.ui.Utils.setDisplay(c.currentTime_,!1)});this.eventManager.listen(this.adManager,shaka.ads.Utils.AD_STOPPED,function(){shaka.ui.Utils.setDisplay(c.currentTime_,!0)})};$jscomp.inherits(shaka.ui.PresentationTimeTracker,shaka.ui.Element);
3550
3551
  shaka.ui.PresentationTimeTracker.prototype.setValue_=function(a){a!=this.currentTime_.textContent&&(this.currentTime_.textContent=a)};
3551
3552
  shaka.ui.PresentationTimeTracker.prototype.updateTime_=function(){var a=this.controls.isSeeking(),b=this.controls.getDisplayTime(),c=this.player.seekRange(),d=c.end-c.start,e=shaka.ui.Utils;isFinite(d)?this.player.isLive()?(b=Math.max(0,Math.floor(c.end-b)),d=3600<=d,1<=b||a?(this.setValue_("- "+e.buildTimeString(b,d)),this.currentTime_.disabled=!1):(this.setValue_(this.localization.resolve(shaka.ui.Locales.Ids.LIVE)),this.currentTime_.disabled=!0)):(a=3600<=d,b=e.buildTimeString(Math.max(0,b-c.start),