shaka-player 4.9.16 → 4.9.17

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.
@@ -331,9 +331,9 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
331
331
  "\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",
332
332
  "\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"],
333
333
  ["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"]]))};
334
- shaka.ui.Locales.Ids={RESOLUTION:"RESOLUTION",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",SKIP_AD:"SKIP_AD",QUALITY:"QUALITY",AD_STATISTICS:"AD_STATISTICS",NOT_APPLICABLE:"NOT_APPLICABLE",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",CAST:"CAST",REWIND:"REWIND",STATISTICS:"STATISTICS",MORE_SETTINGS:"MORE_SETTINGS",RECENTER_VR:"RECENTER_VR",AUTO_QUALITY:"AUTO_QUALITY",FAST_FORWARD:"FAST_FORWARD",AD_DURATION:"AD_DURATION",LOOP:"LOOP",
335
- UNMUTE:"UNMUTE",PLAYBACK_RATE:"PLAYBACK_RATE",AD_PROGRESS:"AD_PROGRESS",SKIP_TO_LIVE:"SKIP_TO_LIVE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",OFF:"OFF",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",SUBTITLE_FORCED:"SUBTITLE_FORCED",LIVE:"LIVE",MUTE:"MUTE",PAUSE:"PAUSE",ON:"ON",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",REPLAY:"REPLAY",PLAY:"PLAY",SURROUND:"SURROUND",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",LANGUAGE:"LANGUAGE",AD_TIME:"AD_TIME",FULL_SCREEN:"FULL_SCREEN",BACK:"BACK",CAPTIONS:"CAPTIONS",
336
- EXIT_LOOP_MODE:"EXIT_LOOP_MODE",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",SEEK:"SEEK",VOLUME:"VOLUME",AIRPLAY:"AIRPLAY"};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)};
334
+ shaka.ui.Locales.Ids={PLAY:"PLAY",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",MUTE:"MUTE",LANGUAGE:"LANGUAGE",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",QUALITY:"QUALITY",SUBTITLE_FORCED:"SUBTITLE_FORCED",AD_DURATION:"AD_DURATION",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",NOT_APPLICABLE:"NOT_APPLICABLE",LIVE:"LIVE",AUTO_QUALITY:"AUTO_QUALITY",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",SURROUND:"SURROUND",LOOP:"LOOP",RECENTER_VR:"RECENTER_VR",CAPTIONS:"CAPTIONS",
335
+ STATISTICS:"STATISTICS",RESOLUTION:"RESOLUTION",REPLAY:"REPLAY",PLAYBACK_RATE:"PLAYBACK_RATE",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",FAST_FORWARD:"FAST_FORWARD",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",AD_STATISTICS:"AD_STATISTICS",AD_TIME:"AD_TIME",REWIND:"REWIND",OFF:"OFF",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",FULL_SCREEN:"FULL_SCREEN",SKIP_AD:"SKIP_AD",VOLUME:"VOLUME",AD_PROGRESS:"AD_PROGRESS",CAST:"CAST",UNMUTE:"UNMUTE",BACK:"BACK",SEEK:"SEEK",
336
+ EXIT_LOOP_MODE:"EXIT_LOOP_MODE",PAUSE:"PAUSE",MORE_SETTINGS:"MORE_SETTINGS",ON:"ON",SKIP_TO_LIVE:"SKIP_TO_LIVE",AIRPLAY:"AIRPLAY"};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)};
337
337
  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)};
338
338
  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)};
339
339
  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()}};
@@ -806,8 +806,8 @@ shaka.lcevc.Dec.prototype.isSupported_=function(){"undefined"===typeof libDPIMod
806
806
  typeof this.lcevcLib_.SupportObject)return shaka.log.alwaysWarn("Could not find LCEVC Library on this page"),!1;this.lcevcLib_.SupportObject.SupportStatus||shaka.log.alwaysWarn(this.lcevcLib_.SupportObject.SupportError);return"undefined"!==typeof this.lcevcLib_&&"undefined"!==typeof libDPIModule&&this.canvas_ instanceof HTMLCanvasElement&&this.lcevcLib_.SupportObject.SupportStatus};
