shaka-player 4.8.1 → 4.8.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.
@@ -197,16 +197,16 @@ shaka.util.Timer.prototype.tickEvery=function(a){var b=this;this.stop();goog.DEB
197
197
  goog.exportProperty(shaka.util.Timer.prototype,"stop",shaka.util.Timer.prototype.stop);goog.exportProperty(shaka.util.Timer.prototype,"tickEvery",shaka.util.Timer.prototype.tickEvery);goog.exportProperty(shaka.util.Timer.prototype,"tickAfter",shaka.util.Timer.prototype.tickAfter);goog.exportProperty(shaka.util.Timer.prototype,"tickNow",shaka.util.Timer.prototype.tickNow);goog.DEBUG&&(shaka.util.Timer.activeTimers=new Map);shaka.util.Platform=function(){};shaka.util.Platform.supportsMediaSource=function(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1};shaka.util.Platform.supportsMediaType=function(a){return""!=shaka.util.Platform.anyMediaElement().canPlayType(a)};shaka.util.Platform.isEdge=function(){return navigator.userAgent.match(/Edge?\//)?!0:!1};shaka.util.Platform.isLegacyEdge=function(){return navigator.userAgent.match(/Edge\//)?!0:!1};shaka.util.Platform.isIE=function(){return shaka.util.Platform.userAgentContains_("Trident/")};
198
198
  shaka.util.Platform.isXboxOne=function(){return shaka.util.Platform.userAgentContains_("Xbox One")};shaka.util.Platform.isTizen=function(){return shaka.util.Platform.userAgentContains_("Tizen")};shaka.util.Platform.isTizen4=function(){return shaka.util.Platform.userAgentContains_("Tizen 4")};shaka.util.Platform.isTizen3=function(){return shaka.util.Platform.userAgentContains_("Tizen 3")};shaka.util.Platform.isTizen2=function(){return shaka.util.Platform.userAgentContains_("Tizen 2")};
199
199
  shaka.util.Platform.isWebOS=function(){return shaka.util.Platform.userAgentContains_("Web0S")};shaka.util.Platform.isWebOS3=function(){return shaka.util.Platform.isWebOS()&&38===shaka.util.Platform.chromeVersion()};shaka.util.Platform.isWebOS4=function(){return shaka.util.Platform.isWebOS()&&53===shaka.util.Platform.chromeVersion()};shaka.util.Platform.isWebOS5=function(){return shaka.util.Platform.isWebOS()&&68===shaka.util.Platform.chromeVersion()};shaka.util.Platform.isChromecast=function(){return shaka.util.Platform.userAgentContains_("CrKey")};
200
- shaka.util.Platform.chromeVersion=function(){if(!shaka.util.Platform.isChrome())return null;var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null};shaka.util.Platform.isChrome=function(){return shaka.util.Platform.userAgentContains_("Chrome")&&!shaka.util.Platform.isLegacyEdge()};shaka.util.Platform.isFirefox=function(){return shaka.util.Platform.userAgentContains_("Firefox")};
200
+ shaka.util.Platform.isAndroidCastDevice=function(){var a=shaka.util.Platform;return a.isChromecast()&&a.isAndroid()};shaka.util.Platform.chromeVersion=function(){if(!shaka.util.Platform.isChrome())return null;var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null};shaka.util.Platform.isChrome=function(){return shaka.util.Platform.userAgentContains_("Chrome")&&!shaka.util.Platform.isLegacyEdge()};shaka.util.Platform.isFirefox=function(){return shaka.util.Platform.userAgentContains_("Firefox")};
201
201
  shaka.util.Platform.isApple=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!shaka.util.Platform.isTizen()&&!shaka.util.Platform.isEOS()&&!shaka.util.Platform.isAPL()&&!shaka.util.Platform.isVirginMedia()&&!shaka.util.Platform.isOrange()&&!shaka.util.Platform.isPS4()&&!shaka.util.Platform.isAmazonFireTV()&&!shaka.util.Platform.isWPE()};shaka.util.Platform.isPS5=function(){return shaka.util.Platform.userAgentContains_("PlayStation 5")};shaka.util.Platform.isPS4=function(){return shaka.util.Platform.userAgentContains_("PlayStation 4")};
202
202
  shaka.util.Platform.isHisense=function(){return shaka.util.Platform.userAgentContains_("Hisense")||shaka.util.Platform.userAgentContains_("VIDAA")};shaka.util.Platform.isVirginMedia=function(){return shaka.util.Platform.userAgentContains_("VirginMedia")};shaka.util.Platform.isOrange=function(){return shaka.util.Platform.userAgentContains_("SOPOpenBrowser")};shaka.util.Platform.isAmazonFireTV=function(){return shaka.util.Platform.userAgentContains_("AFT")};shaka.util.Platform.isWPE=function(){return shaka.util.Platform.userAgentContains_("WPE")};
203
203
  shaka.util.Platform.safariVersion=function(){if(!shaka.util.Platform.isApple())return null;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null};shaka.util.Platform.isSafari=function(){return!!shaka.util.Platform.safariVersion()};shaka.util.Platform.isEOS=function(){return shaka.util.Platform.userAgentContains_("PC=EOS")};shaka.util.Platform.isAPL=function(){return shaka.util.Platform.userAgentContains_("PC=APL")};
204
- shaka.util.Platform.isMobile=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:shaka.util.Platform.isApple()&&1<navigator.maxTouchPoints};shaka.util.Platform.isMac=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"macos"==navigator.userAgentData.platform.toLowerCase():navigator.platform.toLowerCase().includes("mac")};
205
- shaka.util.Platform.isWindows=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():navigator.platform.toLowerCase().includes("windows")};shaka.util.Platform.isAndroid=function(){return shaka.util.Platform.userAgentContains_("Android")};
204
+ shaka.util.Platform.isMobile=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:shaka.util.Platform.isApple()&&1<navigator.maxTouchPoints};shaka.util.Platform.isMac=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"macos"==navigator.userAgentData.platform.toLowerCase():navigator.platform?navigator.platform.toLowerCase().includes("mac"):!1};
205
+ shaka.util.Platform.isWindows=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():navigator.platform?navigator.platform.toLowerCase().includes("windows"):!1};shaka.util.Platform.isAndroid=function(){return shaka.util.Platform.userAgentContains_("Android")};
206
206
  shaka.util.Platform.isSmartTV=function(){var a=shaka.util.Platform;return a.isTizen()||a.isWebOS()||a.isXboxOne()||a.isPS4()||a.isPS5()||a.isAmazonFireTV()||a.isEOS()||a.isAPL()||a.isVirginMedia()||a.isOrange()||a.isWPE()||a.isChromecast()||a.isHisense()?!0:!1};shaka.util.Platform.userAgentContains_=function(a){return(navigator.userAgent||"").includes(a)};
207
207
  shaka.util.Platform.anyMediaElement=function(){var a=shaka.util.Platform;if(a.cachedMediaElement_)return a.cachedMediaElement_;a.cacheExpirationTimer_||(a.cacheExpirationTimer_=new shaka.util.Timer(function(){a.cachedMediaElement_=null}));a.cachedMediaElement_=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0];a.cachedMediaElement_||(a.cachedMediaElement_=document.createElement("video"));a.cacheExpirationTimer_.tickAfter(1);return a.cachedMediaElement_};
