shaka-player 4.1.3 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -278,8 +278,9 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
278
278
  "\u5ee3\u544a [AD_ON]/[NUM_ADS]"],["AD_TIME","\u5ee3\u544a\uff1a[AD_TIME]"],["AUTO_QUALITY","\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",
279
279
  "\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN","\u5168\u87a2\u5e55"],["LANGUAGE","\u8a9e\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u74b0\u64ad\u653e"],["MORE_SETTINGS","\u986f\u793a\u66f4\u591a\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u7a2e\u8a9e\u8a00"],["MUTE","\u975c\u97f3"],["NOT_APPLICABLE","\u4e0d\u9069\u7528"],["OFF","\u95dc\u9589"],["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],
280
280
  ["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["RESOLUTION","\u89e3\u6790\u5ea6"],["REWIND","\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]))};
281
- shaka.ui.Locales.Ids={ON:"ON",QUALITY:"QUALITY",AIRPLAY:"AIRPLAY",RESOLUTION:"RESOLUTION",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",NOT_APPLICABLE:"NOT_APPLICABLE",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",PLAYBACK_RATE:"PLAYBACK_RATE",AUTO_QUALITY:"AUTO_QUALITY",LANGUAGE:"LANGUAGE",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",REPLAY:"REPLAY",SKIP_TO_LIVE:"SKIP_TO_LIVE",PAUSE:"PAUSE",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",OFF:"OFF",AD_DURATION:"AD_DURATION",MUTE:"MUTE",SEEK:"SEEK",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",
282
- STATISTICS:"STATISTICS",MORE_SETTINGS:"MORE_SETTINGS",AD_PROGRESS:"AD_PROGRESS",SKIP_AD:"SKIP_AD",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",CAST:"CAST",CAPTIONS:"CAPTIONS",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",VOLUME:"VOLUME",REWIND:"REWIND",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",FAST_FORWARD:"FAST_FORWARD",AD_TIME:"AD_TIME",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",PLAY:"PLAY",UNMUTE:"UNMUTE",SUBTITLE_FORCED:"SUBTITLE_FORCED",BACK:"BACK",LOOP:"LOOP",FULL_SCREEN:"FULL_SCREEN",LIVE:"LIVE"};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);c=b*(1-c)+c*this.estimate_;isNaN(c)||(this.estimate_=c,this.totalWeight_+=a)};
281
+ shaka.ui.Locales.Ids={FULL_SCREEN:"FULL_SCREEN",LIVE:"LIVE",BACK:"BACK",LOOP:"LOOP",QUALITY:"QUALITY",SKIP_AD:"SKIP_AD",OFF:"OFF",PLAYBACK_RATE:"PLAYBACK_RATE",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",AD_TIME:"AD_TIME",LANGUAGE:"LANGUAGE",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",SEEK:"SEEK",ON:"ON",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",MUTE:"MUTE",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",SKIP_TO_LIVE:"SKIP_TO_LIVE",REWIND:"REWIND",
282
+ CAST:"CAST",SUBTITLE_FORCED:"SUBTITLE_FORCED",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",NOT_APPLICABLE:"NOT_APPLICABLE",AIRPLAY:"AIRPLAY",UNMUTE:"UNMUTE",FAST_FORWARD:"FAST_FORWARD",AD_PROGRESS:"AD_PROGRESS",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",AUTO_QUALITY:"AUTO_QUALITY",STATISTICS:"STATISTICS",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",CAPTIONS:"CAPTIONS",AD_DURATION:"AD_DURATION",MORE_SETTINGS:"MORE_SETTINGS",PLAY:"PLAY",VOLUME:"VOLUME",RESOLUTION:"RESOLUTION",REPLAY:"REPLAY",
283
+ PAUSE:"PAUSE"};shaka.abr={};shaka.abr.Ewma=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a);this.totalWeight_=this.estimate_=0};shaka.abr.Ewma.prototype.updateAlpha=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a)};shaka.abr.Ewma.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);c=b*(1-c)+c*this.estimate_;isNaN(c)||(this.estimate_=c,this.totalWeight_+=a)};
283
284
  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)};