807
807
  shaka.lcevc.Dec.prototype.updateVariant=function(a,b){var c=shaka.lcevc.Dec.ContainerFormat.MPEG2_TS,d=shaka.lcevc.Dec.StreamingFormat.OTHER;switch(a.mimeType){case "video/webm":c=shaka.lcevc.Dec.ContainerFormat.WEBM;break;case "video/mp4":c=shaka.lcevc.Dec.ContainerFormat.MP4}switch(b){case "DASH":d=shaka.lcevc.Dec.StreamingFormat.DASH;break;case "HLS":d=shaka.lcevc.Dec.StreamingFormat.HLS}this.dec_&&(this.variantId_=a.id,this.dec_.setLevelSwitching(a.id,!0),this.dec_.setContainerFormat(c),this.toBeDeprecated_||
808
808
  this.dec_.setStreamingFormat(d))};goog.exportSymbol("shaka.lcevc.Dec",shaka.lcevc.Dec);goog.exportProperty(shaka.lcevc.Dec.prototype,"release",shaka.lcevc.Dec.prototype.release);shaka.lcevc.Dec.ContainerFormat={MPEG2_TS:0,WEBM:1,MP4:2};shaka.lcevc.Dec.StreamingFormat={HLS:0,DASH:1,OTHER:-1};shaka.media.MediaSourceEngine=function(a,b,c,d){var e=this;this.video_=a;this.playerInterface_=c;this.config_=null;this.textDisplayer_=b;this.sourceBuffers_={};this.sourceBufferTypes_={};this.expectedEncryption_={};this.textEngine_=null;this.segmentRelativeVttTiming_=!1;this.lcevcDec_=d||null;this.queues_={};this.eventManager_=new shaka.util.EventManager;this.transmuxers_={};this.captionParser_=null;this.mediaSourceOpen_=new shaka.util.PublicPromise;this.url_="";this.playbackHasBegun_=!1;this.mediaSource_=
809
- this.createMediaSource(this.mediaSourceOpen_);this.reloadingMediaSource_=!1;this.destroyer_=new shaka.util.Destroyer(function(){return e.doDestroy_()});this.sequenceMode_=!1;this.manifestType_=shaka.media.ManifestParser.UNKNOWN;this.attemptTimestampOffsetCalculation_=this.ignoreManifestTimestampsInSegmentsMode_=!1;this.textSequenceModeOffset_=new shaka.util.PublicPromise;this.needSplitMuxedContent_=!1;this.streamingAllowed_=!0;this.firstAudioTimestamp_=this.firstVideoTimestamp_=this.tsParser_=this.lastDuration_=
810
- null;this.audioCompensation_=new shaka.util.PublicPromise};
809
+ this.createMediaSource(this.mediaSourceOpen_);this.reloadingMediaSource_=!1;this.destroyer_=new shaka.util.Destroyer(function(){return e.doDestroy_()});this.sequenceMode_=!1;this.manifestType_=shaka.media.ManifestParser.UNKNOWN;this.attemptTimestampOffsetCalculation_=this.ignoreManifestTimestampsInSegmentsMode_=!1;this.textSequenceModeOffset_=new shaka.util.PublicPromise;this.needSplitMuxedContent_=!1;this.streamingAllowed_=!0;this.firstAudioReferenceStartTime_=this.firstAudioTimestamp_=this.firstVideoReferenceStartTime_=
810
+ this.firstVideoTimestamp_=this.tsParser_=this.lastDuration_=null;this.audioCompensation_=new shaka.util.PublicPromise};
811
811
  shaka.media.MediaSourceEngine.prototype.createMediaSource=function(a){var b=this;if(window.ManagedMediaSource){this.video_.disableRemotePlayback=!0;var c=new ManagedMediaSource;this.eventManager_.listen(c,"startstreaming",function(){b.streamingAllowed_=!0});this.eventManager_.listen(c,"endstreaming",function(){b.streamingAllowed_=!1});this.eventManager_.listenOnce(c,"sourceopen",function(){return b.onSourceOpen_(a)});this.eventManager_.listenOnce(this.video_,"playing",function(){b.playbackHasBegun_=
812
812
  !0});this.url_=shaka.media.MediaSourceEngine.createObjectURL(c);this.video_.src=this.url_;return c}c=new MediaSource;this.eventManager_.listenOnce(c,"sourceopen",function(){return b.onSourceOpen_(a)});this.eventManager_.listenOnce(this.video_,"playing",function(){b.playbackHasBegun_=!0});this.url_=shaka.media.MediaSourceEngine.createObjectURL(c);this.video_.src=this.url_;return c};
813
813
  shaka.media.MediaSourceEngine.prototype.onSourceOpen_=function(a){goog.asserts.assert(this.url_,"Must have object URL");URL.revokeObjectURL(this.url_);a.resolve()};
@@ -836,12 +836,12 @@ c&&0==c.timestampOffset&&c.initSegmentReference&&c.initSegmentReference.timescal
836
836
  shaka.util.TsParser.probe(g)&&(this.tsParser_?this.tsParser_.clearData():this.tsParser_=new shaka.util.TsParser,g=this.tsParser_.parse(g),a=g.getStartTime(a),null!=a&&(f=a),g=g.getMetadata(),g.length))this.playerInterface_.onMetadata(g,e,c?c.endTime:null);return f};