208
- shaka.util.Platform.requiresEncryptionInfoInAllInitSegments=function(){var a=shaka.util.Platform;return a.isTizen()||a.isXboxOne()||a.isOrange()};shaka.util.Platform.supportsSequenceMode=function(){var a=shaka.util.Platform;return a.isTizen3()||a.isTizen2()||a.isWebOS3()||a.isPS4()?!1:!0};shaka.util.Platform.supportsSmoothCodecSwitching=function(){var a=shaka.util.Platform;return a.isTizen2()||a.isTizen3()||a.isTizen4()||a.isWebOS3()||a.isWebOS4()||a.isWebOS5()||a.isWindows()&&a.isEdge()?!1:!0};
209
- shaka.util.Platform.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill?!0:!1};
208
+ shaka.util.Platform.requiresEncryptionInfoInAllInitSegments=function(){var a=shaka.util.Platform;return a.isTizen()||a.isXboxOne()||a.isOrange()};shaka.util.Platform.supportsSequenceMode=function(){var a=shaka.util.Platform;return a.isTizen3()||a.isTizen2()||a.isWebOS3()||a.isPS4()?!1:!0};
209
+ shaka.util.Platform.supportsSmoothCodecSwitching=function(){var a=shaka.util.Platform;return a.isTizen2()||a.isTizen3()||a.isTizen4()||a.isWebOS3()||a.isWebOS4()||a.isWebOS5()||a.isChromecast()&&!a.isAndroidCastDevice()||a.isWindows()&&a.isEdge()?!1:!0};shaka.util.Platform.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill?!0:!1};
210
210
  shaka.util.Platform.detectMaxHardwareResolution=function(){var a,b,c,d,e,f,g,h,k,l,m;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){switch(n.nextAddress){case 1:a=shaka.util.Platform;b={width:Infinity,height:Infinity};if(a.isChromecast()){window.cast&&cast.__platform__&&cast.__platform__.canDisplayType&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?(b.width=3840,b.height=2160):(b.width=1920,b.height=1080);n.jumpTo(2);break}if(a.isTizen()){b.width=
211
211
  1920;b.height=1080;try{webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution?(c=webapis.systeminfo.getMaxVideoResolution(),b.width=c.width,b.height=c.height):webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(b.width=7680,b.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(b.width=3840,b.height=2160)}catch(p){shaka.log.alwaysWarn("Tizen: Error detecting screen size, default screen size 1920x1080.")}n.jumpTo(2);break}if(a.isXboxOne()){d=
212
212
  new Windows.Media.Protection.ProtectionCapabilities;e=Windows.Media.Protection.ProtectionCapabilityResult;f=null;try{do f=d.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation");while(f===e.maybe)}catch(p){f=e.notSupported}f===e.probably?(b.width=3840,b.height=2160):(b.width=1920,b.height=1080);n.jumpTo(2);break}if(a.isWebOS()){try{g=
@@ -322,9 +322,9 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
322
322
  "\u81ea\u52d5"],["BACK","\u8fd4\u56de"],["CAPTIONS","\u5b57\u5e55"],["CAST","\u6295\u653e..."],["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",
323
323
  "\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"],["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["RESOLUTION","\u89e3\u6790\u5ea6"],
324
324
  ["REWIND","\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]))};
325
- shaka.ui.Locales.Ids={SUBTITLE_FORCED:"SUBTITLE_FORCED",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",AD_PROGRESS:"AD_PROGRESS",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",LIVE:"LIVE",STATISTICS:"STATISTICS",UNMUTE:"UNMUTE",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",LANGUAGE:"LANGUAGE",OFF:"OFF",MORE_SETTINGS:"MORE_SETTINGS",PAUSE:"PAUSE",VOLUME:"VOLUME",AIRPLAY:"AIRPLAY",SURROUND:"SURROUND",PLAYBACK_RATE:"PLAYBACK_RATE",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",
326
- FULL_SCREEN:"FULL_SCREEN",ON:"ON",AD_TIME:"AD_TIME",AUTO_QUALITY:"AUTO_QUALITY",REPLAY:"REPLAY",MUTE:"MUTE",SEEK:"SEEK",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",CAST:"CAST",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",SKIP_AD:"SKIP_AD",RECENTER_VR:"RECENTER_VR",PLAY:"PLAY",BACK:"BACK",LOOP:"LOOP",RESOLUTION:"RESOLUTION",REWIND:"REWIND",NOT_APPLICABLE:"NOT_APPLICABLE",AD_DURATION:"AD_DURATION",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",FAST_FORWARD:"FAST_FORWARD",
327
- TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",QUALITY:"QUALITY",SKIP_TO_LIVE:"SKIP_TO_LIVE",CAPTIONS:"CAPTIONS"};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)};
325
+ shaka.ui.Locales.Ids={LOOP:"LOOP",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",SEEK:"SEEK",NOT_APPLICABLE:"NOT_APPLICABLE",ON:"ON",QUALITY:"QUALITY",AIRPLAY:"AIRPLAY",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",MUTE:"MUTE",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",SURROUND:"SURROUND",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",CAPTIONS:"CAPTIONS",PLAY:"PLAY",PLAYBACK_RATE:"PLAYBACK_RATE",REPLAY:"REPLAY",UNMUTE:"UNMUTE",SUBTITLE_FORCED:"SUBTITLE_FORCED",
326
+ AUTO_QUALITY:"AUTO_QUALITY",SKIP_AD:"SKIP_AD",LIVE:"LIVE",VOLUME:"VOLUME",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",PAUSE:"PAUSE",AD_PROGRESS:"AD_PROGRESS",LANGUAGE:"LANGUAGE",STATISTICS:"STATISTICS",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",FULL_SCREEN:"FULL_SCREEN",AD_DURATION:"AD_DURATION",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",AD_TIME:"AD_TIME",SKIP_TO_LIVE:"SKIP_TO_LIVE",MORE_SETTINGS:"MORE_SETTINGS",RECENTER_VR:"RECENTER_VR",CAST:"CAST",FAST_FORWARD:"FAST_FORWARD",RESOLUTION:"RESOLUTION",
327
+ OFF:"OFF",BACK:"BACK",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",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)};
328
328
  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)};
329
329
  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)};
330
330
  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()}};
@@ -560,7 +560,8 @@ shaka.util.TXml.parseDuration=function(a){if(!a)return null;var b=RegExp("^P(?:(
560
560
  shaka.util.TXml.parseRange=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null};shaka.util.TXml.parseInt=function(a){a=Number(a);return 0===a%1?a:null};shaka.util.TXml.parsePositiveInt=function(a){a=Number(a);return 0===a%1&&0<a?a:null};shaka.util.TXml.parseNonNegativeInt=function(a){a=Number(a);return 0===a%1&&0<=a?a:null};
561
561
  shaka.util.TXml.parseFloat=function(a){a=Number(a);return isNaN(a)?null:a};shaka.util.TXml.parseBoolean=function(a){return a?"true"===a.toLowerCase():!1};shaka.util.TXml.evalDivision=function(a){var b;var c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c};
562
562
  shaka.util.TXml.parseXpath=function(a){var b=[];a=a.split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next()){var d=c.value;c=d.match(/\b([A-Z])\w+/);d=d.match(/(@id='(.*?)')/);c&&b.push({name:c[0],id:d?d[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null})}return b};
563
- shaka.util.TXml.txmlNodeToDomElement=function(a,b,c){b=void 0===b?!0:b;c=void 0===c?!0:c;var d=shaka.util.TXml,e=document.createElement(a.tagName),f;for(f in a.attributes)e.setAttribute(f,a.attributes[f]);b&&a.parent&&d.txmlNodeToDomElement(a.parent,!0,!1).appendChild(e);if(c)for(a=$jscomp.makeIterator(a.children),b=a.next();!b.done;b=a.next())b=b.value,b="string"==typeof b?new Text(b):d.txmlNodeToDomElement(b,!1,!0),e.appendChild(b);return e};shaka.util.TXml.knownNameSpaces_=new Map([]);shaka.media.DrmEngine=function(a){var b=this;this.playerInterface_=a;this.supportedTypes_=new Set;this.video_=this.mediaKeys_=null;this.initializedForStorage_=this.initialized_=!1;this.licenseTimeSeconds_=0;this.currentDrmInfo_=null;this.eventManager_=new shaka.util.EventManager;this.activeSessions_=new Map;this.storedPersistentSessions_=new Map;this.allSessionsLoaded_=new shaka.util.PublicPromise;this.config_=null;this.onError_=function(c){c.severity==shaka.util.Error.Severity.CRITICAL&&b.allSessionsLoaded_.reject(c);
563
+ shaka.util.TXml.txmlNodeToDomElement=function(a,b,c){b=void 0===b?!0:b;c=void 0===c?!0:c;var d=shaka.util.TXml,e=document.createElement(a.tagName),f;for(f in a.attributes)e.setAttribute(f,a.attributes[f]);b&&a.parent&&"?xml"!=a.parent.tagName&&d.txmlNodeToDomElement(a.parent,!0,!1).appendChild(e);if(c)for(a=$jscomp.makeIterator(a.children),b=a.next();!b.done;b=a.next())b=b.value,b="string"==typeof b?new Text(b):d.txmlNodeToDomElement(b,!1,!0),e.appendChild(b);return e};
564
+ shaka.util.TXml.knownNameSpaces_=new Map([]);shaka.media.DrmEngine=function(a){var b=this;this.playerInterface_=a;this.supportedTypes_=new Set;this.video_=this.mediaKeys_=null;this.initializedForStorage_=this.initialized_=!1;this.licenseTimeSeconds_=0;this.currentDrmInfo_=null;this.eventManager_=new shaka.util.EventManager;this.activeSessions_=new Map;this.storedPersistentSessions_=new Map;this.allSessionsLoaded_=new shaka.util.PublicPromise;this.config_=null;this.onError_=function(c){c.severity==shaka.util.Error.Severity.CRITICAL&&b.allSessionsLoaded_.reject(c);
564
565
  a.onError(c)};this.keyStatusByKeyId_=new Map;this.announcedKeyStatusByKeyId_=new Map;this.keyStatusTimer_=new shaka.util.Timer(function(){return b.processKeyStatusChanges_()});this.usePersistentLicenses_=!1;this.mediaKeyMessageEvents_=[];this.initialRequestsSent_=!1;this.expirationTimer_=new shaka.util.Timer(function(){b.pollExpiration_()});this.allSessionsLoaded_.catch(function(){});this.destroyer_=new shaka.util.Destroyer(function(){return b.destroyNow_()});this.srcEquals_=!1;this.manifestInitData_=
565
566
  this.mediaKeysAttached_=null};shaka.media.DrmEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
566
567
  shaka.media.DrmEngine.prototype.destroyNow_=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){switch(b.nextAddress){case 1:return a.eventManager_.release(),a.eventManager_=null,a.allSessionsLoaded_.reject(),a.expirationTimer_.stop(),a.expirationTimer_=null,a.keyStatusTimer_.stop(),a.keyStatusTimer_=null,b.yield(a.closeOpenSessions_(),2);case 2:if(!a.video_){b.jumpTo(3);break}goog.asserts.assert(!a.video_.src,"video src must be removed first!");b.setCatchFinallyBlocks(4);
@@ -910,7 +911,7 @@ function(){return g.getStartTime_(d)});this.checkWindowTimer_=new shaka.util.Tim
910
911
  shaka.media.MediaSourcePlayhead.prototype.release=function(){this.videoWrapper_&&(this.videoWrapper_.release(),this.videoWrapper_=null);this.gapController_&&(this.gapController_.release(),this.gapController_=null);this.checkWindowTimer_&&(this.checkWindowTimer_.stop(),this.checkWindowTimer_=null);this.mediaElement_=this.videoWrapper_=this.timeline_=this.config_=null;this.onSeek_=function(){}};shaka.media.MediaSourcePlayhead.prototype.setStartTime=function(a){this.videoWrapper_.setTime(a)};
911
912
  shaka.media.MediaSourcePlayhead.prototype.getTime=function(){var a=this.videoWrapper_.getTime();return 0<this.mediaElement_.readyState&&!this.mediaElement_.paused?this.clampTime_(a):a};shaka.media.MediaSourcePlayhead.prototype.getStallsDetected=function(){return this.stallDetector_?this.stallDetector_.getStallsDetected():0};shaka.media.MediaSourcePlayhead.prototype.getGapsJumped=function(){return this.gapController_.getGapsJumped()};
912
913
  shaka.media.MediaSourcePlayhead.prototype.getStartTime_=function(a){null==a?a=Infinity>this.timeline_.getDuration()?this.timeline_.getSeekRangeStart():this.timeline_.getSeekRangeEnd():0>a&&(a=this.timeline_.getSeekRangeEnd()+a);return this.clampSeekToDuration_(this.clampTime_(a))};shaka.media.MediaSourcePlayhead.prototype.notifyOfBufferingChange=function(){this.gapController_.onSegmentAppended()};
913
- shaka.media.MediaSourcePlayhead.prototype.onPollWindow_=function(){if(0!=this.mediaElement_.readyState&&!this.mediaElement_.paused){var a=this.videoWrapper_.getTime(),b=this.timeline_.getSeekRangeStart(),c=this.timeline_.getSeekRangeEnd();c-b<this.minSeekRange_&&(b=c-this.minSeekRange_);if(a<b||a>c)b=this.reposition_(a),shaka.log.info("Jumping by "+(b-a)+" seconds to catch up with the seek range."),this.mediaElement_.currentTime=b}};shaka.media.MediaSourcePlayhead.prototype.onStarted_=function(a){this.gapController_.onStarted(a)};
914
+ shaka.media.MediaSourcePlayhead.prototype.onPollWindow_=function(){if(0!=this.mediaElement_.readyState&&!this.mediaElement_.paused){var a=this.videoWrapper_.getTime(),b=this.timeline_.getSeekRangeStart(),c=this.timeline_.getSeekRangeEnd();c-b<this.minSeekRange_&&(b=c-this.minSeekRange_);a<b&&(b=this.reposition_(a),shaka.log.info("Jumping forward "+(b-a)+" seconds to catch up with the seek range."),this.mediaElement_.currentTime=b)}};shaka.media.MediaSourcePlayhead.prototype.onStarted_=function(a){this.gapController_.onStarted(a)};
914
915
  shaka.media.MediaSourcePlayhead.prototype.onSeeking_=function(){this.gapController_.onSeeking();var a=this.videoWrapper_.getTime(),b=this.reposition_(a);if(Math.abs(b-a)>shaka.media.GapJumpingController.BROWSER_GAP_TOLERANCE){var c=Date.now()/1E3;if(!this.lastCorrectiveSeek_||this.lastCorrectiveSeek_<c-1){this.lastCorrectiveSeek_=c;this.videoWrapper_.setTime(b);return}}shaka.log.v1("Seek to "+a);this.onSeek_()};
915
916
  shaka.media.MediaSourcePlayhead.prototype.clampSeekToDuration_=function(a){var b=this.timeline_.getDuration();return a>=b?(goog.asserts.assert(0<=this.config_.durationBackoff,"Duration backoff must be non-negative!"),b-this.config_.durationBackoff):a};
916
917
  shaka.media.MediaSourcePlayhead.prototype.reposition_=function(a){goog.asserts.assert(this.config_,"Cannot reposition playhead when it has beeen destroyed");var b=Math.max(this.minBufferTime_,this.config_.rebufferingGoal),c=this.config_.safeSeekOffset,d=this.timeline_.getSeekRangeStart(),e=this.timeline_.getSeekRangeEnd(),f=this.timeline_.getDuration();e-d<this.minSeekRange_&&(d=e-this.minSeekRange_);var g=this.timeline_.getSafeSeekRangeStart(b),h=this.timeline_.getSafeSeekRangeStart(c);b=this.timeline_.getSafeSeekRangeStart(b+
@@ -963,12 +964,15 @@ playTime:this.stateHistory_.getTimeSpentIn("playing"),pauseTime:this.stateHistor
963
964
  shaka.util.Stats.getEmptyBlob=function(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,bytesDownloaded:NaN,switchHistory:[],stateHistory:[]}};shaka.media.SegmentPrefetch=function(a,b,c){this.prefetchLimit_=a;this.stream_=b;this.prefetchPosTime_=0;this.fetchDispatcher_=c;this.segmentPrefetchMap_=new Map;this.initSegmentPrefetchMap_=new Map};shaka.media.SegmentPrefetch.prototype.replaceFetchDispatcher=function(a){this.fetchDispatcher_=a;for(var b=$jscomp.makeIterator(this.segmentPrefetchMap_.values()),c=b.next();!c.done;c=b.next())c.value.replaceFetchDispatcher(a)};shaka.media.SegmentPrefetch.prototype.getLastKnownPosition=function(){return this.prefetchPosTime_};
964
965
  shaka.media.SegmentPrefetch.prototype.prefetchSegmentsByTime=function(a,b){b=void 0===b?!1:b;goog.asserts.assert(0<this.prefetchLimit_,"SegmentPrefetch can not be used when prefetchLimit <= 0.");var c=shaka.media.SegmentPrefetch.logPrefix_(this.stream_);if(this.stream_.segmentIndex){if(a=this.stream_.segmentIndex.getIteratorForTime(Math.max(a,this.prefetchPosTime_),!0))if(c=a.next().value,b&&(c=a.next().value),c){for(;this.segmentPrefetchMap_.size<this.prefetchLimit_&&null!=c;){b=!0;c.isPreload()&&
965
966
  null!=c.endByte&&(b=!1);c.getStatus()==shaka.media.SegmentReference.Status.MISSING&&(b=!1);b&&c.initSegmentReference&&this.prefetchInitSegment(c.initSegmentReference);b&&!this.segmentPrefetchMap_.has(c)&&(b=new shaka.media.SegmentPrefetchOperation(this.fetchDispatcher_),b.dispatchFetch(c,this.stream_),this.segmentPrefetchMap_.set(c,b));this.prefetchPosTime_=c.startTime;if(this.stream_.fastSwitching&&c.isPartial()&&c.isLastPartial())break;c=a.next().value}this.clearInitSegments_()}}else shaka.log.debug(c,
966
- "missing segmentIndex")};shaka.media.SegmentPrefetch.prototype.prefetchInitSegment=function(a){goog.asserts.assert(0<this.prefetchLimit_,"SegmentPrefetch can not be used when prefetchLimit <= 0.");var b=shaka.media.SegmentPrefetch.logPrefix_(this.stream_);this.stream_.segmentIndex?this.initSegmentPrefetchMap_.has(a)||(b=new shaka.media.SegmentPrefetchOperation(this.fetchDispatcher_),b.dispatchFetch(a,this.stream_),this.initSegmentPrefetchMap_.set(a,b)):shaka.log.debug(b,"missing segmentIndex")};
967
+ "missing segmentIndex")};
968
+ shaka.media.SegmentPrefetch.prototype.prefetchInitSegment=function(a){goog.asserts.assert(0<this.prefetchLimit_,"SegmentPrefetch can not be used when prefetchLimit <= 0.");var b=shaka.media.SegmentPrefetch.logPrefix_(this.stream_);this.stream_.segmentIndex?Array.from(this.initSegmentPrefetchMap_.keys()).some(function(c){return shaka.media.InitSegmentReference.equal(c,a)})||(b=new shaka.media.SegmentPrefetchOperation(this.fetchDispatcher_),b.dispatchFetch(a,this.stream_),this.initSegmentPrefetchMap_.set(a,b)):
969
+ shaka.log.debug(b,"missing segmentIndex")};
967
970
  shaka.media.SegmentPrefetch.prototype.getPrefetchedSegment=function(a,b){goog.asserts.assert(0<this.prefetchLimit_,"SegmentPrefetch can not be used when prefetchLimit <= 0.");var c=shaka.media.SegmentPrefetch.logPrefix_(this.stream_),d=this.segmentPrefetchMap_;a instanceof shaka.media.InitSegmentReference&&(d=this.initSegmentPrefetchMap_);if(d.has(a)){var e=d.get(a);b&&e.setStreamDataCallback(b);a instanceof shaka.media.SegmentReference?shaka.log.debug(c,"reused prefetched segment at time:",a.startTime,
968
971
  "mapSize",d.size):shaka.log.debug(c,"reused prefetched init segment at time, mapSize",d.size);return e.getOperation()}a instanceof shaka.media.SegmentReference?shaka.log.debug(c,"missed segment at time:",a.startTime,"mapSize",d.size):shaka.log.debug(c,"missed init segment at time, mapSize",d.size);return null};shaka.media.SegmentPrefetch.prototype.clearMap_=function(a){a=$jscomp.makeIterator(a.keys());for(var b=a.next();!b.done;b=a.next())(b=b.value)&&this.abortPrefetchedSegment_(b)};
969
- shaka.media.SegmentPrefetch.prototype.clearAll=function(){this.clearMap_(this.segmentPrefetchMap_);this.clearMap_(this.initSegmentPrefetchMap_);var a=shaka.media.SegmentPrefetch.logPrefix_(this.stream_);shaka.log.debug(a,"cleared all");this.prefetchPosTime_=0};shaka.media.SegmentPrefetch.prototype.evict=function(a,b){b=void 0===b?!1:b;for(var c=$jscomp.makeIterator(this.segmentPrefetchMap_.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&this.abortPrefetchedSegment_(d);b&&this.clearInitSegments_()};
970
- shaka.media.SegmentPrefetch.prototype.clearInitSegments_=function(){for(var a=Array.from(this.segmentPrefetchMap_.keys()),b={},c=$jscomp.makeIterator(this.initSegmentPrefetchMap_.keys()),d=c.next();!d.done;b={$jscomp$loop$prop$initSegmentReference$935:b.$jscomp$loop$prop$initSegmentReference$935},d=c.next())b.$jscomp$loop$prop$initSegmentReference$935=d.value,a.some(function(e){return function(f){return f.initSegmentReference===e.$jscomp$loop$prop$initSegmentReference$935}}(b))||this.abortPrefetchedSegment_(b.$jscomp$loop$prop$initSegmentReference$935)};
971
- shaka.media.SegmentPrefetch.prototype.resetLimit=function(a){goog.asserts.assert(0<=a,"The new prefetch limit must be >= 0.");var b=shaka.media.SegmentPrefetch.logPrefix_(this.stream_);shaka.log.debug(b,"resetting prefetch limit to",a);this.prefetchLimit_=a;for(b=Array.from(this.segmentPrefetchMap_.keys());b.length>a;){var c=b.pop();c&&this.abortPrefetchedSegment_(c)}this.clearInitSegments_()};
972
+ shaka.media.SegmentPrefetch.prototype.clearAll=function(){this.clearMap_(this.segmentPrefetchMap_);this.clearMap_(this.initSegmentPrefetchMap_);var a=shaka.media.SegmentPrefetch.logPrefix_(this.stream_);shaka.log.debug(a,"cleared all");this.prefetchPosTime_=0};shaka.media.SegmentPrefetch.prototype.removeReference=function(a){this.abortPrefetchedSegment_(a)};
973
+ shaka.media.SegmentPrefetch.prototype.evict=function(a,b){b=void 0===b?!1:b;for(var c=$jscomp.makeIterator(this.segmentPrefetchMap_.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&this.abortPrefetchedSegment_(d);b&&this.clearInitSegments_()};
974
+ shaka.media.SegmentPrefetch.prototype.clearInitSegments_=function(){for(var a=Array.from(this.segmentPrefetchMap_.keys()),b={},c=$jscomp.makeIterator(this.initSegmentPrefetchMap_.keys()),d=c.next();!d.done;b={$jscomp$loop$prop$initSegmentReference$935:b.$jscomp$loop$prop$initSegmentReference$935},d=c.next())b.$jscomp$loop$prop$initSegmentReference$935=d.value,a.some(function(e){return function(f){return shaka.media.InitSegmentReference.equal(f.initSegmentReference,e.$jscomp$loop$prop$initSegmentReference$935)}}(b))||
975
+ this.abortPrefetchedSegment_(b.$jscomp$loop$prop$initSegmentReference$935)};shaka.media.SegmentPrefetch.prototype.resetLimit=function(a){goog.asserts.assert(0<=a,"The new prefetch limit must be >= 0.");var b=shaka.media.SegmentPrefetch.logPrefix_(this.stream_);shaka.log.debug(b,"resetting prefetch limit to",a);this.prefetchLimit_=a;for(b=Array.from(this.segmentPrefetchMap_.keys());b.length>a;){var c=b.pop();c&&this.abortPrefetchedSegment_(c)}this.clearInitSegments_()};
972
976
  shaka.media.SegmentPrefetch.prototype.switchStream=function(a){a&&a!==this.stream_&&(this.clearAll(),this.stream_=a)};shaka.media.SegmentPrefetch.prototype.getStream=function(){return this.stream_};
973
977
  shaka.media.SegmentPrefetch.prototype.abortPrefetchedSegment_=function(a){var b=shaka.media.SegmentPrefetch.logPrefix_(this.stream_),c=this.segmentPrefetchMap_;a instanceof shaka.media.InitSegmentReference&&(c=this.initSegmentPrefetchMap_);var d=c.get(a);c.delete(a);d&&(d.abort(),a instanceof shaka.media.SegmentReference?shaka.log.debug(b,"pop and abort prefetched segment at time:",a.startTime):shaka.log.debug(b,"pop and abort prefetched init segment"))};
974
978
  shaka.media.SegmentPrefetch.logPrefix_=function(a){return"SegmentPrefetch("+a.type+":"+a.id+")"};shaka.media.SegmentPrefetchOperation=function(a){this.fetchDispatcher_=a;this.operation_=this.streamDataCallback_=null};shaka.media.SegmentPrefetchOperation.prototype.replaceFetchDispatcher=function(a){this.fetchDispatcher_=a};
@@ -1039,7 +1043,7 @@ b,h,c,G,!0),5);case 5:a.segmentPrefetch&&a.segmentIterator&&a.segmentPrefetch.pr
1039
1043
  return a.waitingToClearBuffer?(shaka.log.info(g,"waitingToClearBuffer, skip append"),a.performingUpdate=!1,d.scheduleUpdate_(a,0),B.return()):B.yield(d.append_(a,b,h,c,p),6);case 9:t=B.yieldResult;if(x)throw x;if(v){B.jumpTo(10);break}r=!0;d.destroyer_.ensureNotDestroyed();return d.fatalError_?B.return():a.waitingToClearBuffer?(shaka.log.info(g,"waitingToClearBuffer, skip append"),a.performingUpdate=!1,d.scheduleUpdate_(a,0),B.return()):B.yield(d.append_(a,b,h,c,t),10);case 10:a.segmentPrefetch&&
1040
1044
  a.segmentIterator&&a.segmentPrefetch.prefetchSegmentsByTime(c.startTime,!0);case 6:d.destroyer_.ensureNotDestroyed();if(d.fatalError_)return B.return();a.lastSegmentReference=c;y=k.next().value;shaka.log.v2(g,"advancing to next segment",y);a.performingUpdate=!1;a.recovering=!1;u=d.playerInterface_.mediaSourceEngine.getBufferedInfo();z=u[a.type];shaka.log.v1(g,"finished fetch and append",JSON.stringify(z));if(!a.waitingToClearBuffer)d.playerInterface_.onSegmentAppended(c,a.stream);d.scheduleUpdate_(a,
1041
1045
  0);B.leaveTryBlock(0);break;case 2:A=B.enterCatchBlock();d.destroyer_.ensureNotDestroyed(A);if(d.fatalError_)return B.return();goog.asserts.assert(A instanceof shaka.util.Error,"Should only receive a Shaka error");a.performingUpdate=!1;if(A.code==shaka.util.Error.Code.OPERATION_ABORTED)a.performingUpdate=!1,d.cancelUpdate_(a),d.scheduleUpdate_(a,0),B.jumpTo(0);else if(a.type==e.TEXT&&d.config_.ignoreTextStreamFailures)A.code==shaka.util.Error.Code.BAD_HTTP_STATUS?shaka.log.warning(g,"Text stream failed to download. Proceeding without it."):
1042
- shaka.log.warning(g,"Text stream failed to parse. Proceeding without it."),d.mediaStates_.delete(e.TEXT),B.jumpTo(0);else if(A.code==shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR)d.handleQuotaExceeded_(a,A),B.jumpTo(0);else return shaka.log.error(g,"failed fetch and append: code="+A.code),a.hasError=!0,A.severity=shaka.util.Error.Severity.CRITICAL,B.yield(d.handleStreamingError_(a,A),0)}})};
1046
+ shaka.log.warning(g,"Text stream failed to parse. Proceeding without it."),d.mediaStates_.delete(e.TEXT),B.jumpTo(0);else if(A.code==shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR)d.handleQuotaExceeded_(a,A),B.jumpTo(0);else return shaka.log.error(g,"failed fetch and append: code="+A.code),a.hasError=!0,A.category==shaka.util.Error.Category.NETWORK&&a.segmentPrefetch&&a.segmentPrefetch.removeReference(c),A.severity=shaka.util.Error.Severity.CRITICAL,B.yield(d.handleStreamingError_(a,A),0)}})};
1043
1047
  shaka.media.StreamingEngine.prototype.aesDecrypt_=function(a,b,c){var d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress){d=b;if(d.cryptoKey)return k.jumpTo(2);goog.asserts.assert(d.fetchKey,"If AES cryptoKey was not preloaded, fetchKey function should be provided");return k.yield(d.fetchKey(),3)}2!=k.nextAddress&&goog.asserts.assert(d.cryptoKey,"AES cryptoKey should now be set");e=d.iv;if(!e)for(e=shaka.util.BufferUtils.toUint8(new ArrayBuffer(16)),f=d.firstMediaSequenceNumber+
1044
1048
  c,g=e.byteLength-1;0<=g;g--)e[g]=f&255,f>>=8;h="CBC"==b.blockCipherMode?{name:"AES-CBC",iv:e}:{name:"AES-CTR",counter:e,length:64};return k.return(window.crypto.subtle.decrypt(h,d.cryptoKey,a))})};