284
285
  shaka.abr.EwmaBandwidthEstimator.prototype.sample=function(a,b){if(!(b<this.minBytes_)){var c=8E3*b/a,d=a/1E3;this.bytesSampled_+=b;this.fast_.sample(d,c);this.slow_.sample(d,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.ArrayUtils=function(){};shaka.util.ArrayUtils.defaultEquals=function(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b};shaka.util.ArrayUtils.remove=function(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)};shaka.util.ArrayUtils.count=function(a,b){for(var c=0,d=$jscomp.makeIterator(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};
285
286
  shaka.util.ArrayUtils.hasSameElements=function(a,b,c){c||(c=shaka.util.ArrayUtils.defaultEquals);if(a.length!=b.length)return!1;b=b.slice();var d={};a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;d={$jscomp$loop$prop$item$641:d.$jscomp$loop$prop$item$641},e=a.next()){d.$jscomp$loop$prop$item$641=e.value;e=b.findIndex(function(f){return function(g){return c(f.$jscomp$loop$prop$item$641,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length};
@@ -905,8 +906,8 @@ shaka.text.UITextDisplayer.prototype.getRegionElement_=function(a){var b=a.regio
905
906
  d;c.style.left=b.viewportAnchorX+d;c.style.display="flex";c.style.flexDirection="column";c.style.alignItems="center";c.style.justifyContent=a.displayAlign==shaka.text.Cue.displayAlign.BEFORE?"flex-start":a.displayAlign==shaka.text.Cue.displayAlign.CENTER?"center":"flex-end";this.regionElements_.set(b.id,c);return c};
906
907
  shaka.text.UITextDisplayer.prototype.createCue_=function(a,b){var c=1<b.length,d=c?"span":"div";a.lineBreak&&(d="br");c=!c&&0<a.nestedCues.length;var e=shaka.util.Dom.createHTMLElement(d);"br"!=d&&this.setCaptionStyles_(e,a,b,c);d=null;a.region&&a.region.id&&(d=this.getRegionElement_(a));var f=e;c&&(f=shaka.util.Dom.createHTMLElement("span"),f.classList.add("shaka-text-wrapper"),f.style.backgroundColor=a.backgroundColor,e.appendChild(f));this.currentCuesMap_.set(a,{cueElement:e,wrapper:f,regionElement:d})};
907
908
  shaka.text.UITextDisplayer.prototype.setCaptionStyles_=function(a,b,c,d){var e=shaka.text.Cue,f=a.style,g=0==b.nestedCues.length,h=1<c.length;f.whiteSpace="pre-wrap";var k=b.payload.replace(/\s+$/g,function(m){return"\u00a0".repeat(m.length)});f.webkitTextStrokeColor=b.textStrokeColor;f.webkitTextStrokeWidth=b.textStrokeWidth;f.color=b.color;f.direction=b.direction;f.opacity=b.opacity;f.paddingLeft=shaka.text.UITextDisplayer.convertLengthValue_(b.linePadding,b,this.videoContainer_);f.paddingRight=
908
- shaka.text.UITextDisplayer.convertLengthValue_(b.linePadding,b,this.videoContainer_);f.textShadow=b.textShadow;if(b.backgroundImage)f.backgroundImage="url('"+b.backgroundImage+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center";else{if(b.nestedCues.length)var l=a;else l=shaka.util.Dom.createHTMLElement("span"),a.appendChild(l);b.border&&(l.style.border=b.border);d||((a=shaka.text.UITextDisplayer.inheritProperty_(c,function(m){return m.backgroundColor}))?l.style.backgroundColor=
909
- a:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.textContent=k)}h&&!c[c.length-1].isContainer?f.display="inline":(f.display="flex",f.flexDirection="column",f.alignItems="center",f.justifyContent=b.displayAlign==e.displayAlign.BEFORE?"flex-start":b.displayAlign==e.displayAlign.CENTER?"center":"flex-end");g||(f.margin="0");f.fontFamily=b.fontFamily;f.fontWeight=b.fontWeight.toString();f.fontStyle=b.fontStyle;f.letterSpacing=b.letterSpacing;f.fontSize=shaka.text.UITextDisplayer.convertLengthValue_(b.fontSize,
909
+ shaka.text.UITextDisplayer.convertLengthValue_(b.linePadding,b,this.videoContainer_);f.textShadow=b.textShadow;if(b.backgroundImage)f.backgroundImage="url('"+b.backgroundImage+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",f.width="100%",f.height="100%";else{if(b.nestedCues.length)var l=a;else l=shaka.util.Dom.createHTMLElement("span"),a.appendChild(l);b.border&&(l.style.border=b.border);d||((a=shaka.text.UITextDisplayer.inheritProperty_(c,function(m){return m.backgroundColor}))?
910
+ l.style.backgroundColor=a:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.textContent=k)}h&&!c[c.length-1].isContainer?f.display="inline":(f.display="flex",f.flexDirection="column",f.alignItems="center",f.justifyContent=b.displayAlign==e.displayAlign.BEFORE?"flex-start":b.displayAlign==e.displayAlign.CENTER?"center":"flex-end");g||(f.margin="0");f.fontFamily=b.fontFamily;f.fontWeight=b.fontWeight.toString();f.fontStyle=b.fontStyle;f.letterSpacing=b.letterSpacing;f.fontSize=shaka.text.UITextDisplayer.convertLengthValue_(b.fontSize,
910
911
  b,this.videoContainer_);b.line&&b.lineInterpretation==e.lineInterpretation.PERCENTAGE&&(f.position="absolute",f.left="0",f.top="0",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.width="100%",b.lineAlign==e.lineAlign.START?f.top=b.line+"%":b.lineAlign==e.lineAlign.END&&(f.bottom=b.line+"%")):b.writingMode==e.writingMode.VERTICAL_LEFT_TO_RIGHT?(f.height="100%",b.lineAlign==e.lineAlign.START?f.left=b.line+"%":b.lineAlign==e.lineAlign.END&&(f.right=b.line+"%")):(f.height="100%",b.lineAlign==
911
912
  e.lineAlign.START?f.right=b.line+"%":b.lineAlign==e.lineAlign.END&&(f.left=b.line+"%")));f.lineHeight=b.lineHeight;b.position&&(b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?f.paddingLeft=b.position:f.paddingTop=b.position);b.positionAlign==e.positionAlign.LEFT?f.cssFloat="left":b.positionAlign==e.positionAlign.RIGHT&&(f.cssFloat="right");f.textAlign=b.textAlign;f.textDecoration=b.textDecoration.join(" ");f.writingMode=b.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==
912
913
  b.writingMode||(f.webkitWritingMode=b.writingMode);b.size&&(b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?f.width=b.size+"%":f.height=b.size+"%")};shaka.text.UITextDisplayer.getLengthValueInfo_=function(a){return(a=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(a[1]),unit:a[2]}:null};
@@ -947,7 +948,7 @@ safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSaf
947
948
  h],void 0)},usePersistentLicense:!0,numberOfParallelDownloads:5},f={drm:b,manifest:c,streaming:d,offline:e,abrFactory:function(){return new shaka.abr.SimpleAbrManager},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},advanced:{minTotalBytes:128E3,
948
949
  minBytes:16E3,fastHalfLife:2,slowHalfLife:5}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayFactory:function(){return null},