837
837
  shaka.media.MediaSourceEngine.prototype.appendBuffer=function(a,b,c,d,e,f,g,h,k){f=void 0===f?!1:f;g=void 0===g?!1:g;h=void 0===h?!1:h;k=void 0===k?!1:k;var l=this,m,n,p,q,r,t,y,u,w,x,v,z,B,A,C,E,I,G,F;return $jscomp.asyncExecutePromiseGeneratorProgram(function(D){switch(D.nextAddress){case 1:m=shaka.util.ManifestParserUtils.ContentType;if(a!=m.TEXT){D.jumpTo(2);break}if(!l.sequenceMode_){D.jumpTo(3);break}return D.yield(l.textSequenceModeOffset_,4);case 4:n=D.yieldResult,l.textEngine_.setTimestampOffset(n);
838
838
  case 3:return D.yield(l.textEngine_.appendBuffer(b,c?c.startTime:null,c?c.endTime:null,c?c.getUris()[0]:null),5);case 5:return D.return();case 2:if(k||!l.needSplitMuxedContent_){D.jumpTo(6);break}return D.yield(l.appendBuffer(m.AUDIO,b,c,d,e,f,g,h,!0),7);case 7:return D.yield(l.appendBuffer(m.VIDEO,b,c,d,e,f,g,h,!0),8);case 8:return D.return();case 6:if(!l.sourceBuffers_[a])return shaka.log.warning("Attempted to restore a non-existent source buffer"),D.return();p=l.sourceBuffers_[a].timestampOffset;
839
- q=l.sourceBufferTypes_[a];l.transmuxers_[a]&&(q=l.transmuxers_[a].getOriginalMimeType());c&&(r=l.getTimestampAndDispatchMetadata_(a,b,c,q,p),null!=r&&(null==l.firstVideoTimestamp_&&a==m.VIDEO&&(l.firstVideoTimestamp_=r,null!=l.firstAudioTimestamp_&&(t=l.firstVideoTimestamp_-l.firstAudioTimestamp_,l.audioCompensation_.resolve(t))),null==l.firstAudioTimestamp_&&a==m.AUDIO&&(l.firstAudioTimestamp_=r,null!=l.firstVideoTimestamp_&&(y=l.firstVideoTimestamp_-l.firstAudioTimestamp_,l.audioCompensation_.resolve(y))),
840
- u=c.startTime-r,w=Math.abs(p-u),(.001<=w||f||g)&&(!h||0<u||!p)&&(p=u,l.attemptTimestampOffsetCalculation_&&(l.enqueueOperation_(a,function(){return l.abort_(a)},null),l.enqueueOperation_(a,function(){return l.setTimestampOffset_(a,p)},null))),x=a==m.VIDEO||!(m.VIDEO in l.sourceBuffers_),l.sequenceMode_&&x&&l.textSequenceModeOffset_.resolve(p)));e&&a==m.VIDEO&&(l.textEngine_||l.reinitText(shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE,l.sequenceMode_,!1),l.captionParser_||(v=q.split(";",1)[0],
841
- l.captionParser_=l.getCaptionParser(v)),c?(z=l.captionParser_.parseFrom(b),z.length&&l.textEngine_.storeAndAppendClosedCaptions(z,c.startTime,c.endTime,p)):l.captionParser_.init(b,g));if(!l.transmuxers_[a]){D.jumpTo(9);break}return D.yield(l.transmuxers_[a].transmux(b,d,c,l.mediaSource_.duration,a),10);case 10:b=D.yieldResult;case 9:b=l.workAroundBrokenPlatforms_(b,c?c.startTime:null,a,c?c.getUris()[0]:null);if(!c||!l.sequenceMode_||a==m.TEXT){D.jumpTo(11);break}if(!f&&!g){D.jumpTo(11);break}B=c.startTime;
842
- if(l.manifestType_!=shaka.media.ManifestParser.HLS||l.needSplitMuxedContent_||a!=m.AUDIO||!l.sourceBuffers_[m.VIDEO]){D.jumpTo(13);break}return D.yield(l.audioCompensation_,14);case 14:A=D.yieldResult,.1<Math.abs(A)&&(B-=A);case 13:l.enqueueOperation_(a,function(){return l.abort_(a)},null),l.enqueueOperation_(a,function(){return l.setTimestampOffset_(a,B)},null);case 11:return C=null,D.yield(l.enqueueOperation_(a,function(){goog.DEBUG&&c&&!c.isPreload()&&!h&&(C=l.getBuffered_(a));l.append_(a,b,p)},
843
- c?c.getUris()[0]:null),15);case 15:goog.DEBUG&&c&&!c.isPreload()&&!h&&(E=l.getBuffered_(a),I=shaka.media.TimeRangesUtils.computeAddedRange(C,E))&&(G=c.endTime-c.startTime,F=Math.abs(I.end-c.endTime),.1<G&&F>G/2&&shaka.log.error("Possible encoding problem detected!","Unexpected buffered range for reference",c,"from URIs",c.getUris(),"should be",{start:c.startTime,end:c.endTime},"but got",I)),D.jumpToEnd()}})};
844
- shaka.media.MediaSourceEngine.prototype.setSelectedClosedCaptionId=function(a){var b=this.bufferEnd(shaka.util.ManifestParserUtils.ContentType.VIDEO)||0;this.textEngine_.setSelectedClosedCaptionId(a,b)};shaka.media.MediaSourceEngine.prototype.clearSelectedClosedCaptionId=function(){this.textEngine_&&this.textEngine_.setSelectedClosedCaptionId("",0)};
839
+ q=l.sourceBufferTypes_[a];l.transmuxers_[a]&&(q=l.transmuxers_[a].getOriginalMimeType());c&&(r=l.getTimestampAndDispatchMetadata_(a,b,c,q,p),null!=r&&(null==l.firstVideoTimestamp_&&a==m.VIDEO&&(l.firstVideoTimestamp_=r,l.firstVideoReferenceStartTime_=c.startTime,null!=l.firstAudioTimestamp_&&(t=0,l.firstVideoReferenceStartTime_==l.firstAudioReferenceStartTime_&&(t=l.firstVideoTimestamp_-l.firstAudioTimestamp_),l.audioCompensation_.resolve(t))),null==l.firstAudioTimestamp_&&a==m.AUDIO&&(l.firstAudioTimestamp_=
840
+ r,l.firstAudioReferenceStartTime_=c.startTime,null!=l.firstVideoTimestamp_&&(y=0,l.firstVideoReferenceStartTime_==l.firstAudioReferenceStartTime_&&(y=l.firstVideoTimestamp_-l.firstAudioTimestamp_),l.audioCompensation_.resolve(y))),u=c.startTime-r,w=Math.abs(p-u),(.001<=w||f||g)&&(!h||0<u||!p)&&(p=u,l.attemptTimestampOffsetCalculation_&&(l.enqueueOperation_(a,function(){return l.abort_(a)},null),l.enqueueOperation_(a,function(){return l.setTimestampOffset_(a,p)},null))),x=a==m.VIDEO||!(m.VIDEO in l.sourceBuffers_),
841
+ l.sequenceMode_&&x&&l.textSequenceModeOffset_.resolve(p)));e&&a==m.VIDEO&&(l.textEngine_||l.reinitText(shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE,l.sequenceMode_,!1),l.captionParser_||(v=q.split(";",1)[0],l.captionParser_=l.getCaptionParser(v)),c?(z=l.captionParser_.parseFrom(b),z.length&&l.textEngine_.storeAndAppendClosedCaptions(z,c.startTime,c.endTime,p)):l.captionParser_.init(b,g));if(!l.transmuxers_[a]){D.jumpTo(9);break}return D.yield(l.transmuxers_[a].transmux(b,d,c,l.mediaSource_.duration,
842
+ a),10);case 10:b=D.yieldResult;case 9:b=l.workAroundBrokenPlatforms_(b,c?c.startTime:null,a,c?c.getUris()[0]:null);if(!c||!l.sequenceMode_||a==m.TEXT){D.jumpTo(11);break}if(!f&&!g){D.jumpTo(11);break}B=c.startTime;if(l.manifestType_!=shaka.media.ManifestParser.HLS||l.needSplitMuxedContent_||a!=m.AUDIO||!l.sourceBuffers_[m.VIDEO]){D.jumpTo(13);break}return D.yield(l.audioCompensation_,14);case 14:A=D.yieldResult,.1<Math.abs(A)&&(B-=A);case 13:l.enqueueOperation_(a,function(){return l.abort_(a)},null),
843
+ l.enqueueOperation_(a,function(){return l.setTimestampOffset_(a,B)},null);case 11:return C=null,D.yield(l.enqueueOperation_(a,function(){goog.DEBUG&&c&&!c.isPreload()&&!h&&(C=l.getBuffered_(a));l.append_(a,b,p)},c?c.getUris()[0]:null),15);case 15:goog.DEBUG&&c&&!c.isPreload()&&!h&&(E=l.getBuffered_(a),I=shaka.media.TimeRangesUtils.computeAddedRange(C,E))&&(G=c.endTime-c.startTime,F=Math.abs(I.end-c.endTime),.1<G&&F>G/2&&shaka.log.error("Possible encoding problem detected!","Unexpected buffered range for reference",
844
+ c,"from URIs",c.getUris(),"should be",{start:c.startTime,end:c.endTime},"but got",I)),D.jumpToEnd()}})};shaka.media.MediaSourceEngine.prototype.setSelectedClosedCaptionId=function(a){var b=this.bufferEnd(shaka.util.ManifestParserUtils.ContentType.VIDEO)||0;this.textEngine_.setSelectedClosedCaptionId(a,b)};shaka.media.MediaSourceEngine.prototype.clearSelectedClosedCaptionId=function(){this.textEngine_&&this.textEngine_.setSelectedClosedCaptionId("",0)};
845
845
  shaka.media.MediaSourceEngine.prototype.remove=function(a,b,c){var d=this,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){return 1==f.nextAddress?(e=shaka.util.ManifestParserUtils.ContentType,a==e.TEXT?f.yield(d.textEngine_.remove(b,c),0):f.yield(d.enqueueOperation_(a,function(){return d.remove_(a,b,c)},null),4)):d.needSplitMuxedContent_?f.yield(d.enqueueOperation_(e.AUDIO,function(){return d.remove_(e.AUDIO,b,c)},null),0):f.jumpTo(0)})};