1045
1049
  shaka.media.StreamingEngine.prototype.retry=function(a){if(this.destroyer_.destroyed())return shaka.log.error("Unable to retry after StreamingEngine is destroyed!"),!1;if(this.fatalError_)return shaka.log.error("Unable to retry after StreamingEngine encountered a fatal error!"),!1;for(var b=$jscomp.makeIterator(this.mediaStates_.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=shaka.media.StreamingEngine.logPrefix_(c);!c.hasError||c.performingUpdate||c.updateTimer||(shaka.log.info(d,"Retrying after failure..."),
@@ -1169,8 +1173,9 @@ goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"append",shaka.text
1169
1173
  goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"setTextVisibility",shaka.text.StubTextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"isTextVisible",shaka.text.StubTextDisplayer.prototype.isTextVisible);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"destroy",shaka.text.StubTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"append",shaka.text.StubTextDisplayer.prototype.append);
1170
1174
  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.util.Dom=function(){};shaka.util.Dom.createHTMLElement=function(a){return document.createElement(a)};shaka.util.Dom.createButton=function(){var a=document.createElement("button");a.setAttribute("type","button");return a};shaka.util.Dom.asHTMLElement=function(a){return a};shaka.util.Dom.asHTMLCanvasElement=function(a){return a};shaka.util.Dom.asHTMLMediaElement=function(a){return a};
1171
1175
  shaka.util.Dom.getElementByClassName=function(a,b){b=b.getElementsByClassName(a);goog.asserts.assert(1==b.length,"Should only be one element with class name "+a);return shaka.util.Dom.asHTMLElement(b[0])};shaka.util.Dom.removeAllChildren=function(a){for(;a.firstChild;)a.removeChild(a.firstChild)};goog.exportSymbol("shaka.util.Dom",shaka.util.Dom);goog.exportProperty(shaka.util.Dom,"removeAllChildren",shaka.util.Dom.removeAllChildren);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";
1172
- this.textContainer_.style.justifyContent="flex-end";this.videoContainer_.appendChild(this.textContainer_);this.captionsTimer_=(new shaka.util.Timer(function(){d.video_.paused||d.updateCaptions_()})).tickEvery(c.captionsUpdatePeriod);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_,
1173
- "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};shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
1176
+ 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,
1177
+ "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};
1178
+ shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
1174
1179
  shaka.text.UITextDisplayer.prototype.append=function(a){var b=[].concat($jscomp.arrayFromIterable(this.cues_)),c={};a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;c={$jscomp$loop$prop$cue$942:c.$jscomp$loop$prop$cue$942},d=a.next())c.$jscomp$loop$prop$cue$942=d.value,b.some(function(e){return function(f){return shaka.text.Cue.equal(f,e.$jscomp$loop$prop$cue$942)}}(c))||this.cues_.push(c.$jscomp$loop$prop$cue$942);this.updateCaptions_()};
1175
1180
  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()};