949
950
  cmcd:{enabled:!1,sessionId:"",contentId:"",useHeaders:!1}};e.trackSelectionCallback=function(g){return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){return h["return"](shaka.util.PlayerConfiguration.defaultTrackSelect(g,f.preferredAudioLanguage))})};return f};
950
- shaka.util.PlayerConfiguration.mergeConfigObjects=function(a,b,c){var d={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return shaka.util.ConfigUtils.mergeConfigObjects(a,b,c||shaka.util.PlayerConfiguration.createDefault(),d,"")};
951
+ shaka.util.PlayerConfiguration.mergeConfigObjects=function(a,b,c){var d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:""}};return shaka.util.ConfigUtils.mergeConfigObjects(a,b,c||shaka.util.PlayerConfiguration.createDefault(),d,"")};
951
952
  shaka.util.PlayerConfiguration.defaultTrackSelect=function(a,b){var c=shaka.util.ManifestParserUtils.ContentType,d=shaka.util.LanguageUtils,e=a.filter(function(l){return"variant"==l.type}),f=[],g=d.findClosestLocale(b,e.map(function(l){return l.language}));g&&(f=e.filter(function(l){return d.normalize(l.language)==g}));0==f.length&&(f=e.filter(function(l){return l.primary}));0==f.length&&(1<(new Set(e.map(function(l){return l.language}))).size&&shaka.log.warning("Could not choose a good audio track based on language preferences or primary tracks. An arbitrary language will be stored!"),
952
953
  f=e);var h=f.filter(function(l){return l.height&&480>=l.height});h.length&&(h.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}),f=h.filter(function(l){return l.height==h[0].height}));e=[];if(f.length){var k=Math.floor(f.length/2);f.sort(function(l,m){return l.bandwidth-m.bandwidth});e.push(f[k])}f=$jscomp.makeIterator(a);for(k=f.next();!k.done;k=f.next())k=k.value,k.type!=c.TEXT&&k.type!=c.IMAGE||e.push(k);
