shaka-player 4.11.19 → 4.11.21
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.
- package/dist/locales.js +37 -37
- package/dist/shaka-player.compiled.debug.js +45 -43
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +519 -517
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +56 -54
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +726 -724
- package/dist/shaka-player.ui.map +3 -3
- package/externs/shaka/player.js +7 -4
- package/lib/cea/cea708_service.js +9 -17
- package/lib/dash/dash_parser.js +24 -13
- package/lib/dash/segment_template.js +41 -39
- package/lib/hls/manifest_text_parser.js +1 -0
- package/lib/media/gap_jumping_controller.js +14 -1
- package/lib/media/media_source_engine.js +13 -9
- package/lib/media/streaming_engine.js +1 -1
- package/lib/net/networking_utils.js +1 -0
- package/lib/player.js +3 -2
- package/lib/util/player_configuration.js +12 -1
- package/lib/util/tXml.js +2 -1
- package/package.json +2 -1
- package/ui/controls.js +2 -6
- package/ui/range_element.js +0 -1
|
@@ -355,9 +355,9 @@ a.insert("tr",new Map([["AD_DURATION","Reklam s\u00fcresi"],["AD_PROGRESS","[AD_
|
|
|
355
355
|
["ENTER_LOOP_MODE","\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["ENTER_PICTURE_IN_PICTURE","\u9032\u5165\u5b50\u6bcd\u756b\u9762"],["EXIT_FULL_SCREEN","\u9000\u51fa\u5168\u87a2\u5e55\u6a21\u5f0f"],["EXIT_LOOP_MODE","\u505c\u6b62\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["EXIT_PICTURE_IN_PICTURE","\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN","\u5168\u87a2\u5e55"],["LANGUAGE","\u8a9e\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u74b0\u64ad\u653e"],
|
|
356
356
|
["MORE_SETTINGS","\u986f\u793a\u66f4\u591a\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u7a2e\u8a9e\u8a00"],["MUTE","\u975c\u97f3"],["NOT_APPLICABLE","\u4e0d\u9069\u7528"],["OFF","\u95dc\u9589"],["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["QUALITY","\u97f3\u8cea"],["RECENTER_VR","\u91cd\u65b0\u7f6e\u4e2d"],["REPLAY","\u91cd\u64ad"],["RESOLUTION","\u89e3\u6790\u5ea6"],["REWIND",
|
|
357
357
|
"\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["STATISTICS","\u7d71\u8a08\u8cc7\u6599"],["SUBTITLE_FORCED","\u5f37\u5236\u986f\u793a"],["SURROUND","\u74b0\u5834\u97f3\u6548"],["TOGGLE_STEREOSCOPIC","\u5207\u63db\u7acb\u9ad4\u5f71\u50cf"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]))};
|
|
358
|
-
shaka.ui.Locales.Ids={
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
shaka.ui.Locales.Ids={RECENTER_VR:"RECENTER_VR",AD_PROGRESS:"AD_PROGRESS",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",LIVE:"LIVE",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",SUBTITLE_FORCED:"SUBTITLE_FORCED",FAST_FORWARD:"FAST_FORWARD",CHAPTERS:"CHAPTERS",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",AD_DURATION:"AD_DURATION",DOWNLOAD_VIDEO_FRAME:"DOWNLOAD_VIDEO_FRAME",CAPTIONS:"CAPTIONS",AIRPLAY:"AIRPLAY",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",SURROUND:"SURROUND",SKIP_TO_LIVE:"SKIP_TO_LIVE",SEEK:"SEEK",
|
|
359
|
+
AD_STATISTICS:"AD_STATISTICS",PLAY:"PLAY",MORE_SETTINGS:"MORE_SETTINGS",MUTE:"MUTE",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",UNMUTE:"UNMUTE",LANGUAGE:"LANGUAGE",LOOP:"LOOP",NOT_APPLICABLE:"NOT_APPLICABLE",RESOLUTION:"RESOLUTION",BACK:"BACK",REWIND:"REWIND",ON:"ON",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",STATISTICS:"STATISTICS",VOLUME:"VOLUME",QUALITY:"QUALITY",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",PAUSE:"PAUSE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",REPLAY:"REPLAY",OFF:"OFF",AUTO_QUALITY:"AUTO_QUALITY",
|
|
360
|
+
PLAYBACK_RATE:"PLAYBACK_RATE",SKIP_AD:"SKIP_AD",AD_TIME:"AD_TIME",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",CAST:"CAST",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",FULL_SCREEN:"FULL_SCREEN"};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)};
|
|
361
361
|
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)};
|
|
362
362
|
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)};
|
|
363
363
|
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()}};
|
|
@@ -400,7 +400,7 @@ e)}var e=0;return c("")};shaka.util.TXml.isNode=function(a){return!!a.tagName};s
|
|
|
400
400
|
shaka.util.TXml.findChildren=function(a,b){var c=[];if(!a.children)return[];a=$jscomp.makeIterator(a.children);for(var d=a.next();!d.done;d=a.next())d=d.value,d.tagName===b&&c.push(d);return c};shaka.util.TXml.getTextContents=function(a){var b=shaka.util.StringUtils;if("string"===typeof a)return b.htmlUnescape(a);a=a.children.reduce(function(c,d){return"string"===typeof d?c+d:c},"");return""===a?null:b.htmlUnescape(a)};
|
|
401
401
|
shaka.util.TXml.getContents=function(a){if(!Array.from(a.children).every(function(b){return"string"===typeof b}))return null;(a=shaka.util.TXml.getTextContents(a))&&(a=a.trim());return a};shaka.util.TXml.getElementsByTagName=function(a,b,c){c=void 0===c?[]:c;a.tagName===b&&c.push(a);if(a.children){a=$jscomp.makeIterator(a.children);for(var d=a.next();!d.done;d=a.next())shaka.util.TXml.getElementsByTagName(d.value,b,c)}return c};
|
|
402
402
|
shaka.util.TXml.findChild=function(a,b){a=shaka.util.TXml.findChildren(a,b);return 1!=a.length?null:a[0]};shaka.util.TXml.findChildNS=function(a,b,c){a=shaka.util.TXml.findChildrenNS(a,b,c);return 1!=a.length?null:a[0]};shaka.util.TXml.parseAttr=function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.attributes[b];null!=a&&(e=c(a));return null==e?d:e};shaka.util.TXml.getAttributeNS=function(a,b,c){b=shaka.util.TXml.getKnownNameSpace(b);return a.attributes[b+":"+c]||null};
|
|
403
|
-
shaka.util.TXml.findChildrenNS=function(a,b,c){
|
|
403
|
+
shaka.util.TXml.findChildrenNS=function(a,b,c){var d=shaka.util.TXml.getKnownNameSpace(b);b=[];if(a.children)for(c=d?d+":"+c:c,a=$jscomp.makeIterator(a.children),d=a.next();!d.done;d=a.next())(d=d.value)&&d.tagName===c&&b.push(d);return b};shaka.util.TXml.getAttributeNSList=function(a,b,c){b=$jscomp.makeIterator(b);for(var d=b.next();!d.done;d=b.next())if(d=shaka.util.TXml.getAttributeNS(a,d.value,c))return d;return null};
|
|
404
404
|
shaka.util.TXml.parseDate=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3};
|
|
405
405
|
shaka.util.TXml.parseDuration=function(a){if(!a)return null;var b=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$").exec(a);if(!b)return shaka.log.warning("Invalid duration string:",a),null;a=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null};
|
|
406
406
|
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};
|
|
@@ -892,10 +892,10 @@ shaka.media.MediaSourceEngine.prototype.clear=function(a){var b=this,c;return $j
|
|
|
892
892
|
null),0):d.jumpTo(0)})};shaka.media.MediaSourceEngine.prototype.resetCaptionParser=function(){this.captionParser_&&this.captionParser_.reset()};
|
|
893
893
|
shaka.media.MediaSourceEngine.prototype.flush=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){return 1==d.nextAddress?(c=shaka.util.ManifestParserUtils.ContentType,a==c.TEXT?d.return():d.yield(b.enqueueOperation_(a,function(){return b.flush_(a)},null),2)):b.needSplitMuxedContent_?d.yield(b.enqueueOperation_(c.AUDIO,function(){return b.flush_(c.AUDIO)},null),0):d.jumpTo(0)})};
|
|
894
894
|
shaka.media.MediaSourceEngine.prototype.setStreamProperties=function(a,b,c,d,e,f,g,h){var k=this,l,m,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){if(1==p.nextAddress){l=shaka.util.ManifestParserUtils.ContentType;if(a==l.TEXT)return e||k.textEngine_.setTimestampOffset(b),k.textEngine_.setAppendWindow(c,d),p.return();m=[];return p.yield(k.codecSwitchIfNecessary_(a,f,g,h),2)}n=p.yieldResult;n||(m.push(k.enqueueOperation_(a,function(){return k.abort_(a)},null)),k.needSplitMuxedContent_&&
|
|
895
|
-
m.push(k.enqueueOperation_(l.AUDIO,function(){return k.abort_(l.AUDIO)},null)));e||(m.push(k.enqueueOperation_(a,function(){return k.setTimestampOffset_(a,b)},null)),k.needSplitMuxedContent_&&m.push(k.enqueueOperation_(l.AUDIO,function(){return k.setTimestampOffset_(l.AUDIO,b)},null)));m.push(k.enqueueOperation_(a,function(){return k.setAppendWindow_(a,c,d)},null))
|
|
896
|
-
0)})};
|
|
897
|
-
shaka.media.MediaSourceEngine.prototype.resync=function(a,b){var c=this,d,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){if(1==f.nextAddress){d=shaka.util.ManifestParserUtils.ContentType;if(a==d.TEXT)return f.return();a==d.VIDEO&&(c.textSequenceModeOffset_=new shaka.util.PublicPromise);if(!c.sequenceMode_||(e=c.bufferEnd(a))&&.1>Math.abs(e-b))return f.return();c.enqueueOperation_(a,function(){return c.abort_(a)},null);c.needSplitMuxedContent_&&c.enqueueOperation_(d.AUDIO,function(){return c.abort_(d.AUDIO)},
|
|
898
|
-
return f.yield(c.enqueueOperation_(a,function(){return c.setTimestampOffset_(a,b)},null),2)}return c.needSplitMuxedContent_?f.yield(c.enqueueOperation_(d.AUDIO,function(){return c.setTimestampOffset_(d.AUDIO,b)},null),0):f.jumpTo(0)})};
|
|
895
|
+
m.push(k.enqueueOperation_(l.AUDIO,function(){return k.abort_(l.AUDIO)},null)));e||(m.push(k.enqueueOperation_(a,function(){return k.setTimestampOffset_(a,b)},null)),k.needSplitMuxedContent_&&m.push(k.enqueueOperation_(l.AUDIO,function(){return k.setTimestampOffset_(l.AUDIO,b)},null)));if(0!=c||Infinity!=d)m.push(k.enqueueOperation_(a,function(){return k.setAppendWindow_(a,c,d)},null)),k.needSplitMuxedContent_&&m.push(k.enqueueOperation_(l.AUDIO,function(){return k.setAppendWindow_(l.AUDIO,c,d)},
|
|
896
|
+
null));return m.length?p.yield(Promise.all(m),0):p.jumpTo(0)})};
|
|
897
|
+
shaka.media.MediaSourceEngine.prototype.resync=function(a,b){var c=this,d,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){if(1==f.nextAddress){d=shaka.util.ManifestParserUtils.ContentType;if(a==d.TEXT)return f.return();a==d.VIDEO&&(c.textSequenceModeOffset_=new shaka.util.PublicPromise);if(!c.sequenceMode_||(e=c.bufferEnd(a))&&.1>Math.abs(e-b))return f.return();c.enqueueOperation_(a,function(){return c.abort_(a)},null);c.needSplitMuxedContent_&&c.enqueueOperation_(d.AUDIO,function(){return c.abort_(d.AUDIO)},
|
|
898
|
+
null);return f.yield(c.enqueueOperation_(a,function(){return c.setTimestampOffset_(a,b)},null),2)}return c.needSplitMuxedContent_?f.yield(c.enqueueOperation_(d.AUDIO,function(){return c.setTimestampOffset_(d.AUDIO,b)},null),0):f.jumpTo(0)})};
|
|
899
899
|
shaka.media.MediaSourceEngine.prototype.endOfStream=function(a){var b=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){return c.yield(b.enqueueBlockingOperation_(function(){b.ended()||b.closed()||(a?b.mediaSource_.endOfStream(a):b.mediaSource_.endOfStream())}),0)})};
|
|
900
900
|
shaka.media.MediaSourceEngine.prototype.setDuration=function(a){var b=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){return c.yield(b.enqueueBlockingOperation_(function(){if(a<b.mediaSource_.duration)for(var d in b.sourceBuffers_){var e={start:function(){},p:new shaka.util.PublicPromise,uri:null};b.queues_[d].unshift(e)}b.mediaSource_.duration=a;b.lastDuration_=a}),0)})};shaka.media.MediaSourceEngine.prototype.getDuration=function(){return this.mediaSource_.duration};
|
|
901
901
|
shaka.media.MediaSourceEngine.prototype.append_=function(a,b,c){a==shaka.util.ManifestParserUtils.ContentType.VIDEO&&this.lcevcDec_&&this.lcevcDec_.appendBuffer(b,c);this.sourceBuffers_[a].appendBuffer(b)};shaka.media.MediaSourceEngine.prototype.remove_=function(a,b,c){if(c<=b)this.onUpdateEnd_(a);else this.sourceBuffers_[a].remove(b,c)};
|
|
@@ -959,10 +959,10 @@ shaka.media.StallDetector.prototype.onStall=function(a){this.onStall_=a};shaka.m
|
|
|
959
959
|
shaka.media.StallDetector.prototype.poll=function(){var a=this.implementation_,b=a.shouldBeMakingProgress(),c=a.getPresentationSeconds(),d=a.getWallSeconds();if(this.value_!=c||this.wasMakingProgress_!=b)this.lastUpdateSeconds_=d,this.value_=c,this.wasMakingProgress_=b,this.didJump_=!1;c=d-this.lastUpdateSeconds_;if(b=c>=this.stallThresholdSeconds_&&b&&!this.didJump_)this.onStall_(this.value_,c),this.didJump_=!0,this.value_=a.getPresentationSeconds(),this.stallsDetected_++,this.onEvent_(new shaka.util.FakeEvent(shaka.util.FakeEvent.EventName.StallDetected));
|
|
960
960
|
return b};shaka.media.StallDetector.Implementation=function(){};shaka.media.StallDetector.Implementation.prototype.shouldBeMakingProgress=function(){};shaka.media.StallDetector.Implementation.prototype.getPresentationSeconds=function(){};shaka.media.StallDetector.Implementation.prototype.getWallSeconds=function(){};shaka.media.StallDetector.MediaElementImplementation=function(a){this.mediaElement_=a};
|
|
961
961
|
shaka.media.StallDetector.MediaElementImplementation.prototype.shouldBeMakingProgress=function(){return this.mediaElement_.paused||0==this.mediaElement_.playbackRate||0==this.mediaElement_.buffered.length?!1:shaka.media.StallDetector.MediaElementImplementation.hasContentFor_(this.mediaElement_.buffered,this.mediaElement_.currentTime)};shaka.media.StallDetector.MediaElementImplementation.prototype.getPresentationSeconds=function(){return this.mediaElement_.currentTime};
|
|
962
|
-
shaka.media.StallDetector.MediaElementImplementation.prototype.getWallSeconds=function(){return Date.now()/1E3};shaka.media.StallDetector.MediaElementImplementation.hasContentFor_=function(a,b){a=$jscomp.makeIterator(shaka.media.TimeRangesUtils.getBufferedInfo(a));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(b<c.start-.1||b>c.end-.5))return!0;return!1};shaka.media.GapJumpingController=function(a,b,c,d,e){var f=this;this.onEvent_=e;this.video_=a;this.timeline_=b;this.config_=c;this.eventManager_=new shaka.util.EventManager;this.seekingEventReceived_=!1;this.prevReadyState_=a.readyState;this.gapsJumped_=this.startTime_=0;this.stallDetector_=d;this.hadSegmentAppended_=!1;this.eventManager_.listen(a,"waiting",function(){return f.onPollGapJump_()});this.gapJumpTimer_=
|
|
962
|
+
shaka.media.StallDetector.MediaElementImplementation.prototype.getWallSeconds=function(){return Date.now()/1E3};shaka.media.StallDetector.MediaElementImplementation.hasContentFor_=function(a,b){a=$jscomp.makeIterator(shaka.media.TimeRangesUtils.getBufferedInfo(a));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(b<c.start-.1||b>c.end-.5))return!0;return!1};shaka.media.GapJumpingController=function(a,b,c,d,e){var f=this;this.onEvent_=e;this.video_=a;this.timeline_=b;this.config_=c;this.eventManager_=new shaka.util.EventManager;this.seekingEventReceived_=this.started_=!1;this.prevReadyState_=a.readyState;this.gapsJumped_=this.startTime_=0;this.stallDetector_=d;this.hadSegmentAppended_=!1;this.eventManager_.listen(a,"waiting",function(){return f.onPollGapJump_()});this.gapJumpTimer_=new shaka.util.Timer(function(){f.onPollGapJump_()})};
|
|
963
963
|
shaka.media.GapJumpingController.prototype.release=function(){this.eventManager_&&(this.eventManager_.release(),this.eventManager_=null);null!=this.gapJumpTimer_&&(this.gapJumpTimer_.stop(),this.gapJumpTimer_=null);this.stallDetector_&&(this.stallDetector_.release(),this.stallDetector_=null);this.video_=this.timeline_=this.onEvent_=null};shaka.media.GapJumpingController.prototype.onSegmentAppended=function(){this.hadSegmentAppended_=!0;this.onPollGapJump_()};
|
|
964
|
-
shaka.media.GapJumpingController.prototype.onStarted=function(a){this.video_.seeking&&!this.seekingEventReceived_&&(this.seekingEventReceived_=!0,this.startTime_=a)};shaka.media.GapJumpingController.prototype.onSeeking=function(){this.seekingEventReceived_=!0;this.hadSegmentAppended_=!1};shaka.media.GapJumpingController.prototype.getGapsJumped=function(){return this.gapsJumped_};
|
|
965
|
-
shaka.media.GapJumpingController.prototype.onPollGapJump_=function(){if(0!=this.video_.readyState){if(this.video_.seeking){if(!this.seekingEventReceived_)return}else this.seekingEventReceived_=!1;if(!this.video_.paused||this.video_.currentTime==this.startTime_&&(this.video_.autoplay||this.video_.currentTime!=this.startTime_))if(this.video_.readyState!=this.prevReadyState_&&(this.prevReadyState_=this.video_.readyState),!this.stallDetector_||!this.stallDetector_.poll()){var a=this.video_.currentTime,
|
|
964
|
+
shaka.media.GapJumpingController.prototype.onStarted=function(a){this.started_=!0;this.video_.seeking&&!this.seekingEventReceived_&&(this.seekingEventReceived_=!0,this.startTime_=a);this.gapJumpTimer_&&this.gapJumpTimer_.tickEvery(this.config_.gapJumpTimerTime);this.onPollGapJump_()};shaka.media.GapJumpingController.prototype.onSeeking=function(){this.seekingEventReceived_=!0;this.hadSegmentAppended_=!1;this.onPollGapJump_()};shaka.media.GapJumpingController.prototype.getGapsJumped=function(){return this.gapsJumped_};
|
|
965
|
+
shaka.media.GapJumpingController.prototype.onPollGapJump_=function(){if(0!=this.video_.readyState&&this.started_){if(this.video_.seeking){if(!this.seekingEventReceived_)return}else this.seekingEventReceived_=!1;if(!this.video_.paused||this.video_.currentTime==this.startTime_&&(this.video_.autoplay||this.video_.currentTime!=this.startTime_))if(this.video_.readyState!=this.prevReadyState_&&(this.prevReadyState_=this.video_.readyState),!this.stallDetector_||!this.stallDetector_.poll()){var a=this.video_.currentTime,
|
|
966
966
|
b=this.video_.buffered,c=shaka.media.TimeRangesUtils.getGapIndex(b,a,this.config_.gapDetectionThreshold);if(null!=c&&(0!=c||this.hadSegmentAppended_)){var d=b.start(c);if(shaka.util.Platform.isLegacyEdge()||shaka.util.Platform.isXboxOne()||shaka.util.Platform.isTizen())d=Math.ceil(100*(d+this.config_.gapPadding))/100;var e=this.timeline_.getSeekRangeEnd();d>=e||(e=d-a,e<shaka.media.GapJumpingController.BROWSER_GAP_TOLERANCE||(0==c?shaka.log.info("Jumping forward",e,"seconds because of gap before start time of",
|
|
967
967
|
d):shaka.log.info("Jumping forward",e,"seconds because of gap starting at",b.end(c-1),"and ending at",d),this.video_.currentTime=d,a==this.startTime_&&(this.startTime_=d),this.gapsJumped_++,this.onEvent_(new shaka.util.FakeEvent(shaka.util.FakeEvent.EventName.GapJumped))))}}}};shaka.media.GapJumpingController.BROWSER_GAP_TOLERANCE=.001;shaka.util.MediaReadyState=function(){};shaka.util.MediaReadyState.waitForReadyState=function(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=shaka.util.MediaReadyState.READY_STATES_TO_EVENT_NAMES_.value().get(b),c.listenOnce(a,b,d))};
|
|
968
968
|
shaka.util.MediaReadyState.READY_STATES_TO_EVENT_NAMES_=new shaka.util.Lazy(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});shaka.media.VideoWrapper=function(a,b,c,d){var e=this;this.video_=a;this.onSeek_=b;this.onStarted_=c;this.startTime_=null;this.getStartTime_=function(){null==e.startTime_&&(e.startTime_=d());return e.startTime_};this.started_=!1;this.eventManager_=new shaka.util.EventManager;this.mover_=new shaka.media.VideoWrapper.PlayheadMover(a,10);shaka.util.MediaReadyState.waitForReadyState(this.video_,HTMLMediaElement.HAVE_METADATA,this.eventManager_,function(){e.setStartTime_(e.getStartTime_())})};
|
|
@@ -1167,9 +1167,9 @@ c.reader.getPosition());if(b&&b.includes(d)||this.config_.dispatchAllEmsgBoxes)i
|
|
|
1167
1167
|
d)&&(d=shaka.util.Id3Utils.getID3Frames(a),d.length))this.playerInterface_.onMetadata([{cueTime:l,data:a,frames:d,dts:l,pts:l}],0,b)};
|
|
1168
1168
|
shaka.media.StreamingEngine.prototype.parsePrft_=function(a,b){if(!this.parsedPrftEventRaised_&&a.initSegmentReference.timescale){goog.asserts.assert(0==b.version||1==b.version,"PRFT version can only be 0 or 1");b=shaka.util.Mp4BoxParsers.parsePRFTInaccurate(b.reader,b.version);a=a.initSegmentReference.timescale;var c=this.convertNtp(b.ntpTimestamp);a={wallClockTime:c,programStartDate:new Date(c-b.mediaTime/a*1E3)};b=shaka.util.FakeEvent.EventName.Prft;a=(new Map).set("detail",a);b=new shaka.util.FakeEvent(b,
|
|
1169
1169
|
a);this.playerInterface_.onEvent(b);this.parsedPrftEventRaised_=!0}};shaka.media.StreamingEngine.prototype.convertNtp=function(a){var b=new Date(Date.UTC(1900,0,1,0,0,0));return(new Date(b.getTime()+a)).getTime()};
|
|
1170
|
-
shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){d=a.stream.segmentIndex;d instanceof shaka.media.MetaSegmentIndex&&d.evict(c.manifest_.presentationTimeline.
|
|
1171
|
-
if(null==g)return c.lastTextMediaStateBeforeUnload_==a&&(c.lastTextMediaStateBeforeUnload_=null),shaka.log.v2(e,"buffer behind okay because nothing buffered:","presentationTime="+b,"bufferBehind="+f),l.return();h=b-g;k=h-f;if(k<=c.config_.evictionGoal)return shaka.log.v2(e,"buffer behind okay:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"underflow="+Math.abs(k)),l.return();shaka.log.v1(e,
|
|
1172
|
-
h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"overflow="+k);return l.yield(c.playerInterface_.mediaSourceEngine.remove(a.type,g,g+k),2)}if(4!=l.nextAddress)return c.destroyer_.ensureNotDestroyed(),shaka.log.v1(e,"evicted "+k+" seconds"),c.lastTextMediaStateBeforeUnload_?l.yield(c.evict_(c.lastTextMediaStateBeforeUnload_,b),4):l.jumpTo(0);c.destroyer_.ensureNotDestroyed();l.jumpToEnd()})};
|
|
1170
|
+
shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){d=a.stream.segmentIndex;d instanceof shaka.media.MetaSegmentIndex&&d.evict(c.manifest_.presentationTimeline.getSegmentAvailabilityStart());e=shaka.media.StreamingEngine.logPrefix_(a);shaka.log.v2(e,"checking buffer length");f=Math.max(c.config_.bufferBehind*c.bufferingScale_,c.manifest_.presentationTimeline.getMaxSegmentDuration());g=
|
|
1171
|
+
c.playerInterface_.mediaSourceEngine.bufferStart(a.type);if(null==g)return c.lastTextMediaStateBeforeUnload_==a&&(c.lastTextMediaStateBeforeUnload_=null),shaka.log.v2(e,"buffer behind okay because nothing buffered:","presentationTime="+b,"bufferBehind="+f),l.return();h=b-g;k=h-f;if(k<=c.config_.evictionGoal)return shaka.log.v2(e,"buffer behind okay:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"underflow="+Math.abs(k)),l.return();shaka.log.v1(e,
|
|
1172
|
+
"buffer behind too large:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"overflow="+k);return l.yield(c.playerInterface_.mediaSourceEngine.remove(a.type,g,g+k),2)}if(4!=l.nextAddress)return c.destroyer_.ensureNotDestroyed(),shaka.log.v1(e,"evicted "+k+" seconds"),c.lastTextMediaStateBeforeUnload_?l.yield(c.evict_(c.lastTextMediaStateBeforeUnload_,b),4):l.jumpTo(0);c.destroyer_.ensureNotDestroyed();l.jumpToEnd()})};
|
|
1173
1173
|
shaka.media.StreamingEngine.isEmbeddedText_=function(a){var b=shaka.util.MimeUtils,c=b.CEA608_CLOSED_CAPTION_MIMETYPE;b=b.CEA708_CLOSED_CAPTION_MIMETYPE;return a&&a.type==shaka.util.ManifestParserUtils.ContentType.TEXT&&(a.stream.mimeType==c||a.stream.mimeType==b)};
|
|
1174
1174
|
shaka.media.StreamingEngine.prototype.fetch_=function(a,b,c){var d=this,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){switch(l.nextAddress){case 1:if(e=b.getSegmentData())return l.return(e);f=null;a.segmentPrefetch&&(f=a.segmentPrefetch.getPrefetchedSegment(b,c));f||(f=d.dispatchFetch_(b,a.stream,c));g=0;a.segmentIterator&&(g=a.segmentIterator.currentPosition());a.operation=f;return l.yield(f.promise,2);case 2:h=l.yieldResult;a.operation=null;k=h.data;if(!b.aesKey){l.jumpTo(3);
|
|
1175
1175
|
break}return l.yield(shaka.media.SegmentUtils.aesDecrypt(k,b.aesKey,g),4);case 4:k=l.yieldResult;case 3:return l.return(k)}})};shaka.media.StreamingEngine.prototype.dispatchFetch_=function(a,b,c,d){goog.asserts.assert(this.playerInterface_.netEngine,"Must have net engine");return shaka.media.StreamingEngine.dispatchFetch(a,b,c||null,this.config_.retryParameters,this.playerInterface_.netEngine)};
|
|
@@ -1215,18 +1215,18 @@ mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegm
|
|
|
1215
1215
|
"79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}};var e={retryParameters:shaka.net.NetworkingEngine.defaultRetryParameters(),failureCallback:function(m){shaka.log.error("Unhandled streaming error",m);return shaka.util.ConfigUtils.referenceParametersAndReturn([m],void 0)},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:.01,gapJumpTimerTime:.25,durationBackoff:1,
|
|
1216
1216
|
safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!1,autoLowLatencyMode:!1,forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3,preferNativeHls:!1,updateIntervalSeconds:1,dispatchAllEmsgBoxes:!1,observeQualityChanges:!1,maxDisabledTime:30,parsePrftBox:!1,segmentPrefetchLimit:0,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,
|
|
1217
1217
|
targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,infiniteLiveStreamDuration:!1,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:shaka.util.Platform.isPS4()||shaka.util.Platform.isPS5(),
|
|
1218
|
-
dontChooseCodecs:!1,shouldFixTimestampOffset:shaka.util.Platform.isWebOS()||shaka.util.Platform.isTizen()};if(shaka.util.Platform.isWebOS()||shaka.util.Platform.isTizen()||shaka.util.Platform.isChromecast()||shaka.util.Platform.isHisense())e.stallSkip=0;shaka.util.Platform.isTizen()&&(e.gapPadding=2);
|
|
1219
|
-
p.nextAddress)return navigator.storage&&navigator.storage.estimate?p.yield(navigator.storage.estimate(),3):p.return(!0);n=p.yieldResult;return p.return(n.usage+m<.95*n.quota)})},progressCallback:function(m,n){return shaka.util.ConfigUtils.referenceParametersAndReturn([m,n],void 0)},usePersistentLicense:!0,numberOfParallelDownloads:5};a={enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,
|
|
1220
|
-
maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:20,
|
|
1221
|
-
addExtraFeaturesToSourceBuffer:function(m){return shaka.util.ConfigUtils.referenceParametersAndReturn([m],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,modifyCueCallback:function(m,n){return shaka.util.ConfigUtils.referenceParametersAndReturn([m,n],void 0)}};var g=!1,h=!1,k=!0;shaka.util.Platform.isSmartTV()&&(h=g=!0,k=!1);var l={drm:b,manifest:d,streaming:e,mediaSource:c,offline:f,
|
|
1222
|
-
preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,
|
|
1223
|
-
maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{captionsUpdatePeriod:.25},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,
|
|
1224
|
-
f.trackSelectionCallback=function(m){return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){return n.return(shaka.util.PlayerConfiguration.defaultTrackSelect(m,l.preferredAudioLanguage,l.preferredVideoHdrLevel))})};return l};
|
|
1218
|
+
dontChooseCodecs:!1,shouldFixTimestampOffset:shaka.util.Platform.isWebOS()||shaka.util.Platform.isTizen()},f=shaka.util.Platform.safariVersion();f&&17<=f&&(e.infiniteLiveStreamDuration=!0);if(shaka.util.Platform.isWebOS()||shaka.util.Platform.isTizen()||shaka.util.Platform.isChromecast()||shaka.util.Platform.isHisense())e.stallSkip=0;shaka.util.Platform.isTizen()&&(e.gapPadding=2);f={trackSelectionCallback:function(m){return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){return n.return(m)})},
|
|
1219
|
+
downloadSizeCallback:function(m){var n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){if(1==p.nextAddress)return navigator.storage&&navigator.storage.estimate?p.yield(navigator.storage.estimate(),3):p.return(!0);n=p.yieldResult;return p.return(n.usage+m<.95*n.quota)})},progressCallback:function(m,n){return shaka.util.ConfigUtils.referenceParametersAndReturn([m,n],void 0)},usePersistentLicense:!0,numberOfParallelDownloads:5};a={enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,
|
|
1220
|
+
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,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:20,
|
|
1221
|
+
minTimeToSwitch:shaka.util.Platform.isApple()?.5:0,preferNetworkInformationBandwidth:!1};c={codecSwitchingStrategy:c,addExtraFeaturesToSourceBuffer:function(m){return shaka.util.ConfigUtils.referenceParametersAndReturn([m],"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,modifyCueCallback:function(m,n){return shaka.util.ConfigUtils.referenceParametersAndReturn([m,n],void 0)}};var g=!1,h=!1,k=!0;shaka.util.Platform.isSmartTV()&&(h=g=!0,k=!1);var l={drm:b,manifest:d,streaming:e,mediaSource:c,offline:f,
|
|
1222
|
+
abrFactory:function(){return new shaka.abr.SimpleAbrManager},abr:a,autoShowText:shaka.config.AutoShowText.IF_SUBTITLES_MAY_BE_NEEDED,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,
|
|
1223
|
+
maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{captionsUpdatePeriod:.25},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,
|
|
1224
|
+
dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1},ads:{customPlayheadTracker:g,skipPlayDetection:h,supportsMultipleMediaElements:k}};f.trackSelectionCallback=function(m){return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){return n.return(shaka.util.PlayerConfiguration.defaultTrackSelect(m,l.preferredAudioLanguage,l.preferredVideoHdrLevel))})};return l};
|
|
1225
1225
|
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:"",headers:{}}};return shaka.util.ConfigUtils.mergeConfigObjects(a,b,c||shaka.util.PlayerConfiguration.createDefault(),d,"")};
|
|
1226
|
-
shaka.util.PlayerConfiguration.defaultTrackSelect=function(a,b,c){var d=shaka.util.ManifestParserUtils.ContentType,e=shaka.util.LanguageUtils,f=c;"AUTO"==f&&(f=window.matchMedia("(color-gamut: p3)").matches?"PQ":"SDR");var g=a.filter(function(l){return"variant"!=l.type||l.hdr&&l.hdr!=f?!1:!0});c=[];var h=e.findClosestLocale(b,g.map(function(l){return l.language}));h&&(c=g.filter(function(l){return e.normalize(l.language)==h}));0==c.length&&
|
|
1227
|
-
(1<(new Set(g.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!"),c=g);var k=c.filter(function(l){return l.height&&480>=l.height});k.length&&(k.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}),c=k.filter(function(l){return l.height==
|
|
1228
|
-
2),c.sort(function(l,m){return l.bandwidth-m.bandwidth}),b.push(c[g]));a=$jscomp.makeIterator(a);for(c=a.next();!c.done;c=a.next())c=c.value,c.type!=d.TEXT&&c.type!=d.IMAGE||b.push(c);return b};shaka.util.PlayerConfiguration.defaultManifestPreprocessor=function(a){return shaka.util.ConfigUtils.referenceParametersAndReturn([a],a)};
|
|
1229
|
-
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.media.PreloadManager=function(a,b,c,d){shaka.util.FakeEventTarget.call(this);this.assetUri_=a;this.mimeType_=b;this.networkingEngine_=d.networkingEngine;this.startTime_=c;this.currentAdaptationSetCriteria_=null;this.startTimeOfDrm_=0;this.createDrmEngine_=d.createDrmEngine;this.manifestFilterer_=d.manifestFilterer;this.manifestPlayerInterface_=d.manifestPlayerInterface;this.config_=d.config;this.parser_=this.parserFactory_=this.manifest_=null;this.parserEntrusted_=!1;this.regionTimeline_=d.regionTimeline;
|
|
1226
|
+
shaka.util.PlayerConfiguration.defaultTrackSelect=function(a,b,c){var d=shaka.util.ManifestParserUtils.ContentType,e=shaka.util.LanguageUtils,f=c;"AUTO"==f&&(f=window.matchMedia("(color-gamut: p3)").matches?a.some(function(l){return l.hdr&&"HLG"==l.hdr?!0:!1})?"HLG":"PQ":"SDR");var g=a.filter(function(l){return"variant"!=l.type||l.hdr&&l.hdr!=f?!1:!0});c=[];var h=e.findClosestLocale(b,g.map(function(l){return l.language}));h&&(c=g.filter(function(l){return e.normalize(l.language)==h}));0==c.length&&
|
|
1227
|
+
(c=g.filter(function(l){return l.primary}));0==c.length&&(1<(new Set(g.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!"),c=g);var k=c.filter(function(l){return l.height&&480>=l.height});k.length&&(k.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}),c=k.filter(function(l){return l.height==
|
|
1228
|
+
k[0].height}));b=[];c.length&&(g=Math.floor(c.length/2),c.sort(function(l,m){return l.bandwidth-m.bandwidth}),b.push(c[g]));a=$jscomp.makeIterator(a);for(c=a.next();!c.done;c=a.next())c=c.value,c.type!=d.TEXT&&c.type!=d.IMAGE||b.push(c);return b};shaka.util.PlayerConfiguration.defaultManifestPreprocessor=function(a){return shaka.util.ConfigUtils.referenceParametersAndReturn([a],a)};
|
|
1229
|
+
shaka.util.PlayerConfiguration.defaultManifestPreprocessorTXml=function(a){return shaka.util.ConfigUtils.referenceParametersAndReturn([a],a)};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.media.PreloadManager=function(a,b,c,d){shaka.util.FakeEventTarget.call(this);this.assetUri_=a;this.mimeType_=b;this.networkingEngine_=d.networkingEngine;this.startTime_=c;this.currentAdaptationSetCriteria_=null;this.startTimeOfDrm_=0;this.createDrmEngine_=d.createDrmEngine;this.manifestFilterer_=d.manifestFilterer;this.manifestPlayerInterface_=d.manifestPlayerInterface;this.config_=d.config;this.parser_=this.parserFactory_=this.manifest_=null;this.parserEntrusted_=!1;this.regionTimeline_=d.regionTimeline;
|
|
1230
1230
|
this.regionTimelineEntrusted_=!1;this.drmEngine_=null;this.drmEngineEntrusted_=!1;this.abrManager_=this.abrManagerFactory_=null;this.abrManagerEntrusted_=!1;this.segmentPrefetchById_=new Map;this.segmentPrefetchEntrusted_=!1;this.qualityObserver_=d.qualityObserver;this.stats_=new shaka.util.Stats;this.manifestPromise_=new shaka.util.PublicPromise;this.successPromise_=new shaka.util.PublicPromise;this.eventHandoffTarget_=null;this.destroyed_=!1;this.allowPrefetch_=d.allowPrefetch;this.prefetchedVariant_=
|
|
1231
1231
|
null;this.allowMakeAbrManager_=d.allowMakeAbrManager;this.hasBeenAttached_=!1;this.queuedOperations_=[];this.latePhaseQueuedOperations_=[];this.isPreload_=!0};$jscomp.inherits(shaka.media.PreloadManager,shaka.util.FakeEventTarget);shaka.media.PreloadManager.prototype.markIsLoad=function(){this.isPreload_=!1};shaka.media.PreloadManager.prototype.addQueuedOperation=function(a,b){(a=a?this.latePhaseQueuedOperations_:this.queuedOperations_)?a.push(b):b()};
|
|
1232
1232
|
shaka.media.PreloadManager.prototype.stopQueuingLatePhaseQueuedOperations=function(){if(this.latePhaseQueuedOperations_)for(var a=$jscomp.makeIterator(this.latePhaseQueuedOperations_),b=a.next();!b.done;b=a.next())b=b.value,b();this.latePhaseQueuedOperations_=null};
|
|
@@ -1262,8 +1262,8 @@ shaka.media.RegionObserver.prototype.poll=function(a,b){var c=shaka.media.Region
|
|
|
1262
1262
|
shaka.media.RegionObserver.prototype.onEvent_=function(a,b,c){a=new shaka.util.FakeEvent(a,new Map([["region",b],["seeking",c]]));this.dispatchEvent(a)};shaka.media.RegionObserver.determinePositionRelativeTo_=function(a,b){var c=shaka.media.RegionObserver.RelativePosition_;return b<a.startTime?c.BEFORE_THE_REGION:b>a.endTime?c.AFTER_THE_REGION:c.IN_THE_REGION};shaka.media.RegionObserver.RelativePosition_={BEFORE_THE_REGION:1,IN_THE_REGION:2,AFTER_THE_REGION:3};shaka.net.NetworkingUtils=function(){};
|
|
1263
1263
|
shaka.net.NetworkingUtils.getMimeType=function(a,b,c){var d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){switch(m.nextAddress){case 1:d=shaka.net.NetworkingUtils.getExtension_(a);if(e=shaka.net.NetworkingUtils.EXTENSIONS_TO_MIME_TYPES_[d])return m.return(e);f=shaka.net.NetworkingEngine.RequestType.MANIFEST;g=shaka.net.NetworkingEngine.makeRequest([a],c);m.setCatchFinallyBlocks(2);g.method="HEAD";return m.yield(b.request(f,g).promise,4);case 4:h=m.yieldResult;e=h.headers["content-type"];
|
|
1264
1264
|
m.leaveTryBlock(3);break;case 2:k=m.enterCatchBlock();if(!k||k.code!=shaka.util.Error.Code.HTTP_ERROR&&k.code!=shaka.util.Error.Code.BAD_HTTP_STATUS){m.jumpTo(3);break}g.method="GET";return m.yield(b.request(f,g).promise,6);case 6:l=m.yieldResult,e=l.headers["content-type"];case 3:return m.return(e?e.toLowerCase().split(";").shift():"")}})};shaka.net.NetworkingUtils.getExtension_=function(a){a=(new goog.Uri(a)).getPath().split("/").pop().split(".");return 1==a.length?"":a.pop().toLowerCase()};
|
|
1265
|
-
shaka.net.NetworkingUtils.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",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",
|
|
1266
|
-
ssa:"text/x-ssa",ass:"text/x-ssa",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"};shaka.text.Utils=function(){};
|
|
1265
|
+
shaka.net.NetworkingUtils.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",mov:"video/quicktime",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",ism:"application/vnd.ms-sstr+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav",sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",
|
|
1266
|
+
lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"};shaka.text.Utils=function(){};
|
|
1267
1267
|
shaka.text.Utils.flattenPayload_=function(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return shaka.text.Utils.flattenPayload_(g,a)}).join("");if(!a.payload)return a.payload;var c=[],d=a.fontWeight>=shaka.text.Cue.fontWeight.BOLD,e=a.fontStyle==shaka.text.Cue.fontStyle.ITALIC,f=a.textDecoration.includes(shaka.text.Cue.textDecoration.UNDERLINE);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;""==e&&b&&(e=b.color);d="";(e=shaka.text.Utils.getColorName_(e))&&
|
|
1268
1268
|
(d+="."+e);e=a.backgroundColor;""==e&&b&&(e=b.backgroundColor);(b=shaka.text.Utils.getColorName_(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=$jscomp.makeIterator(h);h=k.next().value;k=k.next().value;return"<"+h+(void 0===k?"":k)+">"+g+"</"+h+">"},a.payload)};
|
|
1269
1269
|
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";
|
|
@@ -1619,8 +1619,8 @@ shaka.Player.getLanguageAndRolesFrom_=function(a){var b=new Map,c=new Map;a=$jsc
|
|
|
1619
1619
|
l){k=$jscomp.makeIterator(k);for(var m=k.next();!m.done;m=k.next()){m=m.value;var n=null;c.has(l)&&c.get(l).has(m)&&(n=c.get(l).get(m));h.push({language:l,role:m,label:n})}});return h};
|
|
1620
1620
|
shaka.Player.prototype.isBufferedToEndMS_=function(){goog.asserts.assert(this.video_,"We need a video element to get buffering information");goog.asserts.assert(this.mediaSourceEngine_,"We need a media source engine to get buffering information");goog.asserts.assert(this.manifest_,"We need a manifest to get buffering information");if(this.isEnded()||this.mediaSourceEngine_.ended())return!0;if(this.manifest_.presentationTimeline.isLive()){var a=this.manifest_.presentationTimeline.getSegmentAvailabilityEnd(),
|
|
1621
1621
|
b=shaka.media.TimeRangesUtils.bufferEnd(this.video_.buffered);if(null!=b&&b>=a)return!0}return!1};shaka.Player.prototype.isBufferedToEndSrc_=function(){goog.asserts.assert(this.video_,"We need a video element to get buffering information");if(this.isEnded())return!0;var a=shaka.media.TimeRangesUtils.bufferEnd(this.video_.buffered);return null!=a&&a>=this.video_.duration-1};
|
|
1622
|
-
shaka.Player.prototype.createAbortLoadError_=function(){return new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.LOAD_INTERRUPTED)};shaka.Player.prototype.isRemotePlayback=function(){return this.video_&&this.video_.remote?"disconnected"!=this.video_.remote.state:!1};shaka.Player.prototype.isEnded=function(){return!this.video_||this.video_.ended?!0:this.video_.currentTime>=this.seekRange().end};
|
|
1623
|
-
goog.exportProperty(shaka.Player.prototype,"isEnded",shaka.Player.prototype.isEnded);goog.exportProperty(shaka.Player.prototype,"isRemotePlayback",shaka.Player.prototype.isRemotePlayback);goog.exportProperty(shaka.Player.prototype,"addFont",shaka.Player.prototype.addFont);goog.exportProperty(shaka.Player.prototype,"setVideoContainer",shaka.Player.prototype.setVideoContainer);goog.exportProperty(shaka.Player.prototype,"getFetchedPlaybackInfo",shaka.Player.prototype.getFetchedPlaybackInfo);
|
|
1622
|
+
shaka.Player.prototype.createAbortLoadError_=function(){return new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.LOAD_INTERRUPTED)};shaka.Player.prototype.isRemotePlayback=function(){return this.video_&&this.video_.remote?"disconnected"!=this.video_.remote.state:!1};shaka.Player.prototype.isEnded=function(){return!this.video_||this.video_.ended?!0:this.fullyLoaded_&&!this.isLive()&&this.video_.currentTime>=this.seekRange().end};
|
|
1623
|
+
goog.exportSymbol("shaka.Player",shaka.Player);goog.exportProperty(shaka.Player.prototype,"isEnded",shaka.Player.prototype.isEnded);goog.exportProperty(shaka.Player.prototype,"isRemotePlayback",shaka.Player.prototype.isRemotePlayback);goog.exportProperty(shaka.Player.prototype,"addFont",shaka.Player.prototype.addFont);goog.exportProperty(shaka.Player.prototype,"setVideoContainer",shaka.Player.prototype.setVideoContainer);goog.exportProperty(shaka.Player.prototype,"getFetchedPlaybackInfo",shaka.Player.prototype.getFetchedPlaybackInfo);
|
|
1624
1624
|
goog.exportProperty(shaka.Player.prototype,"getManifestParserFactory",shaka.Player.prototype.getManifestParserFactory);goog.exportProperty(shaka.Player.prototype,"getManifest",shaka.Player.prototype.getManifest);goog.exportProperty(shaka.Player.prototype,"retryStreaming",shaka.Player.prototype.retryStreaming);goog.exportProperty(shaka.Player.prototype,"setMaxHardwareResolution",shaka.Player.prototype.setMaxHardwareResolution);goog.exportProperty(shaka.Player.prototype,"addChaptersTrack",shaka.Player.prototype.addChaptersTrack);
|
|
1625
1625
|
goog.exportProperty(shaka.Player.prototype,"addThumbnailsTrack",shaka.Player.prototype.addThumbnailsTrack);goog.exportProperty(shaka.Player.prototype,"addTextTrackAsync",shaka.Player.prototype.addTextTrackAsync);goog.exportProperty(shaka.Player.prototype,"getStats",shaka.Player.prototype.getStats);goog.exportProperty(shaka.Player.prototype,"getBufferedInfo",shaka.Player.prototype.getBufferedInfo);goog.exportProperty(shaka.Player.prototype,"getSegmentAvailabilityDuration",shaka.Player.prototype.getSegmentAvailabilityDuration);
|
|
1626
1626
|
goog.exportProperty(shaka.Player.prototype,"getPresentationStartTimeAsDate",shaka.Player.prototype.getPresentationStartTimeAsDate);goog.exportProperty(shaka.Player.prototype,"getPlayheadTimeAsDate",shaka.Player.prototype.getPlayheadTimeAsDate);goog.exportProperty(shaka.Player.prototype,"setTextTrackVisibility",shaka.Player.prototype.setTextTrackVisibility);goog.exportProperty(shaka.Player.prototype,"getChapters",shaka.Player.prototype.getChapters);
|
|
@@ -1635,7 +1635,7 @@ goog.exportProperty(shaka.Player.prototype,"getMediaElement",shaka.Player.protot
|
|
|
1635
1635
|
goog.exportProperty(shaka.Player.prototype,"getNonDefaultConfiguration",shaka.Player.prototype.getNonDefaultConfiguration);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);goog.exportProperty(shaka.Player.prototype,"destroyAllPreloads",shaka.Player.prototype.destroyAllPreloads);
|
|
1636
1636
|
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);goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);
|
|
1637
1637
|
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);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);
|
|
1638
|
-
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.11.
|
|
1638
|
+
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.11.21-debug";
|
|
1639
1639
|
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.errors_=this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};shaka.ads.AdsStats.prototype.incrementErrors=function(){this.errors_++};
|
|
1640
1640
|
shaka.ads.AdsStats.prototype.getAverageLoadTime_=function(){return this.loadTimes_.length?this.loadTimes_.reduce(function(a,b){return a+b},0)/this.loadTimes_.length:0};shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,averageLoadTime:this.getAverageLoadTime_(),started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_,errors:this.errors_}};shaka.ads.ClientSideAd=function(a,b,c){var d=this;this.ad_=a;this.manager_=b;this.video_=c;this.isPaused_=!1;this.volume_=this.manager_.getVolume();this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.PAUSED,function(){d.isPaused_=!0});this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.RESUMED,function(){d.isPaused_=!1})};shaka.ads.ClientSideAd.prototype.needsSkipUI=function(){return!1};
|
|
1641
1641
|
shaka.ads.ClientSideAd.prototype.isClientRendering=function(){return!0};shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};shaka.ads.ClientSideAd.prototype.getMinSuggestedDuration=function(){return this.ad_.getMinSuggestedDuration()};shaka.ads.ClientSideAd.prototype.getRemainingTime=function(){return this.manager_.getRemainingTime()};shaka.ads.ClientSideAd.prototype.isPaused=function(){return this.isPaused_};
|
|
@@ -2003,8 +2003,8 @@ shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_DATA=2;shaka.cea.DtvccPacketBuilder.DT
|
|
|
2003
2003
|
shaka.cea.Cea708Service.prototype.handleCea708ControlCode=function(a){var b=a.readByte(),c=b.value;b=b.pts;if(c===shaka.cea.Cea708Service.EXT_CEA708_CTRL_CODE_BYTE1){var d=a.readByte();c=c<<16|d.value}if(0<=c&&31>=c)return this.handleC0_(a,c,b);if(128<=c&&159>=c)return this.handleC1_(a,c,b);4096<=c&&4127>=c?this.handleC2_(a,c&255):4224<=c&&4255>=c?this.handleC3_(a,c&255):32<=c&&127>=c?this.handleG0_(c):160<=c&&255>=c?this.handleG1_(c):4128<=c&&4223>=c?this.handleG2_(c&255):4256<=c&&4351>=c&&this.handleG3_(c&
|
|
2004
2004
|
255);return null};shaka.cea.Cea708Service.prototype.handleG0_=function(a){this.currentWindow_&&(127===a?this.currentWindow_.setCharacter("\u266a"):this.currentWindow_.setCharacter(String.fromCharCode(a)))};shaka.cea.Cea708Service.prototype.handleG1_=function(a){this.currentWindow_&&this.currentWindow_.setCharacter(String.fromCharCode(a))};
|
|
2005
2005
|
shaka.cea.Cea708Service.prototype.handleG2_=function(a){this.currentWindow_&&(shaka.cea.Cea708Service.G2Charset.has(a)?(a=shaka.cea.Cea708Service.G2Charset.get(a),this.currentWindow_.setCharacter(a)):this.currentWindow_.setCharacter("_"))};shaka.cea.Cea708Service.prototype.handleG3_=function(a){this.currentWindow_&&(160!=a?this.currentWindow_.setCharacter("_"):this.currentWindow_.setCharacter("[CC]"))};
|
|
2006
|
-
shaka.cea.Cea708Service.prototype.handleC0_=function(a,b,c){if(!this.currentWindow_)return null;if(24==b)
|
|
2007
|
-
|
|
2006
|
+
shaka.cea.Cea708Service.prototype.handleC0_=function(a,b,c){if(!this.currentWindow_)return null;if(24==b)return b=a.readByte().value,c=a.readByte().value,b=function(e){return e.map(function(f){return("0"+(f&255).toString(16)).slice(-2)}).join("")}([b,c]),b=String.fromCharCode(parseInt(b,16)),this.currentWindow_.setCharacter(b),null;a=this.currentWindow_;var d=null;switch(b){case shaka.cea.Cea708Service.ASCII_BACKSPACE:a.backspace();break;case shaka.cea.Cea708Service.ASCII_CARRIAGE_RETURN:a.isVisible()&&
|
|
2007
|
+
(d=a.forceEmit(c,this.serviceNumber_));a.carriageReturn();break;case shaka.cea.Cea708Service.ASCII_HOR_CARRIAGE_RETURN:a.isVisible()&&(d=a.forceEmit(c,this.serviceNumber_));a.horizontalCarriageReturn();break;case shaka.cea.Cea708Service.ASCII_FORM_FEED:a.isVisible()&&(d=a.forceEmit(c,this.serviceNumber_)),a.resetMemory(),a.setPenLocation(0,0)}return d};
|
|
2008
2008
|
shaka.cea.Cea708Service.prototype.handleC1_=function(a,b,c){if(128<=b&&135>=b)this.setCurrentWindow_(b&7);else{if(136===b)return a=a.readByte().value,this.clearWindows_(a,c);if(137===b)a=a.readByte().value,this.displayWindows_(a,c);else{if(138===b)return a=a.readByte().value,this.hideWindows_(a,c);if(139===b)return a=a.readByte().value,this.toggleWindows_(a,c);if(140===b)return a=a.readByte().value,this.deleteWindows_(a,c);if(143===b)return this.reset_(c);144===b?this.setPenAttributes_(a):145===b?
|
|
2009
2009
|
this.setPenColor_(a):146===b?this.setPenLocation_(a):151===b?this.setWindowAttributes_(a):152<=b&&159>=b&&this.defineWindow_(a,(b&15)-8,c)}}return null};shaka.cea.Cea708Service.prototype.handleC2_=function(a,b){8<=b&&15>=b?a.skip(1):16<=b&&23>=b?a.skip(2):24<=b&&31>=b&&a.skip(3)};shaka.cea.Cea708Service.prototype.handleC3_=function(a,b){128<=b&&135>=b?a.skip(4):136<=b&&143>=b&&a.skip(5)};shaka.cea.Cea708Service.prototype.setCurrentWindow_=function(a){this.windows_[a]&&(this.currentWindow_=this.windows_[a])};
|
|
2010
2010
|
shaka.cea.Cea708Service.prototype.getSpecifiedWindowIds_=function(a){for(var b=[],c=0;8>c;c++)1===(a&1)&&this.windows_[c]&&b.push(c),a>>=1;return b};shaka.cea.Cea708Service.prototype.clearWindows_=function(a,b){var c=null;a=$jscomp.makeIterator(this.getSpecifiedWindowIds_(a));for(var d=a.next();!d.done;d=a.next())d=this.windows_[d.value],d.isVisible()&&(c=d.forceEmit(b,this.serviceNumber_)),d.resetMemory();return c};
|
|
@@ -2134,9 +2134,9 @@ shaka.dash.SegmentList.parseMediaSegments_=function(a){var b=[a.representation.s
|
|
|
2134
2134
|
var f=d.htmlUnescape(e.attributes.media);e=c.parseAttr(e,"mediaRange",c.parseRange,{start:0,end:null});return{mediaUri:f,start:e.start,end:e.end}})};shaka.dash.SegmentTemplate=function(){};
|
|
2135
2135
|
shaka.dash.SegmentTemplate.createStreamInfo=function(a,b,c,d,e,f,g,h,k){goog.asserts.assert(a.representation.segmentTemplate,"Should only be called with SegmentTemplate or segment info defined");var l=shaka.dash.MpdUtils,m=shaka.dash.SegmentTemplate,n=shaka.dash.TimelineSegmentIndex;k||a.representation.initialization||(a.representation.initialization=l.inheritAttribute(a,m.fromInheritance_,"initialization"));var p=a.representation.initialization?m.createInitSegment_(a,g):null,q=m.parseSegmentTemplateInfo_(a);
|
|
2136
2136
|
m.checkSegmentTemplateInfo_(a,q);var r=shaka.util.ObjectUtils.shallowCloneObject(a);if(q.indexTemplate)return shaka.dash.SegmentBase.checkSegmentIndexSupport(a,p),{generateSegmentIndex:function(){return m.generateSegmentIndexFromIndexTemplate_(r,b,p,q)}};if(q.segmentDuration)return d||"image"===a.adaptationSet.contentType||"text"===a.adaptationSet.contentType||(c=a.periodInfo.start,n=a.period.id,d=a.periodInfo.duration,n=(n=null!=n&&f[n]||d)?c+n:Infinity,a.presentationTimeline.notifyMaxSegmentDuration(q.segmentDuration),
|
|
2137
|
-
a.presentationTimeline.notifyPeriodDuration(c,n)),{generateSegmentIndex:function(){return m.generateSegmentIndexFromDuration_(r,q,e,p,f,g,h,a.representation.segmentSequenceCadence)}};var t=null;d=d=null;a.period.id&&a.representation.id&&(d=a.period.id+","+a.representation.id,d=c[d])&&(t=d.segmentIndex);var u=a.periodInfo.start,v=a.periodInfo.duration?u+a.periodInfo.duration:Infinity;shaka.log.debug("New manifest "+u+" - "+v);
|
|
2138
|
-
|
|
2139
|
-
|
|
2137
|
+
a.presentationTimeline.notifyPeriodDuration(c,n)),{generateSegmentIndex:function(){return m.generateSegmentIndexFromDuration_(r,q,e,p,f,g,h,a.representation.segmentSequenceCadence)}};var t=null;d=d=null;a.period.id&&a.representation.id&&(d=a.period.id+","+a.representation.id,d=c[d])&&(t=d.segmentIndex);var u=a.periodInfo.start,v=a.periodInfo.duration?u+a.periodInfo.duration:Infinity;shaka.log.debug("New manifest "+u+" - "+v);t?(c=t,c.appendTemplateInfo(q,u,v,p),n=a.presentationTimeline.getSegmentAvailabilityStart(),
|
|
2138
|
+
c.evict(n)):(shaka.log.debug("Creating TSI with end "+v),t=new n(q,a.representation.id,a.bandwidth,a.representation.getBaseUris,a.urlParams,u,v,p,g,a.representation.segmentSequenceCadence));q.timeline&&"image"!==a.adaptationSet.contentType&&"text"!==a.adaptationSet.contentType&&(c=t.getTimeline(),a.presentationTimeline.notifyTimeRange(c,u));d&&a.dynamic&&(d.segmentIndex=t);return{generateSegmentIndex:function(){t instanceof shaka.dash.TimelineSegmentIndex&&t.isEmpty()&&t.appendTemplateInfo(q,u,v,
|
|
2139
|
+
p);return Promise.resolve(t)}}};shaka.dash.SegmentTemplate.modifyTimepoints=function(a,b){var c=shaka.util.TXml;a=shaka.dash.MpdUtils.inheritChild(a,shaka.dash.SegmentTemplate.fromInheritance_,"SegmentTimeline");goog.asserts.assert(a,"timeline node not found");var d=c.findChildren(a,"S");goog.asserts.assert(d,"timepoints should exist");c.modifyNodes(d,b);a.children=d};
|
|
2140
2140
|
shaka.dash.SegmentTemplate.removeTimepoints=function(a){a=shaka.dash.MpdUtils.inheritChild(a,shaka.dash.SegmentTemplate.fromInheritance_,"SegmentTimeline");goog.asserts.assert(a,"timeline node not found");a.children=[]};shaka.dash.SegmentTemplate.fromInheritance_=function(a){return a.segmentTemplate};
|
|
2141
2141
|
shaka.dash.SegmentTemplate.parseSegmentTemplateInfo_=function(a){var b=shaka.dash.SegmentTemplate,c=shaka.dash.MpdUtils,d=shaka.util.StringUtils,e=c.parseSegmentInfo(a,b.fromInheritance_),f=c.inheritAttribute(a,b.fromInheritance_,"media"),g=c.inheritAttribute(a,b.fromInheritance_,"index");b=c.inheritAttribute(a,b.fromInheritance_,"k");c=0;b&&(c=parseInt(b,10));return{unscaledSegmentDuration:e.unscaledSegmentDuration,segmentDuration:e.segmentDuration,timescale:e.timescale,startNumber:e.startNumber,
|
|
2142
2142
|
scaledPresentationTimeOffset:e.scaledPresentationTimeOffset,unscaledPresentationTimeOffset:e.unscaledPresentationTimeOffset,timeline:e.timeline,mediaTemplate:f&&d.htmlUnescape(f),indexTemplate:g,mimeType:a.representation.mimeType,codecs:a.representation.codecs,bandwidth:a.bandwidth,numChunks:c}};
|
|
@@ -2152,12 +2152,14 @@ K,"Generated a segment outside of the period!");var O=[],P=b.numChunks;if(P)for(
|
|
|
2152
2152
|
A=m.getSegmentAvailabilityEnd()<r();H=m.isLive();if(A||H){var F=Math.max(c,g+1);c=t;a.representation.availabilityTimeOffset&&(c=.1);E.updateEvery(c,function(){var L=m.getSegmentAvailabilityStart();E.evict(L);var J=$jscomp.makeIterator(y());J.next();J=J.next().value;for(var M=[];F<=J;){var K=D(F);M.push(K);F++}return L>r()&&!M.length?null:M})}return Promise.resolve(E)};
|
|
2153
2153
|
shaka.dash.SegmentTemplate.createInitSegment_=function(a,b){var c=shaka.dash.MpdUtils,d=shaka.util.ManifestParserUtils,e=shaka.dash.SegmentTemplate,f=a.representation.initialization;f||(f=c.inheritAttribute(a,e.fromInheritance_,"initialization"));if(!f)return null;f=shaka.util.StringUtils.htmlUnescape(f);var g=a.representation.id,h=a.bandwidth||null,k=a.representation.getBaseUris,l=a.urlParams;e=shaka.dash.SegmentBase.createQualityInfo(a);b=new shaka.media.InitSegmentReference(function(){goog.asserts.assert(f,
|
|
2154
2154
|
"Should have returned earler");var m=c.fillUriTemplate(f,g,null,null,h,null);return d.resolveUris(k(),[m],l())},0,null,e,null,null,b);b.codecs=a.representation.codecs;b.mimeType=a.representation.mimeType;return b};
|
|
2155
|
-
shaka.dash.TimelineSegmentIndex=function(a,b,c,d,e,f,g,h,k,l
|
|
2155
|
+
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.urlParams_=e;this.periodStart_=f;this.periodEnd_=g;this.initSegmentReference_=h;this.aesKey_=k;this.segmentSequenceCadence_=l;this.fitTimeline()};$jscomp.inherits(shaka.dash.TimelineSegmentIndex,shaka.media.SegmentIndex);
|
|
2156
2156
|
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};
|
|
2157
2157
|
shaka.dash.TimelineSegmentIndex.prototype.evict=function(a){if(this.templateInfo_){shaka.log.debug(this.representationId_+" Evicting at "+a);for(var b=0,c=this.templateInfo_.timeline,d=0;d<c.length;d+=1){var e=c[d],f=e.end+this.periodStart_;e=e.start+this.periodStart_;if(f<=a)shaka.log.debug("Evicting "+e+" - "+f),b+=1;else break}0<b&&(this.templateInfo_.timeline=c.slice(b),this.references.length>=b&&(this.references=this.references.slice(b)),this.numEvicted_+=b,0===this.getNumReferences()&&this.release())}};
|
|
2158
|
-
shaka.dash.TimelineSegmentIndex.prototype.appendTemplateInfo=function(a,b,c,d
|
|
2159
|
-
$jscomp.arrayFromIterable(a)));this.periodEnd_!==c&&(this.periodEnd_=c)}else this.templateInfo_=a,this.periodStart_=b,this.periodEnd_=c;
|
|
2160
|
-
shaka.dash.TimelineSegmentIndex.prototype.isBeforeFirstEntry=function(a){return this.templateInfo_&&this.templateInfo_.timeline&&this.templateInfo_.timeline.length?a<this.templateInfo_.timeline[0].start+this.periodStart_:!1};
|
|
2158
|
+
shaka.dash.TimelineSegmentIndex.prototype.appendTemplateInfo=function(a,b,c,d){this.updateInitSegmentReference(d);if(this.templateInfo_){b=this.templateInfo_.timeline;this.templateInfo_.mediaTemplate!==a.mediaTemplate&&(this.templateInfo_.mediaTemplate=a.mediaTemplate);if(b.length){var e=b[b.length-1];a=a.timeline.filter(function(f){return f.end>e.end})}else a=a.timeline.slice();0<a.length&&(shaka.log.debug("Appending "+a.length+" entries"),this.templateInfo_.timeline.push.apply(this.templateInfo_.timeline,
|
|
2159
|
+
$jscomp.arrayFromIterable(a)));this.periodEnd_!==c&&(this.periodEnd_=c)}else this.templateInfo_=a,this.periodStart_=b,this.periodEnd_=c;this.fitTimeline()};shaka.dash.TimelineSegmentIndex.prototype.updateInitSegmentReference=function(a){if(this.initSegmentReference_!==a){this.initSegmentReference_=a;for(var b=$jscomp.makeIterator(this.references),c=b.next();!c.done;c=b.next())(c=c.value)&&c.updateInitSegmentReference(a)}};
|
|
2160
|
+
shaka.dash.TimelineSegmentIndex.prototype.isBeforeFirstEntry=function(a){return this.templateInfo_&&this.templateInfo_.timeline&&this.templateInfo_.timeline.length?a<this.templateInfo_.timeline[0].start+this.periodStart_:!1};
|
|
2161
|
+
shaka.dash.TimelineSegmentIndex.prototype.fitTimeline=function(){if(!this.getIsImmutable()){var a=this.templateInfo_.timeline;goog.asserts.assert(a,"Timeline should be non-null!");var b=[];a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.start>=this.periodEnd_||0>=c.end||b.push(c);this.templateInfo_.timeline=b;this.evict(this.periodStart_)}};
|
|
2162
|
+
shaka.dash.TimelineSegmentIndex.prototype.getTimeline=function(){if(!this.templateInfo_)return[];var a=this.templateInfo_.timeline;goog.asserts.assert(a,"Timeline should be non-null!");return a};
|
|
2161
2163
|
shaka.dash.TimelineSegmentIndex.prototype.find=function(a){shaka.log.debug("Find "+a);if(this.isBeforeFirstEntry(a))return this.numEvicted_;if(!this.templateInfo_)return null;var b=this.templateInfo_.timeline;if(a<this.periodStart_||a>=this.periodEnd_)return null;for(var c=b.length-1,d=0;d<b.length;d++){var e=b[d],f=e.start+this.periodStart_;e=d<c?b[d+1].start+this.periodStart_:Infinity===this.periodEnd_?e.end+this.periodStart_:this.periodEnd_;if(a>=f&&a<e)return d+this.numEvicted_}return null};
|
|
2162
2164
|
shaka.dash.TimelineSegmentIndex.prototype.get=function(a){var b=this;a-=this.numEvicted_;if(0>a||a>=this.getNumReferences()||!this.templateInfo_)return null;var c=this.references[a];if(!c){var d=this.templateInfo_.timeline[a],e=d.segmentPosition,f=d.unscaledStart+this.templateInfo_.unscaledPresentationTimeOffset;c=this.periodStart_-this.templateInfo_.scaledPresentationTimeOffset;var g=this.periodStart_+d.end,h=g;a===this.getNumReferences()-1&&Infinity!==this.periodEnd_&&(h=this.periodEnd_);for(var k=
|
|
2163
2165
|
this.templateInfo_.codecs,l=this.templateInfo_.mimeType,m=this.templateInfo_.bandwidth,n=[],p=(d.end-d.start)/d.partialSegments,q={},r=0;r<d.partialSegments;q={uris$jscomp$13:void 0,subNumber$jscomp$2:void 0},r++){var t=d.start+p*r,u=t+p;q.subNumber$jscomp$2=r+1;q.uris$jscomp$13=null;q=function(v){return function(){if(!b.templateInfo_)return[];null==v.uris$jscomp$13&&(v.uris$jscomp$13=shaka.dash.TimelineSegmentIndex.createUris_(b.templateInfo_.mediaTemplate,b.representationId_,e,b.bandwidth_,f,v.subNumber$jscomp$2,
|
|
@@ -2258,12 +2260,12 @@ d.parseAttr(a,"publishTime",d.parseDate)||0;c.patchLocationNodes_=d.findChildren
|
|
|
2258
2260
|
c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(v),w=d.getContents(u))(x=d.parseAttr(u,"queryBeforeStart",d.parseBoolean,!1))?t=c.contentSteeringManager_.requestInfo(w):c.contentSteeringManager_.requestInfo(w);z=$jscomp.makeIterator(g.keys());for(B=z.next();!B.done;B=z.next())C=B.value,y=g.get(C),c.contentSteeringManager_.addLocation("Location",C,y)}A=d.findChildren(a,"BaseURL");D=!1;if(c.contentSteeringManager_)for(H=$jscomp.makeIterator(A),G=H.next();!G.done;G=
|
|
2259
2261
|
H.next())E=G.value,F=E.attributes.serviceLocation,L=d.getContents(E),F&&L&&(c.contentSteeringManager_.addLocation("BaseURL",F,L),D=!0);c.lastCalculatedBaseUris_=null;D&&c.contentSteeringManager_||(J=A.map(d.getContents),c.lastCalculatedBaseUris_=shaka.util.ManifestParserUtils.resolveUris(e,J));M=function(){return c.contentSteeringManager_&&D?c.contentSteeringManager_.getLocations("BaseURL"):c.lastCalculatedBaseUris_?c.lastCalculatedBaseUris_:[]};c.manifestPatchContext_.getBaseUris=M;K=0;A&&A.length&&
|
|
2260
2262
|
(K=d.parseAttr(A[0],"availabilityTimeOffset",d.parseFloat)||0);c.manifestPatchContext_.availabilityTimeOffset=K;I=c.config_.dash.ignoreMinBufferTime;O=0;I||(O=d.parseAttr(a,"minBufferTime",d.parseDuration)||0);c.updatePeriod_=d.parseAttr(a,"minimumUpdatePeriod",d.parseDuration,-1);P=d.parseAttr(a,"availabilityStartTime",d.parseDate);N=d.parseAttr(a,"timeShiftBufferDepth",d.parseDuration);Q=c.config_.dash.ignoreSuggestedPresentationDelay;S=null;Q||(S=d.parseAttr(a,"suggestedPresentationDelay",d.parseDuration));
|
|
2261
|
-
T=c.config_.dash.ignoreMaxSegmentDuration;W=null;T||(W=d.parseAttr(a,"maxSegmentDuration",d.parseDuration));U=a.attributes.type||"static";c.manifest_&&c.manifest_.presentationTimeline&&(c.isTransitionFromDynamicToStatic_=c.manifest_.presentationTimeline.isLive()&&"static"==U);c.manifestPatchContext_.type=U;c.cleanStreamMap_();if(c.manifest_)for(R=c.manifest_.presentationTimeline,X=$jscomp.makeIterator(Object.values(c.streamMap_)),V
|
|
2262
|
-
else
|
|
2263
|
-
bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:K,mediaPresentationDuration:null,profiles:da.split(","),roles:null,urlParams:function(){return""}};c.gapCount_=0;fa=c.parsePeriods_(ha,M,a,!1);ia=fa.duration;ea=fa.periods;("static"!=U||c.isTransitionFromDynamicToStatic_)&&fa.durationDerivedFromPeriods||R.setDuration(ia||Infinity);c.isLowLatency_&&!c.lowLatencyMode_&&
|
|
2264
|
-
c.lowLatencyMode_&&R.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_);R.notifyMaxSegmentDuration(W||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&R.assertIsValid();return aa.yield(t,2);case 2:c.lowLatencyMode_&&(O=0,ja=null!=S?S:c.config_.defaultPresentationDelay,R.setDelay(ja));if(!c.manifest_)return aa.yield(c.periodCombiner_.combinePeriods(ea,
|
|
2265
|
-
{presentationTimeline:R,variants:c.periodCombiner_.getVariants(),textStreams:c.periodCombiner_.getTextStreams(),imageStreams:c.periodCombiner_.getImageStreams(),offlineSessionIds:[],minBufferTime:O||0,sequenceMode:c.config_.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:shaka.media.ManifestParser.DASH,serviceDescription:c.parseServiceDescription_(a),
|
|
2266
|
-
break}ka=shaka.util.TXml;la=ka.findChildren(a,"UTCTiming");return aa.yield(c.parseUtcTiming_(M,la),8);case 8:ma=aa.yieldResult;if(!c.playerInterface_)return aa.return();R.setClockOffset(ma);case 7:R.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),aa.jumpToEnd()}})};
|
|
2263
|
+
T=c.config_.dash.ignoreMaxSegmentDuration;W=null;T||(W=d.parseAttr(a,"maxSegmentDuration",d.parseDuration));U=a.attributes.type||"static";c.manifest_&&c.manifest_.presentationTimeline&&(c.isTransitionFromDynamicToStatic_=c.manifest_.presentationTimeline.isLive()&&"static"==U);c.manifestPatchContext_.type=U;c.cleanStreamMap_();if(c.manifest_)for(R=c.manifest_.presentationTimeline,X=R.getSegmentAvailabilityStart(),V=$jscomp.makeIterator(Object.values(c.streamMap_)),Y=V.next();!Y.done;Y=V.next())ba=
|
|
2264
|
+
Y.value,ba.segmentIndex&&ba.segmentIndex.evict(X);else ca=0,ca=null!=S?Math.min(S,N||Infinity):0<c.config_.defaultPresentationDelay?c.config_.defaultPresentationDelay:Math.min(1.5*O,N||Infinity),R=new shaka.media.PresentationTimeline(P,ca,c.config_.dash.autoCorrectDrift);R.setStatic("static"==U);(Z=R.isLive())&&!isNaN(c.config_.availabilityWindowOverride)&&(N=c.config_.availabilityWindowOverride);null==N&&(N=Infinity);R.setSegmentAvailabilityDuration(N);da=a.attributes.profiles||"";c.manifestPatchContext_.profiles=
|
|
2265
|
+
da.split(",");ha={dynamic:"static"!=U,presentationTimeline:R,period:null,periodInfo:null,adaptationSet:null,representation:null,bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:K,mediaPresentationDuration:null,profiles:da.split(","),roles:null,urlParams:function(){return""}};c.gapCount_=0;fa=c.parsePeriods_(ha,M,a,!1);ia=fa.duration;ea=fa.periods;("static"!=U||c.isTransitionFromDynamicToStatic_)&&fa.durationDerivedFromPeriods||R.setDuration(ia||Infinity);c.isLowLatency_&&!c.lowLatencyMode_&&
|
|
2266
|
+
(na=c.playerInterface_.isAutoLowLatencyMode())&&(c.playerInterface_.enableLowLatencyMode(),c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());c.lowLatencyMode_&&R.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_);R.notifyMaxSegmentDuration(W||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&R.assertIsValid();return aa.yield(t,2);case 2:c.lowLatencyMode_&&(O=0,ja=null!=S?S:c.config_.defaultPresentationDelay,R.setDelay(ja));if(!c.manifest_)return aa.yield(c.periodCombiner_.combinePeriods(ea,
|
|
2267
|
+
ha.dynamic),6);c.manifest_.periodCount=ea.length;c.manifest_.gapCount=c.gapCount_;return aa.yield(c.postPeriodProcessing_(ea,!1),4);case 6:c.manifest_={presentationTimeline:R,variants:c.periodCombiner_.getVariants(),textStreams:c.periodCombiner_.getTextStreams(),imageStreams:c.periodCombiner_.getImageStreams(),offlineSessionIds:[],minBufferTime:O||0,sequenceMode:c.config_.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:shaka.media.ManifestParser.DASH,serviceDescription:c.parseServiceDescription_(a),
|
|
2268
|
+
nextUrl:c.parseMpdChaining_(a),periodCount:ea.length,gapCount:c.gapCount_,isLowLatency:c.isLowLatency_,startTime:null};if(!R.usingPresentationStartTime()){aa.jumpTo(7);break}ka=shaka.util.TXml;la=ka.findChildren(a,"UTCTiming");return aa.yield(c.parseUtcTiming_(M,la),8);case 8:ma=aa.yieldResult;if(!c.playerInterface_)return aa.return();R.setClockOffset(ma);case 7:R.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),aa.jumpToEnd()}})};
|
|
2267
2269
|
shaka.dash.DashParser.prototype.postPeriodProcessing_=function(a,b){var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress)return e.yield(c.periodCombiner_.combinePeriods(a,!0,b),2);c.manifest_.variants=c.periodCombiner_.getVariants();d=c.periodCombiner_.getTextStreams();0<d.length&&(c.manifest_.textStreams=d);c.manifest_.imageStreams=c.periodCombiner_.getImageStreams();c.playerInterface_.filter(c.manifest_);e.jumpToEnd()})};
|
|
2268
2270
|
shaka.dash.DashParser.prototype.processPatchManifest_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,C,y,A,D,H,G,E,F,L;return $jscomp.asyncExecutePromiseGeneratorProgram(function(J){if(1==J.nextAddress){c=shaka.util.TXml;d=a.attributes.mpdId;e=c.parseAttr(a,"originalPublishTime",c.parseDate);if(!d||d!==b.manifestPatchContext_.mpdId||e!==b.manifestPatchContext_.publishTime)throw b.patchLocationNodes_=[],new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.MANIFEST,
|
|
2269
2271
|
shaka.util.Error.Code.DASH_INVALID_PATCH);f=[];g=[];h=new Set;k=$jscomp.makeIterator(c.getChildNodes(a));for(l=k.next();!l.done;l=k.next()){m=l.value;n=!0;p=c.parseXpath(m.attributes.sel||"");q=p[p.length-1];r=c.getContents(m)||"";if("MPD"===q.name)"mediaPresentationDuration"===q.attribute?(t=c.getContents(m)||"",b.parsePatchMediaPresentationDurationChange_(t)):"type"===q.attribute?b.parsePatchMpdTypeChange_(r):"publishTime"===q.attribute?b.manifestPatchContext_.publishTime=c.parseDate(r)||0:null===
|
|
@@ -2358,7 +2360,7 @@ shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);c=d.splice(f,d.length-f);c
|
|
|
2358
2360
|
shaka.hls.ManifestTextParser.prototype.parseSegments_=function(a,b){var c=[],d=[],e=[],f=null;a=$jscomp.makeIterator(a);for(var g=a.next();!g.done;g=a.next())g=g.value,/^(#EXT)/.test(g)?(g=this.parseTag_(g),shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS.includes(g.name)?b.push(g):"EXT-X-MAP"==g.name?f=g:"EXT-X-PART"==g.name?e.push(g):"EXT-X-PRELOAD-HINT"==g.name?"PART"==g.getAttributeValue("TYPE")?e.push(g):"MAP"==g.getAttributeValue("TYPE")&&(g.setName("EXT-X-MAP"),f=g):d.push(g)):shaka.hls.Utils.isComment(g)||
|
|
2359
2361
|
(g=g.trim(),f&&d.push(f),d=new shaka.hls.Segment(g,d,e),c.push(d),d=[],e=[]);e.length&&(f&&d.push(f),b=new shaka.hls.Segment("",d,e),c.push(b));return c};shaka.hls.ManifestTextParser.prototype.parseTag_=function(a){return shaka.hls.ManifestTextParser.parseTag(this.globalId_++,a)};
|
|
2360
2362
|
shaka.hls.ManifestTextParser.parseTag=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.INVALID_HLS_TAG,b);b=c[1];var d=c[2];c=[];var e;if(d){d=new shaka.util.TextParser(d);var f,g=d.readRegex(/^([^,=]+)(?:,|$)/g);g&&(e=g[1]);for(g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;f=d.readRegex(g);)f=new shaka.hls.Attribute(f[1],f[2]||f[3]),c.push(f),d.skipWhitespace()}return new shaka.hls.Tag(a,
|
|
2361
|
-
b,c,e)};shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" ");shaka.hls.ManifestTextParser.SEGMENT_TAGS="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP".split(" ");shaka.net.DataUriPlugin=function(){};shaka.net.DataUriPlugin.parse=function(a,b,c,d){try{var e=shaka.net.DataUriPlugin.parseRaw(a);return shaka.util.AbortableOperation.completed({uri:a,originalUri:a,data:e.data,headers:{"content-type":e.contentType}})}catch(f){return shaka.util.AbortableOperation.failed(f)}};
|
|
2363
|
+
b,c,e)};shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" ");shaka.hls.ManifestTextParser.SEGMENT_TAGS="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" ");shaka.net.DataUriPlugin=function(){};shaka.net.DataUriPlugin.parse=function(a,b,c,d){try{var e=shaka.net.DataUriPlugin.parseRaw(a);return shaka.util.AbortableOperation.completed({uri:a,originalUri:a,data:e.data,headers:{"content-type":e.contentType}})}catch(f){return shaka.util.AbortableOperation.failed(f)}};
|
|
2362
2364
|
shaka.net.DataUriPlugin.parseRaw=function(a){var b=a.split(":");if(2>b.length||"data"!=b[0])throw shaka.log.error("Bad data URI, failed to parse scheme"),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.MALFORMED_DATA_URI,a);b=b.slice(1).join(":").split(",");if(2>b.length)throw shaka.log.error("Bad data URI, failed to extract encoding and MIME type"),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.NETWORK,
|
|
2363
2365
|
shaka.util.Error.Code.MALFORMED_DATA_URI,a);var c=b[0];a=window.decodeURIComponent(b.slice(1).join(","));b=c.split(";");c=b[0];var d=!1;1<b.length&&"base64"==b[b.length-1]&&(d=!0,b.pop());return{data:d?shaka.util.Uint8ArrayUtils.fromBase64(a):shaka.util.StringUtils.toUTF8(a),contentType:c}};goog.exportSymbol("shaka.net.DataUriPlugin",shaka.net.DataUriPlugin);goog.exportProperty(shaka.net.DataUriPlugin,"parse",shaka.net.DataUriPlugin.parse);shaka.net.NetworkingEngine.registerScheme("data",shaka.net.DataUriPlugin.parse);shaka.hls.HlsParser=function(){var a=this;this.config_=this.playerInterface_=null;this.globalId_=1;this.globalVariables_=new Map;this.groupIdToStreamInfosMap_=new Map;this.mediaSequenceToStartTimeByType_=new Map;var b=shaka.util.ManifestParserUtils.ContentType;this.mediaSequenceToStartTimeByType_.set(b.VIDEO,new Map);this.mediaSequenceToStartTimeByType_.set(b.AUDIO,new Map);this.mediaSequenceToStartTimeByType_.set(b.TEXT,new Map);this.mediaSequenceToStartTimeByType_.set(b.IMAGE,new Map);this.variantUriSet_=
|
|
2364
2366
|
new Set;this.uriToStreamInfosMap_=new Map;this.presentationTimeline_=null;this.masterPlaylistUri_="";this.manifestTextParser_=new shaka.hls.ManifestTextParser;this.minSequenceNumber_=-1;this.lowestSyncTime_=Infinity;this.codecInfoInManifest_=this.streamsFinalized_=this.usesProgramDateTime_=!1;this.updatePlaylistTimer_=new shaka.util.Timer(function(){if(a.mediaElement_&&!a.config_.continueLoadingWhenPaused&&(a.eventManager_.unlisten(a.mediaElement_,"timeupdate"),a.mediaElement_.paused)){a.eventManager_.listenOnce(a.mediaElement_,
|
|
@@ -3217,7 +3219,7 @@ englishName:"Serbian (Serbia)"},su:{nativeName:"Basa Sunda",englishName:"Sundane
|
|
|
3217
3219
|
tl:{nativeName:"Filipino",englishName:"Filipino"},"tl-PH":{nativeName:"Filipino",englishName:"Filipino"},tlh:{nativeName:"tlhIngan-Hol",englishName:"Klingon"},tr:{nativeName:"T\u00fcrk\u00e7e",englishName:"Turkish"},"tr-TR":{nativeName:"T\u00fcrk\u00e7e",englishName:"Turkish"},"tt-RU":{nativeName:"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",englishName:"Tatar"},uk:{nativeName:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",englishName:"Ukrainian"},"uk-UA":{nativeName:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",
|
|
3218
3220
|
englishName:"Ukrainian"},ur:{nativeName:"\u0627\u0631\u062f\u0648",englishName:"Urdu"},"ur-PK":{nativeName:"\u0627\u0631\u062f\u0648",englishName:"Urdu"},uz:{nativeName:"O'zbek",englishName:"Uzbek"},"uz-UZ":{nativeName:"O'zbek",englishName:"Uzbek"},vi:{nativeName:"Ti\u1ebfng Vi\u1ec7t",englishName:"Vietnamese"},"vi-VN":{nativeName:"Ti\u1ebfng Vi\u1ec7t",englishName:"Vietnamese"},"xh-ZA":{nativeName:"isiXhosa",englishName:"Xhosa"},yi:{nativeName:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9",englishName:"Yiddish"},
|
|
3219
3221
|
"yi-DE":{nativeName:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",englishName:"Yiddish (German)"},zh:{nativeName:"\u4e2d\u6587",englishName:"Chinese"},"zh-HANS":{nativeName:"\u4e2d\u6587\u7b80\u4f53",englishName:"Chinese Simplified"},"zh-HANT":{nativeName:"\u4e2d\u6587\u7e41\u9ad4",englishName:"Chinese Traditional"},"zh-CN":{nativeName:"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09",englishName:"Chinese Simplified (China)"},"zh-HK":{nativeName:"\u4e2d\u6587\uff08\u9999\u6e2f\uff09",englishName:"Chinese Traditional (Hong Kong)"},
|
|
3220
|
-
"zh-SG":{nativeName:"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09",englishName:"Chinese Simplified (Singapore)"},"zh-TW":{nativeName:"\u4e2d\u6587\uff08\u53f0\u7063\uff09",englishName:"Chinese Traditional (Taiwan)"},"zu-ZA":{nativeName:"isiZulu",englishName:"Zulu"}}},$jscomp$iter$
|
|
3222
|
+
"zh-SG":{nativeName:"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09",englishName:"Chinese Simplified (Singapore)"},"zh-TW":{nativeName:"\u4e2d\u6587\uff08\u53f0\u7063\uff09",englishName:"Chinese Traditional (Taiwan)"},"zu-ZA":{nativeName:"isiZulu",englishName:"Zulu"}}},$jscomp$iter$597=$jscomp.makeIterator(Object.keys(mozilla.LanguageMapping)),$jscomp$key$2089745539$0$key$jscomp$164=$jscomp$iter$597.next();!$jscomp$key$2089745539$0$key$jscomp$164.done;$jscomp$key$2089745539$0$key$jscomp$164=$jscomp$iter$597.next()){var key$jscomp$164=
|
|
3221
3223
|
$jscomp$key$2089745539$0$key$jscomp$164.value;mozilla.LanguageMapping[key$jscomp$164.toLowerCase()]=mozilla.LanguageMapping[key$jscomp$164]};shaka.ui.Element=function(a,b){var c=this;this.parent=a;this.controls=b;this.eventManager=new shaka.util.EventManager;this.localization=this.controls.getLocalization();this.player=this.controls.getPlayer();this.video=this.controls.getVideo();this.adManager=this.player.getAdManager();this.ad=b.getAd();this.eventManager.listen(this.adManager,shaka.ads.Utils.AD_STARTED,function(d){c.ad=d.ad});this.eventManager.listen(this.adManager,shaka.ads.Utils.AD_STOPPED,function(){c.ad=null})};
|
|
3222
3224
|
shaka.ui.Element.prototype.release=function(){this.eventManager.release();this.ad=this.adManager=this.video=this.player=this.localization=this.eventManager=this.controls=this.parent=null};goog.exportSymbol("shaka.ui.Element",shaka.ui.Element);goog.exportProperty(shaka.ui.Element.prototype,"release",shaka.ui.Element.prototype.release);shaka.ui.Enums={};
|
|
3223
3225
|
shaka.ui.Enums.MaterialDesignIcons={FULLSCREEN:"fullscreen",EXIT_FULLSCREEN:"fullscreen_exit",CLOSE:"close",CLOSED_CAPTIONS:"closed_caption",CLOSED_CAPTIONS_OFF:"closed_caption_disabled",CHECKMARK:"done",LANGUAGE:"language",PIP:"picture_in_picture_alt",EXIT_PIP:"branding_watermark",BACK:"arrow_back",RESOLUTION:"settings",MUTE:"volume_up",UNMUTE:"volume_off",CAST:"cast",EXIT_CAST:"cast_connected",OPEN_OVERFLOW:"more_vert",REWIND:"fast_rewind",FAST_FORWARD:"fast_forward",PLAY:"play_arrow",PLAYBACK_RATE:"slow_motion_video",
|
|
@@ -3411,7 +3413,7 @@ shaka.ui.Controls.prototype.onControlsKeyDown_=function(a){var b=document.active
|
|
|
3411
3413
|
b));break;case "ArrowRight":this.seekBar_&&d&&!c&&0<b&&(a.preventDefault(),this.seek_(this.seekBar_.getValue()+b));break;case "PageDown":this.seekBar_&&d&&0<b&&(a.preventDefault(),this.seek_(this.seekBar_.getValue()-e));break;case "PageUp":this.seekBar_&&d&&0<b&&(a.preventDefault(),this.seek_(this.seekBar_.getValue()+e));break;case "Home":this.seekBar_&&this.seek_(this.player_.seekRange().start);break;case "End":this.seekBar_&&this.seek_(this.player_.seekRange().end);break;case "f":this.isFullScreenSupported()&&
|
|
3412
3414
|
this.toggleFullScreen();break;case "m":this.ad_&&this.ad_.isLinear()?this.ad_.setMuted(!this.ad_.isMuted()):this.localVideo_.muted=!this.localVideo_.muted;break;case "p":this.isPiPAllowed()&&this.togglePiP();break;case " ":if(d)this.onPlayPauseClick_()}}};shaka.ui.Controls.prototype.onControlsKeyUp_=function(a){this.pressedKeys_.delete(a.key)};
|
|
3413
3415
|
shaka.ui.Controls.prototype.onBufferingStateChange_=function(){this.enabled_&&(this.ad_&&this.ad_.isClientRendering()&&this.ad_.isLinear()?shaka.ui.Utils.setDisplay(this.spinnerContainer_,!1):shaka.ui.Utils.setDisplay(this.spinnerContainer_,this.player_.isBuffering()))};shaka.ui.Controls.prototype.isOpaque=function(){return this.enabled_?null!=this.controlsContainer_.getAttribute("shown")||null!=this.controlsContainer_.getAttribute("casting"):!1};
|
|
3414
|
-
shaka.ui.Controls.prototype.seek_=function(a){goog.asserts.assert(this.seekBar_,"Caller of seek_ must check for seekBar_ first!");this.
|
|
3416
|
+
shaka.ui.Controls.prototype.seek_=function(a){goog.asserts.assert(this.seekBar_,"Caller of seek_ must check for seekBar_ first!");this.video_.currentTime=a;this.updateTimeAndSeekRange_()};
|
|
3415
3417
|
shaka.ui.Controls.prototype.updateTimeAndSeekRange_=function(){if(this.seekBar_)if(this.seekBar_.setValue(this.video_.currentTime),this.seekBar_.update(),this.seekBar_.isShowing())for(var a=$jscomp.makeIterator(this.menus_),b=a.next();!b.done;b=a.next())b.value.classList.remove("shaka-low-position");else for(a=$jscomp.makeIterator(this.menus_),b=a.next();!b.done;b=a.next())b.value.classList.add("shaka-low-position");this.dispatchEvent(new shaka.util.FakeEvent("timeandseekrangeupdated"))};
|
|
3416
3418
|
shaka.ui.Controls.prototype.onWindowKeyDown_=function(a){var b=this;this.pressedKeys_.add(a.key);var c=this.anySettingsMenusAreOpen();"Tab"==a.key&&(this.controlsContainer_.classList.add("shaka-keyboard-navigation"),this.computeOpacity(),this.eventManager_.listen(window,"mousedown",function(){return b.onMouseDown_()}));"Escape"==a.key&&this.hideSettingsMenusTimer_.tickNow();c&&this.pressedKeys_.has("Tab")&&this.keepFocusInMenu_(a)};
|
|
3417
3419
|
shaka.ui.Controls.prototype.keepFocusInMenu_=function(a){var b=this.menus_.filter(function(e){return!e.classList.contains("shaka-hidden")});if(b.length){var c=b[0];if(c.childNodes.length){for(b=c.firstElementChild;b&&b.classList.contains("shaka-hidden");)b=b.nextElementSibling;for(c=c.lastElementChild;c&&c.classList.contains("shaka-hidden");)c=c.previousElementSibling;var d=document.activeElement;this.pressedKeys_.has("Shift")?d==b&&(a.preventDefault(),c.focus()):d==c&&(a.preventDefault(),b.focus())}}};
|
|
@@ -3478,10 +3480,10 @@ goog.exportProperty(shaka.ui.Overlay.prototype,"getConfiguration",shaka.ui.Overl
|
|
|
3478
3480
|
shaka.ui.Overlay.FailReasonCode={NO_BROWSER_SUPPORT:0,PLAYER_FAILED_TO_LOAD:1};goog.exportProperty(shaka.ui.Overlay,"FailReasonCode",shaka.ui.Overlay.FailReasonCode);"complete"==document.readyState?function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(a){if(1==a.nextAddress)return a.yield(Promise.resolve(),2);shaka.ui.Overlay.scanPageForShakaElements_();a.jumpToEnd()})}():window.addEventListener("load",shaka.ui.Overlay.scanPageForShakaElements_);shaka.ui.LanguageUtils=function(){};
|
|
3479
3481
|
shaka.ui.LanguageUtils.updateTracks=function(a,b,c,d,e,f,g,h){for(var k=shaka.ui.Locales.Ids,l=a.find(function(E){return 1==E.active}),m=new Map,n=$jscomp.makeIterator(a),p=n.next();!p.done;p=n.next())p=p.value,p.audioCodec&&(m.has(p.language)||m.set(p.language,new Set),m.get(p.language).add(shaka.util.MimeUtils.getNormalizedCodec(p.audioCodec)));var q=function(E){return m.has(E)&&1<m.get(E).size};n=shaka.ui.Utils.getFirstDescendantWithClassName(b,"shaka-back-to-overflow-button");shaka.util.Dom.removeAllChildren(b);
|
|
3480
3482
|
b.appendChild(n);n=function(E){return"variant"==E.type?E.audioRoles?E.audioRoles.join(", "):void 0:E.roles.join(", ")};p=function(E,F,L,J,M){F=[E,F];h&&null!=J&&F.push(J);q(E)&&M&&F.push(M);L&&g==shaka.ui.Overlay.TrackLabelFormat.LABEL&&F.push(L);return F.join(": ")};for(var r=function(E){var F="";5<=E&&(F=" "+f.resolve(k.SURROUND));return F},t=function(E){var F="";E=E.toLowerCase();E.startsWith("mp4a")?F="AAC":"ac-3"===E?F="Dolby":"ec-3"===E?F="DD+":"opus"===E?F="Opus":"flac"===E&&(F="fLaC");return F?
|
|
3481
|
-
" "+F:F},u=new Map,v=$jscomp.makeIterator(a),w=v.next();!w.done;w=v.next())w=w.value,u.has(w.language)||u.set(w.language,new Set),u.get(w.language).add(n(w));u=new Set;l=l?p(l.language,n(l),l.label,l.channelsCount,l.audioCodec):"";a=$jscomp.makeIterator(a);w=a.next();for(v={};!w.done;v={track$jscomp$
|
|
3482
|
-
A=v.track$jscomp$
|
|
3483
|
-
(G.textContent+=t(A));h&&(G.textContent+=r(y));B?G.textContent=B:(shaka.log.alwaysWarn("Track #"+v.track$jscomp$
|
|
3484
|
-
v.track$jscomp$
|
|
3483
|
+
" "+F:F},u=new Map,v=$jscomp.makeIterator(a),w=v.next();!w.done;w=v.next())w=w.value,u.has(w.language)||u.set(w.language,new Set),u.get(w.language).add(n(w));u=new Set;l=l?p(l.language,n(l),l.label,l.channelsCount,l.audioCodec):"";a=$jscomp.makeIterator(a);w=a.next();for(v={};!w.done;v={track$jscomp$44:void 0},w=a.next()){v.track$jscomp$44=w.value;w=v.track$jscomp$44.language;var x=v.track$jscomp$44.forced,z=f.resolve(k.SUBTITLE_FORCED),B=n(v.track$jscomp$44),C=v.track$jscomp$44.label,y=v.track$jscomp$44.channelsCount,
|
|
3484
|
+
A=v.track$jscomp$44.audioCodec,D=p(w,B,C,y,A);if(!u.has(D)){u.add(D);var H=shaka.util.Dom.createButton();H.addEventListener("click",function(E){return function(){c(E.track$jscomp$44)}}(v));var G=shaka.util.Dom.createHTMLElement("span");H.appendChild(G);G.textContent=shaka.ui.LanguageUtils.getLanguageName(w,f);switch(g){case shaka.ui.Overlay.TrackLabelFormat.LANGUAGE:q(w)&&(G.textContent+=t(A));h&&(G.textContent+=r(y));x&&(G.textContent+=" ("+z+")");break;case shaka.ui.Overlay.TrackLabelFormat.ROLE:q(w)&&
|
|
3485
|
+
(G.textContent+=t(A));h&&(G.textContent+=r(y));B?G.textContent=B:(shaka.log.alwaysWarn("Track #"+v.track$jscomp$44.id+" does not have a role, but the UI is configured to only show role."),G.textContent="?");x&&(G.textContent+=" ("+z+")");break;case shaka.ui.Overlay.TrackLabelFormat.LANGUAGE_ROLE:q(w)&&(G.textContent+=t(A));h&&(G.textContent+=r(y));B&&(G.textContent+=": "+B);x&&(G.textContent+=" ("+z+")");break;case shaka.ui.Overlay.TrackLabelFormat.LABEL:C?G.textContent=C:(shaka.log.alwaysWarn("Track #"+
|
|
3486
|
+
v.track$jscomp$44.id+" does not have a label, but the UI is configured to only show labels."),G.textContent="?")}d&&D==l&&(H.appendChild(shaka.ui.Utils.checkmarkIcon()),G.classList.add("shaka-chosen-item"),H.ariaSelected="true",e.textContent=G.textContent);b.appendChild(H)}}};
|
|
3485
3487
|
shaka.ui.LanguageUtils.getLanguageName=function(a,b){if(!a&&!b)return"";switch(a){case "mul":return b.resolve(shaka.ui.Locales.Ids.MULTIPLE_LANGUAGES);case "und":return b.resolve(shaka.ui.Locales.Ids.UNDETERMINED_LANGUAGE);case "zxx":return b.resolve(shaka.ui.Locales.Ids.NOT_APPLICABLE)}var c=shaka.util.LanguageUtils.getBase(a);return a in mozilla.LanguageMapping?mozilla.LanguageMapping[a].nativeName:c in mozilla.LanguageMapping?mozilla.LanguageMapping[c].nativeName+" ("+a+")":b.resolve(shaka.ui.Locales.Ids.UNRECOGNIZED_LANGUAGE)+
|
|
3486
3488
|
" ("+a+")"};shaka.ui.SettingsMenu=function(a,b,c){shaka.ui.Element.call(this,a,b);var d=this;this.addButton_(c);this.addMenu_();this.inOverflowMenu_();this.eventManager.listen(this.button,"click",function(){d.onButtonClick_()})};$jscomp.inherits(shaka.ui.SettingsMenu,shaka.ui.Element);
|
|
3487
3489
|
shaka.ui.SettingsMenu.prototype.addButton_=function(a){this.button=shaka.util.Dom.createButton();this.button.classList.add("shaka-overflow-button");this.icon=shaka.util.Dom.createHTMLElement("i");this.icon.classList.add("material-icons-round");this.icon.textContent=a;this.button.appendChild(this.icon);a=shaka.util.Dom.createHTMLElement("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.nameSpan=shaka.util.Dom.createHTMLElement("span");a.appendChild(this.nameSpan);
|
|
@@ -3560,8 +3562,8 @@ this.eventManager.listen(this.player,"loading",function(){c.updateResolutionSele
|
|
|
3560
3562
|
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&&l.channelsCount!=d.channelsCount)return!1;var m=a.controls.getConfig().trackLabelFormat;return(m==
|
|
3561
3563
|
b.ROLE||m==b.LANGUAGE_ROLE)&&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})))).filter(shaka.util.Functional.isNotNull).length?c.filter(function(l,m){return c.findIndex(function(n){return n.height==l.height&&n.videoBandwidth==l.videoBandwidth&&n.frameRate==
|
|
3562
3564
|
l.frameRate&&n.hdr==l.hdr&&n.videoLayout==l.videoLayout})==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){return m.height==l.height||null==l.height||
|
|
3563
|
-
null==m.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=$jscomp.makeIterator(c),g=f.next(),h={};!g.done;h={track$jscomp$
|
|
3564
|
-
var k=shaka.util.Dom.createHTMLElement("span");!this.player.isAudioOnly()&&h.track$jscomp$
|
|
3565
|
+
null==m.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=$jscomp.makeIterator(c),g=f.next(),h={};!g.done;h={track$jscomp$52:void 0},g=f.next()){h.track$jscomp$52=g.value;g=shaka.util.Dom.createButton();g.classList.add("explicit-resolution");this.eventManager.listen(g,"click",function(l){return function(){return a.onTrackSelected_(l.track$jscomp$52)}}(h));
|
|
3566
|
+
var k=shaka.util.Dom.createHTMLElement("span");!this.player.isAudioOnly()&&h.track$jscomp$52.height&&h.track$jscomp$52.width?k.textContent=this.getResolutionLabel_(h.track$jscomp$52,c):k.textContent=h.track$jscomp$52.bandwidth?Math.round(h.track$jscomp$52.bandwidth/1E3)+" kbits/s":"Unknown";g.appendChild(k);e||h.track$jscomp$52!=d||(g.ariaSelected="true",g.appendChild(shaka.ui.Utils.checkmarkIcon()),k.classList.add("shaka-chosen-item"),this.currentSelection.textContent=k.textContent);this.menu.appendChild(g)}f=
|
|
3565
3567
|
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");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"),
|
|
3566
3568
|
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"));this.updateLocalizedStrings_();shaka.ui.Utils.setDisplay(this.button,1<c.length)};
|
|
3567
3569
|
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=new Set;d=$jscomp.makeIterator(b);for(var f=d.next();!f.done;f=d.next())f=f.value,f.frameRate&&e.add(Math.round(f.frameRate));1<e.size&&(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(g){return g!=a&&g.height==a.height})&&
|