1176
1181
  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};
@@ -1476,7 +1481,7 @@ goog.exportProperty(shaka.Player.prototype,"getAssetUri",shaka.Player.prototype.
1476
1481
  goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.prototype.resetConfiguration);goog.exportProperty(shaka.Player.prototype,"getBufferFullness",shaka.Player.prototype.getBufferFullness);goog.exportProperty(shaka.Player.prototype,"getConfiguration",shaka.Player.prototype.getConfiguration);goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.configure);goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);
1477
1482
  goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);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);
1478
1483
  goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);goog.exportProperty(shaka.Player.prototype,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);
1479
- goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.8.1-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);
1484
+ goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.8.2-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);
1480
1485
  shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};
1481
1486
  shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_}};shaka.ads.ClientSideAd=function(a,b,c){var d=this;this.ad_=a;this.manager_=b;this.video_=c;this.isPaused_=!1;this.volume_=this.manager_.getVolume();this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.PAUSED,function(){d.isPaused_=!0});this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.RESUMED,function(){d.isPaused_=!1})};shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};
1482
1487
  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()};
@@ -1830,10 +1835,9 @@ shaka.dash.MpdUtils.createTimeline=function(a,b,c,d,e){goog.asserts.assert(0<b&&
1830
1835
  'ignoring the remaining "S" elements.',l);break}n=null!=n?n:h;q=q||0;if(0>q)if(m){m=f.parseAttr(m,"t",f.parseNonNegativeInt);if(null==m){shaka.log.warning('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:','ignoring the remaining "S" elements.',l);break}else if(n>=m){shaka.log.warning('An "S" element cannot have a negative repeatif its start ','time exceeds the next "S" element\'s start time:','ignoring the remaining "S" elements.',l);break}q=
1831
1836
  Math.ceil((m-n)/p)-1}else{if(Infinity==d){shaka.log.warning('The last "S" element cannot have a negative repeat',"if the Period has an infinite duration:",'ignoring the last "S" element.',l);break}else if(n/b>=d){shaka.log.warning('The last "S" element cannot have a negative repeat',"if its start time exceeds the Period's duration:",'igoring the last "S" element.',l);break}q=Math.ceil((d*b-n)/p)-1}0<g.length&&n!=h&&(Math.abs((n-h)/b)>=shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS&&
1832
1837
  shaka.log.warning("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",l),g[g.length-1].end=n/b);for(l=0;l<=q;++l)h=n+p,g.push({start:n/b,end:h/b,unscaledStart:n,partialSegments:r,segmentPosition:g.length+e}),n=h}return g};