846
846
  shaka.media.MediaSourceEngine.prototype.clear=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){return 1==d.nextAddress?(c=shaka.util.ManifestParserUtils.ContentType,a==c.TEXT?b.textEngine_?d.yield(b.textEngine_.remove(0,Infinity),0):d.return():d.yield(b.enqueueOperation_(a,function(){return b.remove_(a,0,b.mediaSource_.duration)},null),4)):b.needSplitMuxedContent_?d.yield(b.enqueueOperation_(c.AUDIO,function(){return b.remove_(c.AUDIO,0,b.mediaSource_.duration)},
847
847
  null),0):d.jumpTo(0)})};shaka.media.MediaSourceEngine.prototype.resetCaptionParser=function(){this.captionParser_&&this.captionParser_.reset()};
@@ -1186,15 +1186,16 @@ shaka.text.Utils.flattenPayload_=function(a,b){if(a.lineBreak)return"\n";if(a.ne
1186
1186
  shaka.text.Utils.getColorName_=function(a){a=a.toLowerCase();var b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&7<a.length&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";
1187
1187
  case "yellow":case "#ff0":case "#ffff00":return"yellow";case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null};
1188
1188
  shaka.text.Utils.getCuesToFlatten=function(a,b){var c=[];a=$jscomp.makeIterator(shaka.text.Utils.removeDuplicates(a));for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.isContainer)c.push.apply(c,$jscomp.arrayFromIterable(shaka.text.Utils.getCuesToFlatten(d.nestedCues,d)));else{var e=d.clone();e.nestedCues=[];e.payload=shaka.text.Utils.flattenPayload_(d,b);c.push(e)}return c};
1189
- shaka.text.Utils.removeDuplicates=function(a){var b=[],c={};a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;c={$jscomp$loop$prop$cue$985:c.$jscomp$loop$prop$cue$985},d=a.next())c.$jscomp$loop$prop$cue$985=d.value,b.some(function(e){return function(f){return shaka.text.Cue.equal(e.$jscomp$loop$prop$cue$985,f)}}(c))||b.push(c.$jscomp$loop$prop$cue$985);return b};shaka.text.SimpleTextDisplayer=function(a,b){this.textTrack_=null;for(var c=$jscomp.makeIterator(Array.from(a.textTracks)),d=c.next();!d.done;d=c.next())d=d.value,"metadata"!==d.kind&&"chapters"!==d.kind&&(d.mode="disabled",d.label==b&&(this.textTrack_=d));this.textTrack_||(this.textTrack_=a.addTextTrack("subtitles",b));this.textTrack_.mode="hidden"};shaka.text.SimpleTextDisplayer.prototype.configure=function(a){};
1189
+ shaka.text.Utils.removeDuplicates=function(a){var b=[],c={};a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;c={$jscomp$loop$prop$cue$985:c.$jscomp$loop$prop$cue$985},d=a.next())c.$jscomp$loop$prop$cue$985=d.value,b.some(function(e){return function(f){return shaka.text.Cue.equal(e.$jscomp$loop$prop$cue$985,f)}}(c))||b.push(c.$jscomp$loop$prop$cue$985);return b};
1190
+ shaka.text.Utils.mapShakaCueToNativeCue=function(a){if(a.startTime>=a.endTime)return shaka.log.warning("Invalid cue times: "+a.startTime+" - "+a.endTime),null;var b=shaka.text.Cue,c=new VTTCue(a.startTime,a.endTime,a.payload),d=function(e){for(var f=5381,g=e.length;g;)f=33*f^e.charCodeAt(--g);return(f>>>0).toString()};c.id=d(a.startTime.toString())+d(a.endTime.toString())+d(a.payload);c.lineAlign=a.lineAlign;c.positionAlign=a.positionAlign;a.size&&(c.size=a.size);try{c.align=a.textAlign}catch(e){}"center"==
1191
+ a.textAlign&&"center"!=c.align&&(c.align="middle");a.writingMode==b.writingMode.VERTICAL_LEFT_TO_RIGHT?c.vertical="lr":a.writingMode==b.writingMode.VERTICAL_RIGHT_TO_LEFT&&(c.vertical="rl");a.lineInterpretation==b.lineInterpretation.PERCENTAGE&&(c.snapToLines=!1);null!=a.line&&(c.line=a.line);null!=a.position&&(c.position=a.position);return c};shaka.text.SimpleTextDisplayer=function(a,b){this.textTrack_=null;for(var c=$jscomp.makeIterator(Array.from(a.textTracks)),d=c.next();!d.done;d=c.next())d=d.value,"metadata"!==d.kind&&"chapters"!==d.kind&&(d.mode="disabled",d.label==b&&(this.textTrack_=d));this.textTrack_||(this.textTrack_=a.addTextTrack("subtitles",b));this.textTrack_.mode="hidden"};shaka.text.SimpleTextDisplayer.prototype.configure=function(a){};
1190
1192
  shaka.text.SimpleTextDisplayer.prototype.remove=function(a,b){if(!this.textTrack_)return!1;shaka.text.SimpleTextDisplayer.removeWhere_(this.textTrack_,function(c){return c.startTime<b&&c.endTime>a});return!0};