953
954
  return e};goog.exportSymbol("shaka.util.PlayerConfiguration",shaka.util.PlayerConfiguration);goog.exportProperty(shaka.util.PlayerConfiguration,"mergeConfigObjects",shaka.util.PlayerConfiguration.mergeConfigObjects);goog.exportProperty(shaka.util.PlayerConfiguration,"createDefault",shaka.util.PlayerConfiguration.createDefault);shaka.util.StateHistory=function(){this.open_=null;this.closed_=[]};shaka.util.StateHistory.prototype.update=function(a){null==this.open_?this.start_(a):this.update_(a)};shaka.util.StateHistory.prototype.getTimeSpentIn=function(a){var b=0;this.open_&&this.open_.state==a&&(b+=this.open_.duration);for(var c=$jscomp.makeIterator(this.closed_),d=c.next();!d.done;d=c.next())d=d.value,b+=d.state==a?d.duration:0;return b};
@@ -1086,8 +1087,9 @@ shaka.Player.prototype.getPlayheadTimeAsDate=function(){if(!this.isLive())return
1086
1087
  shaka.Player.prototype.getPresentationStartTimeAsDate=function(){if(!this.isLive())return shaka.log.warning("getPresentationStartTimeAsDate is for live streams!"),null;if(this.manifest_){var a=this.manifest_.presentationTimeline.getPresentationStartTime();goog.asserts.assert(null!=a,"Presentation start time should not be null!");return new Date(1E3*a)}if(this.video_&&this.video_.getStartDate)return a=this.video_.getStartDate(),isNaN(a.getTime())?(shaka.log.warning("EXT-X-PROGRAM-DATETIME required to get presentation start time as Date!"),
1087
1088
  null):a;shaka.log.warning("No way to get presentation start time as Date!");return null};shaka.Player.prototype.getBufferedInfo=function(){if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE)return this.mediaSourceEngine_.getBufferedInfo();var a={total:[],audio:[],video:[],text:[]};this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&(a.total=shaka.media.TimeRangesUtils.getBufferedInfo(this.video_.buffered));return a};