1833
- shaka.dash.MpdUtils.parseSegmentInfo=function(a,b){goog.asserts.assert(b(a.representation),"There must be at least one element of the given type.");var c=shaka.dash.MpdUtils,d=shaka.util.TXml,e=c.inheritAttribute(a,b,"timescale"),f=1;e&&(f=d.parsePositiveInt(e)||1);var g=c.inheritAttribute(a,b,"duration");e=d.parsePositiveInt(g||"");a.representation.contentType==shaka.util.ManifestParserUtils.ContentType.IMAGE&&(e=d.parseFloat(g||""));e&&(e/=f);var h=c.inheritAttribute(a,b,"startNumber");g=Number(c.inheritAttribute(a,
1834
- b,"presentationTimeOffset"))||0;d=d.parseNonNegativeInt(h||"");if(null==h||null==d)d=1;b=c.inheritChild(a,b,"SegmentTimeline");h=null;b&&(h=c.createTimeline(b,f,g,a.periodInfo.duration||Infinity,d));return{timescale:f,segmentDuration:e,startNumber:d,scaledPresentationTimeOffset:g/f||0,unscaledPresentationTimeOffset:g,timeline:h}};
1835
- shaka.dash.MpdUtils.getNodes=function(a,b){var c=shaka.util.Functional;goog.asserts.assert(b(a.representation),"There must be at least one element of the given type");return[b(a.representation),b(a.adaptationSet),b(a.period)].filter(c.isNotNull)};shaka.dash.MpdUtils.inheritAttribute=function(a,b,c){b=shaka.dash.MpdUtils.getNodes(a,b);a=null;b=$jscomp.makeIterator(b);for(var d=b.next();!d.done&&!(a=d.value.attributes[c]);d=b.next());return a};
1836
- shaka.dash.MpdUtils.inheritChild=function(a,b,c){var d=shaka.dash.MpdUtils.getNodes(a,b);a=shaka.util.TXml;b=null;d=$jscomp.makeIterator(d);for(var e=d.next();!e.done&&!(b=a.findChild(e.value,c));e=d.next());return b};
1838
+ shaka.dash.MpdUtils.parseSegmentInfo=function(a,b){goog.asserts.assert(b(a.representation),"There must be at least one element of the given type.");var c=shaka.dash.MpdUtils,d=shaka.util.TXml,e=c.inheritAttribute(a,b,"timescale"),f=1;e&&(f=d.parsePositiveInt(e)||1);e=c.inheritAttribute(a,b,"duration");(e=d.parsePositiveInt(e||""))&&(e/=f);var g=c.inheritAttribute(a,b,"startNumber"),h=Number(c.inheritAttribute(a,b,"presentationTimeOffset"))||0;d=d.parseNonNegativeInt(g||"");if(null==g||null==d)d=1;
1839
+ b=c.inheritChild(a,b,"SegmentTimeline");g=null;b&&(g=c.createTimeline(b,f,h,a.periodInfo.duration||Infinity,d));return{timescale:f,segmentDuration:e,startNumber:d,scaledPresentationTimeOffset:h/f||0,unscaledPresentationTimeOffset:h,timeline:g}};shaka.dash.MpdUtils.getNodes=function(a,b){var c=shaka.util.Functional;goog.asserts.assert(b(a.representation),"There must be at least one element of the given type");return[b(a.representation),b(a.adaptationSet),b(a.period)].filter(c.isNotNull)};
1840
+ shaka.dash.MpdUtils.inheritAttribute=function(a,b,c){b=shaka.dash.MpdUtils.getNodes(a,b);a=null;b=$jscomp.makeIterator(b);for(var d=b.next();!d.done&&!(a=d.value.attributes[c]);d=b.next());return a};shaka.dash.MpdUtils.inheritChild=function(a,b,c){var d=shaka.dash.MpdUtils.getNodes(a,b);a=shaka.util.TXml;b=null;d=$jscomp.makeIterator(d);for(var e=d.next();!e.done&&!(b=a.findChild(e.value,c));e=d.next());return b};
1837
1841
  shaka.dash.MpdUtils.handleXlinkInElement_=function(a,b,c,d,e,f){for(var g=shaka.util.TXml,h=shaka.util.Error,k=shaka.util.ManifestParserUtils,l=shaka.dash.MpdUtils.XlinkNamespaceUri_,m=g.getAttributeNS(a,l,"href"),n=g.getAttributeNS(a,l,"actuate")||"onRequest",p=$jscomp.makeIterator(Object.keys(a.attributes)),q=p.next();!q.done;q=p.next()){q=q.value;var r=q.split(":"),v=shaka.util.TXml.getKnownNameSpace(l);r[0]==v&&delete a.attributes[q]}if(5<=f)return shaka.util.AbortableOperation.failed(new h(h.Severity.CRITICAL,
1838
1842
  h.Category.MANIFEST,h.Code.DASH_XLINK_DEPTH_LIMIT));if("onLoad"!=n)return shaka.util.AbortableOperation.failed(new h(h.Severity.CRITICAL,h.Category.MANIFEST,h.Code.DASH_UNSUPPORTED_XLINK_ACTUATE));var x=k.resolveUris([d],[m]);d=shaka.net.NetworkingEngine.RequestType.MANIFEST;k=shaka.net.NetworkingEngine.makeRequest(x,b);d=e.request(d,k);goog.asserts.assert(d instanceof shaka.util.AbortableOperation,"Unexpected implementation of IAbortableOperation!");return d.chain(function(w){w=g.parseXml(w.data,
1839
1843
  a.tagName);if(!w)return shaka.util.AbortableOperation.failed(new h(h.Severity.CRITICAL,h.Category.MANIFEST,h.Code.DASH_INVALID_XML,m));for(a.children=[];w.children.length;){var t=w.children.shift();g.isNode(t)&&(t.parent=a);a.children.push(t)}t=$jscomp.makeIterator(Object.keys(w.attributes));for(var y=t.next();!y.done;y=t.next())y=y.value,a.attributes[y]=w.attributes[y];return shaka.dash.MpdUtils.processXlinks(a,b,c,x[0],e,f+1)})};