1191
1193
  shaka.text.SimpleTextDisplayer.prototype.append=function(a){var b=shaka.text.Utils.getCuesToFlatten(a),c=[];a=this.textTrack_.cues?Array.from(this.textTrack_.cues):[];var d={};b=$jscomp.makeIterator(b);for(var e=b.next();!e.done;d={$jscomp$loop$prop$inCue$987:d.$jscomp$loop$prop$inCue$987},e=b.next())d.$jscomp$loop$prop$inCue$987=e.value,a.some(function(f){return function(g){return g.startTime==f.$jscomp$loop$prop$inCue$987.startTime&&g.endTime==f.$jscomp$loop$prop$inCue$987.endTime&&g.text==f.$jscomp$loop$prop$inCue$987.payload?
1192
- !0:!1}}(d))||(e=shaka.text.SimpleTextDisplayer.convertToTextTrackCue_(d.$jscomp$loop$prop$inCue$987))&&c.push(e);a=c.slice().sort(function(f,g){return f.startTime!=g.startTime?f.startTime-g.startTime:f.endTime!=g.endTime?f.endTime-g.startTime:"line"in VTTCue.prototype?c.indexOf(g)-c.indexOf(f):c.indexOf(f)-c.indexOf(g)});a=$jscomp.makeIterator(a);for(d=a.next();!d.done;d=a.next())this.textTrack_.addCue(d.value)};
1194
+ !0:!1}}(d))||(e=shaka.text.Utils.mapShakaCueToNativeCue(d.$jscomp$loop$prop$inCue$987))&&c.push(e);a=c.slice().sort(function(f,g){return f.startTime!=g.startTime?f.startTime-g.startTime:f.endTime!=g.endTime?f.endTime-g.startTime:"line"in VTTCue.prototype?c.indexOf(g)-c.indexOf(f):c.indexOf(f)-c.indexOf(g)});a=$jscomp.makeIterator(a);for(d=a.next();!d.done;d=a.next())this.textTrack_.addCue(d.value)};
1193
1195
  shaka.text.SimpleTextDisplayer.prototype.destroy=function(){this.textTrack_&&(shaka.text.SimpleTextDisplayer.removeWhere_(this.textTrack_,function(a){return!0}),this.textTrack_.mode="disabled");this.textTrack_=null;return Promise.resolve()};shaka.text.SimpleTextDisplayer.prototype.isTextVisible=function(){return"showing"==this.textTrack_.mode};shaka.text.SimpleTextDisplayer.prototype.setTextVisibility=function(a){this.textTrack_.mode=a?"showing":"hidden"};