1088
1089
  shaka.Player.prototype.getStats=function(){if(this.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&this.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)return shaka.util.Stats.getEmptyBlob();this.updateStateHistory_();goog.asserts.assert(this.video_,"If we have stats, we should have video_");var a=this.video_,b=a.currentTime/a.duration;isNaN(b)||this.stats_.setCompletionPercent(Math.round(100*b));this.playhead_&&(this.stats_.setGapsJumped(this.playhead_.getGapsJumped()),this.stats_.setStallsDetected(this.playhead_.getStallsDetected()));
1089
- a.getVideoPlaybackQuality&&(a=a.getVideoPlaybackQuality(),this.stats_.setDroppedFrames(Number(a.droppedVideoFrames),Number(a.totalVideoFrames)),this.stats_.setCorruptedFrames(Number(a.corruptedVideoFrames)));a=this.drmEngine_?this.drmEngine_.getLicenseTime():NaN;this.stats_.setLicenseTime(a);if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE){if(a=this.streamingEngine_.getCurrentVariant())b=(this.playRateController_?this.playRateController_.getRealRate():1)*a.bandwidth,this.stats_.setCurrentStreamBandwidth(b);
1090
- a&&a.video&&this.stats_.setResolution(a.video.width||NaN,a.video.height||NaN);this.isLive()&&(a=this.getPresentationStartTimeAsDate().valueOf()+1E3*this.seekRange().end,a=(Date.now()-a)/1E3,this.stats_.setLiveLatency(a));this.manifest_&&this.manifest_.presentationTimeline&&(a=this.manifest_.presentationTimeline.getMaxSegmentDuration(),this.stats_.setMaxSegmentDuration(a));a=this.abrManager_.getBandwidthEstimate();this.stats_.setBandwidthEstimate(a)}return this.stats_.getBlob()};
1090
+ a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),this.stats_.setDroppedFrames(Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.stats_.setCorruptedFrames(Number(b.corruptedVideoFrames)));b=this.drmEngine_?this.drmEngine_.getLicenseTime():NaN;this.stats_.setLicenseTime(b);if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE){if(b=this.streamingEngine_.getCurrentVariant()){var c=(this.playRateController_?this.playRateController_.getRealRate():1)*b.bandwidth;this.stats_.setCurrentStreamBandwidth(c)}b&&
1091
+ b.video&&this.stats_.setResolution(b.video.width||NaN,b.video.height||NaN);this.isLive()&&(b=this.getPresentationStartTimeAsDate().valueOf()+1E3*this.seekRange().end,b=(Date.now()-b)/1E3,this.stats_.setLiveLatency(b));this.manifest_&&this.manifest_.presentationTimeline&&(b=this.manifest_.presentationTimeline.getMaxSegmentDuration(),this.stats_.setMaxSegmentDuration(b));b=this.abrManager_.getBandwidthEstimate();this.stats_.setBandwidthEstimate(b)}this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&this.stats_.setResolution(a.videoWidth||
1092
+ NaN,a.videoHeight||NaN);return this.stats_.getBlob()};
1091
1093
  shaka.Player.prototype.addTextTrackAsync=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,p,q,r,t,u,v,x;return $jscomp.asyncExecutePromiseGeneratorProgram(function(w){switch(w.nextAddress){case 1:if(h.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&h.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)throw shaka.log.error("Must call load() and wait for it to resolve before adding text tracks."),new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.CONTENT_NOT_LOADED);
1092
1094
  if(d){w.jumpTo(2);break}return w.yield(h.getTextMimetype_(a),3);case 3:d=w.yieldResult;case 2:k=[];if(h.adManager_)try{k=h.adManager_.getServerSideCuePoints()}catch(y){}if(h.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS){w.jumpTo(4);break}g&&(c="forced");return w.yield(h.addSrcTrackElement_(a,b,c,d,f||"",k),5);case 5:l=h.getTextTracks();if(m=l.find(function(y){return y.language==b&&y.label==(f||"")&&y.kind==c}))return h.onTracksChanged_(),w["return"](m);shaka.log.error("Cannot add this text when loaded with src=");
1093
1095
  throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS);case 4:n=shaka.util.ManifestParserUtils.ContentType;p=h.manifest_.presentationTimeline.getDuration();if(Infinity==p)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM);if(!k.length){w.jumpTo(6);break}goog.asserts.assert(h.networkingEngine_,
@@ -1131,9 +1133,9 @@ shaka.Player.prototype.switch_=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:
1131
1133
  shaka.Player.prototype.onAdaptation_=function(a,b){var c=(new Map).set("oldTrack",a).set("newTrack",b);c=this.makeEvent_(shaka.util.FakeEvent.EventName.Adaptation,c);this.delayDispatchEvent_(c)};shaka.Player.prototype.onTracksChanged_=function(){var a=this.makeEvent_(shaka.util.FakeEvent.EventName.TracksChanged);this.delayDispatchEvent_(a)};
1132
1134
  shaka.Player.prototype.onVariantChanged_=function(a,b){var c=(new Map).set("oldTrack",a).set("newTrack",b);c=this.makeEvent_(shaka.util.FakeEvent.EventName.VariantChanged,c);this.delayDispatchEvent_(c)};shaka.Player.prototype.onTextChanged_=function(){var a=this.makeEvent_(shaka.util.FakeEvent.EventName.TextChanged);this.delayDispatchEvent_(a)};shaka.Player.prototype.onTextTrackVisibility_=function(){var a=this.makeEvent_(shaka.util.FakeEvent.EventName.TextTrackVisibility);this.delayDispatchEvent_(a)};
1133
1135
  shaka.Player.prototype.onAbrStatusChanged_=function(){var a=(new Map).set("newStatus",this.config_.abr.enabled);this.delayDispatchEvent_(this.makeEvent_(shaka.util.FakeEvent.EventName.AbrStatusChanged,a))};
1134
- shaka.Player.prototype.tryToRecoverFromError_=function(a){if(a.code!=shaka.util.Error.Code.HTTP_ERROR&&a.code!=shaka.util.Error.Code.SEGMENT_MISSING||a.category!=shaka.util.Error.Category.NETWORK)return!1;var b=this.config_.streaming.maxDisabledTime;if(0==b)if(a.code==shaka.util.Error.Code.SEGMENT_MISSING)b=1;else return!1;a.code==shaka.util.Error.Code.HTTP_ERROR&&shaka.log.debug("Recoverable NETWORK HTTP_ERROR, trying to recover...");a=this.getVariantTracks().find(function(f){return f.active});goog.asserts.assert(a,
1135
- "Active variant should be found");for(var c=this.manifest_,d=$jscomp.makeIterator(c.variants),e=d.next();!e.done;e=d.next())e=e.value,e.id===a.id&&(e.disabledUntilTime=Date.now()/1E3+b);shaka.util.StreamUtils.applyRestrictions(c.variants,this.config_.restrictions,this.maxHwRes_);a=this.chooseVariant_();if(!a)return shaka.log.warning("Not enough variants to recover from error"),!1;c=this.getBufferedInfo().video.reduce(function(f,g){return f+g.end-g.start},0);this.switchVariant_(a,!1,!0,c);this.checkVariantsTimer_.tickAfter(b);
1136
- return!0};shaka.Player.prototype.onError_=function(a){goog.asserts.assert(a instanceof shaka.util.Error,"Wrong error type!");if(this.loadMode_!=shaka.Player.LoadMode.DESTROYED)if(this.tryToRecoverFromError_(a))a.handled=!0;else{var b=this.makeEvent_(shaka.util.FakeEvent.EventName.Error,(new Map).set("detail",a));this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)}};
1136
+ shaka.Player.prototype.tryToRecoverFromError_=function(a){if(a.code!=shaka.util.Error.Code.HTTP_ERROR&&a.code!=shaka.util.Error.Code.SEGMENT_MISSING||a.category!=shaka.util.Error.Category.NETWORK||!navigator.onLine)return!1;var b=this.config_.streaming.maxDisabledTime;if(0==b)if(a.code==shaka.util.Error.Code.SEGMENT_MISSING)b=1;else return!1;a.code==shaka.util.Error.Code.HTTP_ERROR&&shaka.log.debug("Recoverable NETWORK HTTP_ERROR, trying to recover...");a=this.getVariantTracks().find(function(f){return f.active});
1137
+ goog.asserts.assert(a,"Active variant should be found");for(var c=this.manifest_,d=$jscomp.makeIterator(c.variants),e=d.next();!e.done;e=d.next())e=e.value,e.id===a.id&&(e.disabledUntilTime=Date.now()/1E3+b);shaka.util.StreamUtils.applyRestrictions(c.variants,this.config_.restrictions,this.maxHwRes_);a=this.chooseVariant_();if(!a)return shaka.log.warning("Not enough variants to recover from error"),!1;c=this.getBufferedInfo().video.reduce(function(f,g){return f+g.end-g.start},0);this.switchVariant_(a,
1138
+ !1,!0,c);this.checkVariantsTimer_.tickAfter(b);return!0};shaka.Player.prototype.onError_=function(a){goog.asserts.assert(a instanceof shaka.util.Error,"Wrong error type!");if(this.loadMode_!=shaka.Player.LoadMode.DESTROYED)if(this.tryToRecoverFromError_(a))a.handled=!0;else{var b=this.makeEvent_(shaka.util.FakeEvent.EventName.Error,(new Map).set("detail",a));this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)}};
1137
1139
  shaka.Player.prototype.onRegionEvent_=function(a,b){var c={schemeIdUri:b.schemeIdUri,value:b.value,startTime:b.startTime,endTime:b.endTime,id:b.id,eventElement:b.eventElement};c=(new Map).set("detail",c);this.dispatchEvent(this.makeEvent_(a,c))};