@@ -1899,9 +1903,9 @@ a.representation),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.
1899
1903
  shaka.dash.SegmentTemplate.generateSegmentIndexFromIndexTemplate_=function(a,b,c,d){var e=shaka.dash.MpdUtils,f=shaka.util.ManifestParserUtils;goog.asserts.assert(d.indexTemplate,"must be using index template");e=e.fillUriTemplate(d.indexTemplate,a.representation.id,null,null,a.bandwidth||null,null);f=f.resolveUris(a.representation.getBaseUris(),[e]);return shaka.dash.SegmentBase.generateSegmentIndexFromUris(a,b,c,f,0,null,d.scaledPresentationTimeOffset)};
1900
1904
  shaka.dash.SegmentTemplate.generateSegmentIndexFromDuration_=function(a,b,c,d,e,f,g){goog.asserts.assert(b.mediaTemplate,"There should be a media template with duration");var h=shaka.dash.MpdUtils,k=shaka.util.ManifestParserUtils,l=a.presentationTimeline,m=a.periodInfo.start,n=a.period.id,p=a.periodInfo.duration,q=function(){var E=null!=n&&e[n]||p;return E?m+E:Infinity},r=b.segmentDuration;goog.asserts.assert(null!=r,"Segment duration must not be null!");var v=b.startNumber,x=b.timescale,w=b.mediaTemplate,
1901
1905
  t=a.bandwidth||null,y=a.representation.id,u=a.representation.getBaseUris,z=m-b.scaledPresentationTimeOffset,A=function(){var E=[Math.max(l.getSegmentAvailabilityStart(),m),Math.min(l.getSegmentAvailabilityEnd(),q())];goog.asserts.assert(E.every(isFinite),"Available presentation times must be finite!");goog.asserts.assert(E.every(function(I){return 0<=I}),"Available presentation times must be positive!");goog.asserts.assert(null!=r,"Segment duration must not be null!");E=E.map(function(I){return I-
1902
- m});return[Math.ceil(E[0]/r),Math.ceil(E[1]/r)-1].map(function(I){return I+v})},B=A();c=a.dynamic?Math.max(B[0],B[1]-c+1):B[0];g=g||B[1];B=[];var C=function(E){goog.asserts.assert(null!=r,"Segment duration must not be null!");var I=(E-v)*r,K=I+b.scaledPresentationTimeOffset,J=I+m;I=J+r;var M=Math.min(I,q());goog.asserts.assert(J<M,"Generated a segment outside of the period!");J=new shaka.media.SegmentReference(J,M,function(){var L=K*x;"BigInt"in window&&L>Number.MAX_SAFE_INTEGER&&(L=BigInt(K)*BigInt(x));
1903
- L=h.fillUriTemplate(w,y,E,null,t,L);return k.resolveUris(u(),[L])},0,null,d,z,m,q(),[],"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,f);J.codecs=a.representation.codecs;J.mimeType=a.representation.mimeType;J.trueEndTime=I;return J},F=c;for(;F<=g;++F){var D=C(F);B.push(D)}var G=new shaka.media.SegmentIndex(B);B=l.getSegmentAvailabilityEnd()<q();F=l.isLive();if(B||F){var H=Math.max(c,g+1);G.updateEvery(r,function(){var E=l.getSegmentAvailabilityStart();G.evict(E);var I=$jscomp.makeIterator(A());
1904
- I.next();I=I.next().value;for(var K=[];H<=I;){var J=C(H);K.push(J);H++}return E>q()&&!K.length?null:K})}return Promise.resolve(G)};
1906
+ m});E=[Math.ceil(E[0]/r),Math.ceil(E[1]/r)-1];a.representation.availabilityTimeOffset&&E[1]++;return E.map(function(I){return I+v})},B=A();c=a.dynamic?Math.max(B[0],B[1]-c+1):B[0];g=g||B[1];B=[];var C=function(E){goog.asserts.assert(null!=r,"Segment duration must not be null!");var I=(E-v)*r,K=I+b.scaledPresentationTimeOffset,J=I+m;I=J+r;var M=Math.min(I,q());goog.asserts.assert(J<M,"Generated a segment outside of the period!");J=new shaka.media.SegmentReference(J,M,function(){var L=K*x;"BigInt"in
1907
+ window&&L>Number.MAX_SAFE_INTEGER&&(L=BigInt(K)*BigInt(x));L=h.fillUriTemplate(w,y,E,null,t,L);return k.resolveUris(u(),[L])},0,null,d,z,m,q(),[],"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,f);J.codecs=a.representation.codecs;J.mimeType=a.representation.mimeType;J.trueEndTime=I;return J},F=c;for(;F<=g;++F){var D=C(F);B.push(D)}var G=new shaka.media.SegmentIndex(B);B=l.getSegmentAvailabilityEnd()<q();F=l.isLive();if(B||F){var H=Math.max(c,g+1);G.updateEvery(r,function(){var E=l.getSegmentAvailabilityStart();
1908
+ G.evict(E);var I=$jscomp.makeIterator(A());I.next();I=I.next().value;for(var K=[];H<=I;){var J=C(H);K.push(J);H++}return E>q()&&!K.length?null:K})}return Promise.resolve(G)};
1905
1909
  shaka.dash.SegmentTemplate.createInitSegment_=function(a,b){var c=shaka.dash.MpdUtils,d=shaka.util.ManifestParserUtils,e=c.inheritAttribute(a,shaka.dash.SegmentTemplate.fromInheritance_,"initialization");if(!e)return null;e=shaka.util.StringUtils.htmlUnescape(e);var f=a.representation.id,g=a.bandwidth||null,h=a.representation.getBaseUris,k=shaka.dash.SegmentBase.createQualityInfo(a);b=new shaka.media.InitSegmentReference(function(){goog.asserts.assert(e,"Should have returned earler");var l=c.fillUriTemplate(e,
1906
1910
  f,null,null,g,null);return d.resolveUris(h(),[l])},0,null,k,null,null,b);b.codecs=a.representation.codecs;b.mimeType=a.representation.mimeType;return b};shaka.dash.TimelineSegmentIndex=function(a,b,c,d,e,f,g,h,k,l){shaka.media.SegmentIndex.call(this,[]);this.templateInfo_=a;this.representationId_=b;this.bandwidth_=c;this.getBaseUris_=d;this.periodStart_=e;this.periodEnd_=f;this.initSegmentReference_=g;this.aesKey_=k;this.segmentSequenceCadence_=l;h&&this.fitTimeline()};