1194
- shaka.text.SimpleTextDisplayer.convertToTextTrackCue_=function(a){if(a.startTime>=a.endTime)return shaka.log.warning("Invalid cue times: "+a.startTime+" - "+a.endTime),null;var b=shaka.text.Cue,c=new VTTCue(a.startTime,a.endTime,a.payload);c.lineAlign=a.lineAlign;c.positionAlign=a.positionAlign;a.size&&(c.size=a.size);try{c.align=a.textAlign}catch(d){}"center"==a.textAlign&&"center"!=c.align&&(c.align="middle");a.writingMode==b.writingMode.VERTICAL_LEFT_TO_RIGHT?c.vertical="lr":a.writingMode==b.writingMode.VERTICAL_RIGHT_TO_LEFT&&
1195
- (c.vertical="rl");a.lineInterpretation==b.lineInterpretation.PERCENTAGE&&(c.snapToLines=!1);null!=a.line&&(c.line=a.line);null!=a.position&&(c.position=a.position);return c};shaka.text.SimpleTextDisplayer.removeWhere_=function(a,b){var c=a.mode,d="showing"==c?"showing":"hidden";a.mode=d;goog.asserts.assert(a.cues,'Cues should be accessible when mode is set to "'+d+'".');d=$jscomp.makeIterator(Array.from(a.cues));for(var e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c};
1196
- goog.exportSymbol("shaka.text.SimpleTextDisplayer",shaka.text.SimpleTextDisplayer);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"setTextVisibility",shaka.text.SimpleTextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"isTextVisible",shaka.text.SimpleTextDisplayer.prototype.isTextVisible);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"destroy",shaka.text.SimpleTextDisplayer.prototype.destroy);
1197
- goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"append",shaka.text.SimpleTextDisplayer.prototype.append);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"remove",shaka.text.SimpleTextDisplayer.prototype.remove);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"configure",shaka.text.SimpleTextDisplayer.prototype.configure);shaka.text.StubTextDisplayer=function(){};shaka.text.StubTextDisplayer.prototype.configure=function(a){};shaka.text.StubTextDisplayer.prototype.remove=function(a,b){};shaka.text.StubTextDisplayer.prototype.append=function(a){};shaka.text.StubTextDisplayer.prototype.destroy=function(){};shaka.text.StubTextDisplayer.prototype.isTextVisible=function(){return!1};shaka.text.StubTextDisplayer.prototype.setTextVisibility=function(a){};goog.exportSymbol("shaka.text.StubTextDisplayer",shaka.text.StubTextDisplayer);
1196
+ shaka.text.SimpleTextDisplayer.removeWhere_=function(a,b){var c=a.mode,d="showing"==c?"showing":"hidden";a.mode=d;goog.asserts.assert(a.cues,'Cues should be accessible when mode is set to "'+d+'".');d=$jscomp.makeIterator(Array.from(a.cues));for(var e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c};goog.exportSymbol("shaka.text.SimpleTextDisplayer",shaka.text.SimpleTextDisplayer);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"setTextVisibility",shaka.text.SimpleTextDisplayer.prototype.setTextVisibility);
1197
+ goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"isTextVisible",shaka.text.SimpleTextDisplayer.prototype.isTextVisible);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"destroy",shaka.text.SimpleTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"append",shaka.text.SimpleTextDisplayer.prototype.append);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"remove",shaka.text.SimpleTextDisplayer.prototype.remove);
1198
+ goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"configure",shaka.text.SimpleTextDisplayer.prototype.configure);shaka.text.StubTextDisplayer=function(){};shaka.text.StubTextDisplayer.prototype.configure=function(a){};shaka.text.StubTextDisplayer.prototype.remove=function(a,b){};shaka.text.StubTextDisplayer.prototype.append=function(a){};shaka.text.StubTextDisplayer.prototype.destroy=function(){};shaka.text.StubTextDisplayer.prototype.isTextVisible=function(){return!1};shaka.text.StubTextDisplayer.prototype.setTextVisibility=function(a){};goog.exportSymbol("shaka.text.StubTextDisplayer",shaka.text.StubTextDisplayer);
1198
1199
  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);
1199
1200
  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};
1200
1201
  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";
@@ -1521,7 +1522,7 @@ goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.pro
1521
1522
  goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);
1522
1523
  goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);goog.exportProperty(shaka.Player.prototype,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);
1523
1524
  goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);
1524
- shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.16-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};
1525
+ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.17-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};
1525
1526
  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()};
1526
1527
  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()};
1527
1528
  shaka.ads.ClientSideAd.prototype.getTimeUntilSkippable=function(){var a=this.ad_.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};shaka.ads.ClientSideAd.prototype.canSkipNow=function(){return this.manager_.getAdSkippableState()};shaka.ads.ClientSideAd.prototype.skip=function(){return this.manager_.skip()};shaka.ads.ClientSideAd.prototype.setPaused=function(a){this.isPaused_=a};shaka.ads.ClientSideAd.prototype.pause=function(){return this.manager_.pause()};