1138
1140
  shaka.Player.prototype.onMediaQualityChange_=function(a,b){var c={bandwidth:a.bandwidth,audioSamplingRate:a.audioSamplingRate,codecs:a.codecs,contentType:a.contentType,frameRate:a.frameRate,height:a.height,mimeType:a.mimeType,channelsCount:a.channelsCount,pixelAspectRatio:a.pixelAspectRatio,width:a.width};c=(new Map).set("mediaQuality",c).set("position",b);this.dispatchEvent(this.makeEvent_(shaka.util.FakeEvent.EventName.MediaQualityChanged,c))};
1139
1141
  shaka.Player.prototype.videoErrorToShakaError_=function(){goog.asserts.assert(this.video_.error,"Video error expected, but missing!");if(!this.video_.error)return null;var a=this.video_.error.code;if(1==a)return null;var b=this.video_.error.msExtendedCode;b&&(0>b&&(b+=Math.pow(2,32)),b=b.toString(16));return new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MEDIA,shaka.util.Error.Code.VIDEO_ERROR,a,b,this.video_.error.message)};
@@ -1167,7 +1169,7 @@ goog.exportProperty(shaka.Player.prototype,"goToLive",shaka.Player.prototype.goT
1167
1169
  goog.exportProperty(shaka.Player.prototype,"getAdManager",shaka.Player.prototype.getAdManager);goog.exportProperty(shaka.Player.prototype,"getAssetUri",shaka.Player.prototype.getAssetUri);goog.exportProperty(shaka.Player.prototype,"getNetworkingEngine",shaka.Player.prototype.getNetworkingEngine);goog.exportProperty(shaka.Player.prototype,"getMediaElement",shaka.Player.prototype.getMediaElement);goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.getLoadMode);
1168
1170
  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,"load",shaka.Player.prototype.load);
1169
1171
  goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);
1170
- goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.1.3-debug";
1172
+ goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.1.4-debug";
1171
1173
  goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.restrictedStatuses_=["output-restricted","internal-error"];shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
1172
1174
  shaka.Player.SRC_EQUAL_EXTENSIONS_TO_MIME_TYPES_={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"};
1173
1175
  shaka.Player.TEXT_EXTENSIONS_TO_MIME_TYPES_={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};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_++};