1907
1911
  $jscomp.inherits(shaka.dash.TimelineSegmentIndex,shaka.media.SegmentIndex);shaka.dash.TimelineSegmentIndex.prototype.getNumReferences=function(){return this.templateInfo_?this.templateInfo_.timeline.length:0};shaka.dash.TimelineSegmentIndex.prototype.release=function(){shaka.media.SegmentIndex.prototype.release.call(this);this.templateInfo_=null};
@@ -3228,8 +3232,8 @@ d.yield(a.video.remote.watchAvailability(b),13);case 13:c=d.yieldResult;a.callba
3228
3232
  shaka.ui.RemoteButton.Factory=function(){};shaka.ui.RemoteButton.Factory.prototype.create=function(a,b){return new shaka.ui.RemoteButton(a,b)};shaka.ui.OverflowMenu.registerElement("remote",new shaka.ui.RemoteButton.Factory);shaka.ui.Controls.registerElement("remote",new shaka.ui.RemoteButton.Factory);shaka.ui.ResolutionSelection=function(a,b){shaka.ui.SettingsMenu.call(this,a,b,shaka.ui.Enums.MaterialDesignIcons.RESOLUTION);var c=this;this.button.classList.add("shaka-resolution-button");this.button.classList.add("shaka-tooltip-status");this.menu.classList.add("shaka-resolutions");this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,function(){c.updateLocalizedStrings_()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,function(){c.updateLocalizedStrings_()});
3229
3233
  this.eventManager.listen(this.player,"variantchanged",function(){c.updateResolutionSelection_()});this.eventManager.listen(this.player,"trackschanged",function(){c.updateResolutionSelection_()});this.eventManager.listen(this.player,"abrstatuschanged",function(){c.updateResolutionSelection_()});this.updateResolutionSelection_()};$jscomp.inherits(shaka.ui.ResolutionSelection,shaka.ui.SettingsMenu);