@@ -1765,8 +1766,8 @@ shaka.cea.CeaUtils.getParsedCaption=function(a,b,c,d,e){if(d>=e)return null;for(
1765
1766
  " ";n.payload&&a.nestedCues.push(n);f!==g&&(n=shaka.cea.CeaUtils.createLineBreakCue(d,e),a.nestedCues.push(n));n=shaka.cea.CeaUtils.createStyledCue(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null};shaka.cea.CeaUtils.createStyledCue=function(a,b,c,d,e,f){a=new shaka.text.Cue(a,b,"");c&&a.textDecoration.push(shaka.text.Cue.textDecoration.UNDERLINE);d&&(a.fontStyle=shaka.text.Cue.fontStyle.ITALIC);a.color=e;a.backgroundColor=f;return a};
1766
1767
  shaka.cea.CeaUtils.createLineBreakCue=function(a,b){a=new shaka.text.Cue(a,b,"");a.lineBreak=!0;return a};shaka.cea.CeaUtils.StyledChar=function(a,b,c,d,e){this.character_=a;this.underline_=b;this.italics_=c;this.backgroundColor_=d;this.textColor_=e};shaka.cea.CeaUtils.StyledChar.prototype.getChar=function(){return this.character_};shaka.cea.CeaUtils.StyledChar.prototype.isUnderlined=function(){return this.underline_};shaka.cea.CeaUtils.StyledChar.prototype.isItalicized=function(){return this.italics_};
1767
1768
  shaka.cea.CeaUtils.StyledChar.prototype.getBackgroundColor=function(){return this.backgroundColor_};shaka.cea.CeaUtils.StyledChar.prototype.getTextColor=function(){return this.textColor_};shaka.cea.CeaUtils.DEFAULT_BG_COLOR="black";shaka.cea.CeaUtils.DEFAULT_TXT_COLOR="white";shaka.cea.CeaUtils.H264_NALU_TYPE_SEI=6;shaka.cea.CeaUtils.H265_PREFIX_NALU_TYPE_SEI=39;shaka.cea.CeaUtils.H265_SUFFIX_NALU_TYPE_SEI=40;shaka.cea.CeaUtils.DEFAULT_TIMESCALE_VALUE=9E4;shaka.cea.Cea608Memory=function(a,b){this.rows_=[];this.row_=1;this.scrollRows_=0;this.fieldNum_=a;this.channelNum_=b;this.italics_=this.underline_=!1;this.textColor_=shaka.cea.CeaUtils.DEFAULT_TXT_COLOR;this.backgroundColor_=shaka.cea.CeaUtils.DEFAULT_BG_COLOR;this.reset()};
1768
- shaka.cea.Cea608Memory.prototype.forceEmit=function(a,b){var c="CC"+((this.fieldNum_<<1|this.channelNum_)+1),d=new shaka.text.Cue(a,b,"");d.lineInterpretation=shaka.text.Cue.lineInterpretation.PERCENTAGE;var e=shaka.cea.Cea608Memory.ROW_TO_LINE_CONVERSION_.get(this.row_);e&&(d.line=e);return shaka.cea.CeaUtils.getParsedCaption(d,c,this.rows_,a,b)};shaka.cea.Cea608Memory.prototype.reset=function(){this.resetAllRows();this.row_=1};shaka.cea.Cea608Memory.prototype.getRow=function(){return this.row_};
1769
- shaka.cea.Cea608Memory.prototype.setRow=function(a){this.row_=a};shaka.cea.Cea608Memory.prototype.getScrollSize=function(){return this.scrollRows_};shaka.cea.Cea608Memory.prototype.setScrollSize=function(a){this.scrollRows_=a};
1769
+ shaka.cea.Cea608Memory.prototype.forceEmit=function(a,b){var c=shaka.cea.Cea608Memory,d="CC"+((this.fieldNum_<<1|this.channelNum_)+1),e=new shaka.text.Cue(a,b,"");e.lineInterpretation=shaka.text.Cue.lineInterpretation.PERCENTAGE;var f=c.ROW_TO_LINE_CONVERSION_.get(this.row_);f&&(e.line=f);(a=shaka.cea.CeaUtils.getParsedCaption(e,d,this.rows_,a,b))&&15<this.row_+a.cue.nestedCues.length-3&&(f=c.ROW_TO_LINE_CONVERSION_.get(this.row_+3-a.cue.nestedCues.length))&&(e.line=f);return a};
1770
+ shaka.cea.Cea608Memory.prototype.reset=function(){this.resetAllRows();this.row_=1};shaka.cea.Cea608Memory.prototype.getRow=function(){return this.row_};shaka.cea.Cea608Memory.prototype.setRow=function(a){this.row_=a};shaka.cea.Cea608Memory.prototype.getScrollSize=function(){return this.scrollRows_};shaka.cea.Cea608Memory.prototype.setScrollSize=function(a){this.scrollRows_=a};
1770
1771
  shaka.cea.Cea608Memory.prototype.addChar=function(a,b){if(!(32>b||127<b)){var c="";switch(a){case shaka.cea.Cea608Memory.CharSet.BASIC_NORTH_AMERICAN:c=shaka.cea.Cea608Memory.CharSet.BasicNorthAmericanChars.has(b)?shaka.cea.Cea608Memory.CharSet.BasicNorthAmericanChars.get(b):String.fromCharCode(b);break;case shaka.cea.Cea608Memory.CharSet.SPECIAL_NORTH_AMERICAN:c=shaka.cea.Cea608Memory.CharSet.SpecialNorthAmericanChars.get(b);break;case shaka.cea.Cea608Memory.CharSet.SPANISH_FRENCH:this.eraseChar();
1771
1772
  c=shaka.cea.Cea608Memory.CharSet.ExtendedSpanishFrench.get(b);break;case shaka.cea.Cea608Memory.CharSet.PORTUGUESE_GERMAN:this.eraseChar(),c=shaka.cea.Cea608Memory.CharSet.ExtendedPortugueseGerman.get(b)}c&&(a=new shaka.cea.CeaUtils.StyledChar(c,this.underline_,this.italics_,this.backgroundColor_,this.textColor_),this.rows_[this.row_].push(a))}};shaka.cea.Cea608Memory.prototype.eraseChar=function(){this.rows_[this.row_].pop()};
1772
1773
  shaka.cea.Cea608Memory.prototype.moveRows=function(a,b,c){if(!(0>b||0>a))if(a>=b)for(--c;0<=c;c--)this.rows_[a+c]=this.rows_[b+c].map(function(e){return e});else for(var d=0;d<c;d++)this.rows_[a+d]=this.rows_[b+d].map(function(e){return e})};shaka.cea.Cea608Memory.prototype.resetRows=function(a,b){for(var c=0;c<=b;c++)this.rows_[a+c]=[]};shaka.cea.Cea608Memory.prototype.resetAllRows=function(){this.resetRows(0,shaka.cea.Cea608Memory.CC_ROWS)};
@@ -3321,13 +3322,14 @@ d.yield(a.video.remote.watchAvailability(b),13);case 13:c=d.yieldResult;a.callba
3321
3322
  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_()});
3322
3323
  this.eventManager.listen(this.player,"loading",function(){c.updateResolutionSelection_()});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);
3323
3324
  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)&&