3230
3234
  shaka.ui.ResolutionSelection.prototype.updateResolutionSelection_=function(){var a=this,b=shaka.ui.Overlay.TrackLabelFormat,c=[];this.player.getLoadMode()!=shaka.Player.LoadMode.SRC_EQUALS&&(c=this.player.getVariantTracks());var d=c.find(function(l){return l.active});d&&(c=c.filter(function(l){if(l.language!=d.language||a.controls.getConfig().showAudioChannelCountVariants&&l.channelsCount!=d.channelsCount)return!1;var m=a.controls.getConfig().trackLabelFormat;return(m==b.ROLE||m==b.LANGUAGE_ROLE)&&
3231
- JSON.stringify(l.audioRoles)!=JSON.stringify(d.audioRoles)||m==b.LABEL&&l.label!=d.label?!1:!0}));c=c.filter(function(l,m){var n=-1;n=a.player.isAudioOnly()?c.findIndex(function(p){return p.bandwidth==l.bandwidth}):c.findIndex(function(p){return p.height==l.height&&p.frameRate==l.frameRate&&p.hdr==l.hdr&&p.videoLayout==l.videoLayout});return n==m});this.player.isAudioOnly()?c.sort(function(l,m){goog.asserts.assert(null!=l.bandwidth,"Null bandwidth");goog.asserts.assert(null!=m.bandwidth,"Null bandwidth");
3232
- return m.bandwidth-l.bandwidth}):c.sort(function(l,m){goog.asserts.assert(null!=l.height,"Null height");goog.asserts.assert(null!=m.height,"Null height");return m.height-l.height});var e=shaka.ui.Utils.getFirstDescendantWithClassName(this.menu,"shaka-back-to-overflow-button");shaka.util.Dom.removeAllChildren(this.menu);this.menu.appendChild(e);e=this.player.getConfiguration().abr.enabled;for(var f={},g=$jscomp.makeIterator(c),h=g.next();!h.done;f={$jscomp$loop$prop$track$993:f.$jscomp$loop$prop$track$993},
3235
+ JSON.stringify(l.audioRoles)!=JSON.stringify(d.audioRoles)||m==b.LABEL&&l.label!=d.label?!1:!0}));c=c.filter(function(l,m){var n=-1;n=a.player.isAudioOnly()?c.findIndex(function(p){return p.bandwidth==l.bandwidth}):c.findIndex(function(p){return p.height==l.height&&p.videoBandwidth==l.videoBandwidth&&p.frameRate==l.frameRate&&p.hdr==l.hdr&&p.videoLayout==l.videoLayout});return n==m});this.player.isAudioOnly()?c.sort(function(l,m){goog.asserts.assert(null!=l.bandwidth,"Null bandwidth");goog.asserts.assert(null!=
3236
+ m.bandwidth,"Null bandwidth");return m.bandwidth-l.bandwidth}):c.sort(function(l,m){goog.asserts.assert(null!=l.height,"Null height");goog.asserts.assert(null!=m.height,"Null height");return m.height-l.height});var e=shaka.ui.Utils.getFirstDescendantWithClassName(this.menu,"shaka-back-to-overflow-button");shaka.util.Dom.removeAllChildren(this.menu);this.menu.appendChild(e);e=this.player.getConfiguration().abr.enabled;for(var f={},g=$jscomp.makeIterator(c),h=g.next();!h.done;f={$jscomp$loop$prop$track$993:f.$jscomp$loop$prop$track$993},
3233
3237
  h=g.next()){f.$jscomp$loop$prop$track$993=h.value;h=shaka.util.Dom.createButton();h.classList.add("explicit-resolution");this.eventManager.listen(h,"click",function(l){return function(){return a.onTrackSelected_(l.$jscomp$loop$prop$track$993)}}(f));var k=shaka.util.Dom.createHTMLElement("span");this.player.isAudioOnly()&&f.$jscomp$loop$prop$track$993.bandwidth?k.textContent=Math.round(f.$jscomp$loop$prop$track$993.bandwidth/1E3)+" kbits/s":k.textContent=f.$jscomp$loop$prop$track$993.height&&f.$jscomp$loop$prop$track$993.width?
3234
3238
  this.getResolutionLabel_(f.$jscomp$loop$prop$track$993):"Unknown";h.appendChild(k);e||f.$jscomp$loop$prop$track$993!=d||(h.ariaSelected="true",h.appendChild(shaka.ui.Utils.checkmarkIcon()),k.classList.add("shaka-chosen-item"),this.currentSelection.textContent=k.textContent);this.menu.appendChild(h)}f=shaka.util.Dom.createButton();f.classList.add("shaka-enable-abr-button");this.eventManager.listen(f,"click",function(){a.player.configure({abr:{enabled:!0}});a.updateResolutionSelection_()});this.abrOnSpan_=
3235
3239
  shaka.util.Dom.createHTMLElement("span");this.abrOnSpan_.classList.add("shaka-auto-span");this.abrOnSpan_.textContent=this.localization.resolve(shaka.ui.Locales.Ids.AUTO_QUALITY);f.appendChild(this.abrOnSpan_);e&&(f.ariaSelected="true",f.appendChild(shaka.ui.Utils.checkmarkIcon()),this.abrOnSpan_.classList.add("shaka-chosen-item"),this.currentSelection.textContent=this.localization.resolve(shaka.ui.Locales.Ids.AUTO_QUALITY));this.button.setAttribute("shaka-status",this.currentSelection.textContent);