3324
- 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!=
3325
- 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?m.bandwidth-l.bandwidth: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),
3326
- h=g.next();!h.done;f={$jscomp$loop$prop$track$1040:f.$jscomp$loop$prop$track$1040},h=g.next()){f.$jscomp$loop$prop$track$1040=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$1040)}}(f));var k=shaka.util.Dom.createHTMLElement("span");this.player.isAudioOnly()&&f.$jscomp$loop$prop$track$1040.bandwidth?k.textContent=Math.round(f.$jscomp$loop$prop$track$1040.bandwidth/
3327
- 1E3)+" kbits/s":k.textContent=f.$jscomp$loop$prop$track$1040.height&&f.$jscomp$loop$prop$track$1040.width?this.getResolutionLabel_(f.$jscomp$loop$prop$track$1040,c):"Unknown";h.appendChild(k);e||f.$jscomp$loop$prop$track$1040!=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,
3328
- "click",function(){a.player.configure({abr:{enabled:!0}});a.updateResolutionSelection_()});this.abrOnSpan_=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));
3329
- this.button.setAttribute("shaka-status",this.currentSelection.textContent);this.menu.appendChild(f);shaka.ui.Utils.focusOnTheChosenItem(this.menu);this.controls.dispatchEvent(new shaka.util.FakeEvent("resolutionselectionupdated"));this.updateLocalizedStrings_();shaka.ui.Utils.setDisplay(this.button,1<c.length)};
3330
- shaka.ui.ResolutionSelection.prototype.getResolutionLabel_=function(a,b){var c=a.height||0,d=a.width||0,e=c;d/c>16/9&&(e=Math.round(9*d/16));c=e+"p";2160==e&&(c="4K");(e=a.frameRate)&&(50<=e||20>=e)&&(c+=Math.round(a.frameRate));if("PQ"==a.hdr||"HLG"==a.hdr)c+=" (HDR)";"CH-STEREO"==a.videoLayout&&(c+=" (3D)");a.videoBandwidth&&b.some(function(f){return f!=a&&f.height==a.height})&&(c+=" ("+Math.round(a.videoBandwidth/1E3)+" kbits/s)");return c};
3325
+ JSON.stringify(l.audioRoles)!=JSON.stringify(d.audioRoles)||m==b.LABEL&&l.label!=d.label?!1:!0}));c=this.player.isAudioOnly()?c.filter(function(l,m){return c.findIndex(function(n){return n.bandwidth==l.bandwidth})==m}):1<[].concat($jscomp.arrayFromIterable(new Set(c.map(function(l){return l.audioId})))).length?c.filter(function(l,m){return c.findIndex(function(n){return n.height==l.height&&n.videoBandwidth==l.videoBandwidth&&n.frameRate==l.frameRate&&n.hdr==l.hdr&&n.videoLayout==l.videoLayout})==
3326
+ m}):c.filter(function(l,m){return c.findIndex(function(n){return n.height==l.height&&n.bandwidth==l.bandwidth&&n.frameRate==l.frameRate&&n.hdr==l.hdr&&n.videoLayout==l.videoLayout})==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");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==
3327
+ l.height?m.bandwidth-l.bandwidth: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$1040:f.$jscomp$loop$prop$track$1040},h=g.next()){f.$jscomp$loop$prop$track$1040=h.value;h=shaka.util.Dom.createButton();h.classList.add("explicit-resolution");
3328
+ this.eventManager.listen(h,"click",function(l){return function(){return a.onTrackSelected_(l.$jscomp$loop$prop$track$1040)}}(f));var k=shaka.util.Dom.createHTMLElement("span");this.player.isAudioOnly()&&f.$jscomp$loop$prop$track$1040.bandwidth?k.textContent=Math.round(f.$jscomp$loop$prop$track$1040.bandwidth/1E3)+" kbits/s":k.textContent=f.$jscomp$loop$prop$track$1040.height&&f.$jscomp$loop$prop$track$1040.width?this.getResolutionLabel_(f.$jscomp$loop$prop$track$1040,c):"Unknown";h.appendChild(k);
3329
+ e||f.$jscomp$loop$prop$track$1040!=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_=shaka.util.Dom.createHTMLElement("span");this.abrOnSpan_.classList.add("shaka-auto-span");
3330
+ 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);this.menu.appendChild(f);shaka.ui.Utils.focusOnTheChosenItem(this.menu);this.controls.dispatchEvent(new shaka.util.FakeEvent("resolutionselectionupdated"));
3331
+ this.updateLocalizedStrings_();shaka.ui.Utils.setDisplay(this.button,1<c.length)};
3332
+ shaka.ui.ResolutionSelection.prototype.getResolutionLabel_=function(a,b){var c=a.height||0,d=a.width||0,e=c;d/c>16/9&&(e=Math.round(9*d/16));c=e+"p";2160==e&&(c="4K");(e=a.frameRate)&&(50<=e||20>=e)&&(c+=Math.round(a.frameRate));if("PQ"==a.hdr||"HLG"==a.hdr)c+=" (HDR)";"CH-STEREO"==a.videoLayout&&(c+=" (3D)");b.some(function(f){return f!=a&&f.height==a.height})&&(c+=" ("+Math.round((a.videoBandwidth||a.bandwidth)/1E3)+" kbits/s)");return c};
3331
3333
  shaka.ui.ResolutionSelection.prototype.onTrackSelected_=function(a){this.player.configure({abr:{enabled:!1}});var b=this.controls.getConfig().clearBufferOnQualityChange;this.player.selectVariantTrack(a,b)};
3332
3334
  shaka.ui.ResolutionSelection.prototype.updateLocalizedStrings_=function(){var a=shaka.ui.Locales.Ids,b=this.player.isAudioOnly()?a.QUALITY:a.RESOLUTION;this.button.ariaLabel=this.localization.resolve(b);this.backButton.ariaLabel=this.localization.resolve(b);this.backSpan.textContent=this.localization.resolve(b);this.nameSpan.textContent=this.localization.resolve(b);this.abrOnSpan_.textContent=this.localization.resolve(a.AUTO_QUALITY);this.player.getConfiguration().abr.enabled&&(this.currentSelection.textContent=
3333
3335
  this.localization.resolve(shaka.ui.Locales.Ids.AUTO_QUALITY))};goog.exportSymbol("shaka.ui.ResolutionSelection",shaka.ui.ResolutionSelection);shaka.ui.ResolutionSelection.Factory=function(){};shaka.ui.ResolutionSelection.Factory.prototype.create=function(a,b){return new shaka.ui.ResolutionSelection(a,b)};shaka.ui.OverflowMenu.registerElement("quality",new shaka.ui.ResolutionSelection.Factory);shaka.ui.Controls.registerElement("quality",new shaka.ui.ResolutionSelection.Factory);shaka.ui.RewindButton=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.button_=shaka.util.Dom.createButton();this.button_.classList.add("material-icons-round");this.button_.classList.add("shaka-rewind-button");this.button_.classList.add("shaka-tooltip-status");this.button_.setAttribute("shaka-status",this.localization.resolve(shaka.ui.Locales.Ids.OFF));this.button_.textContent=shaka.ui.Enums.MaterialDesignIcons.REWIND;this.parent.appendChild(this.button_);this.updateAriaLabel_();this.rewindRates_=