shaka-player 4.11.20 → 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 +26 -24
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +1046 -1044
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +30 -28
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +1217 -1215
- package/dist/shaka-player.ui.map +3 -3
- package/externs/shaka/player.js +2 -1
- package/lib/cea/cea708_service.js +9 -17
- package/lib/dash/dash_parser.js +21 -11
- package/lib/dash/segment_template.js +41 -39
- package/lib/media/gap_jumping_controller.js +14 -1
- package/lib/media/media_source_engine.js +13 -9
- package/lib/player.js +1 -1
- package/package.json +1 -1
package/dist/locales.js
CHANGED
|
@@ -912,51 +912,51 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
912
912
|
* @const
|
|
913
913
|
*/
|
|
914
914
|
shaka.ui.Locales.Ids = {
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
OFF: 'OFF',
|
|
915
|
+
RECENTER_VR: 'RECENTER_VR',
|
|
916
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
917
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
918
|
+
LIVE: 'LIVE',
|
|
919
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
920
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
921
|
+
FAST_FORWARD: 'FAST_FORWARD',
|
|
922
|
+
CHAPTERS: 'CHAPTERS',
|
|
923
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
924
|
+
AD_DURATION: 'AD_DURATION',
|
|
926
925
|
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
927
926
|
CAPTIONS: 'CAPTIONS',
|
|
928
|
-
|
|
929
|
-
PLAY: 'PLAY',
|
|
927
|
+
AIRPLAY: 'AIRPLAY',
|
|
930
928
|
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
929
|
+
SURROUND: 'SURROUND',
|
|
930
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
931
|
+
SEEK: 'SEEK',
|
|
932
|
+
AD_STATISTICS: 'AD_STATISTICS',
|
|
933
|
+
PLAY: 'PLAY',
|
|
934
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
935
|
+
MUTE: 'MUTE',
|
|
936
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
937
|
+
UNMUTE: 'UNMUTE',
|
|
931
938
|
LANGUAGE: 'LANGUAGE',
|
|
932
|
-
|
|
939
|
+
LOOP: 'LOOP',
|
|
933
940
|
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
941
|
+
RESOLUTION: 'RESOLUTION',
|
|
942
|
+
BACK: 'BACK',
|
|
943
|
+
REWIND: 'REWIND',
|
|
944
|
+
ON: 'ON',
|
|
934
945
|
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
935
|
-
RECENTER_VR: 'RECENTER_VR',
|
|
936
946
|
STATISTICS: 'STATISTICS',
|
|
937
|
-
FAST_FORWARD: 'FAST_FORWARD',
|
|
938
|
-
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
939
|
-
MUTE: 'MUTE',
|
|
940
|
-
PAUSE: 'PAUSE',
|
|
941
|
-
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
942
|
-
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
943
|
-
UNMUTE: 'UNMUTE',
|
|
944
|
-
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
945
|
-
CHAPTERS: 'CHAPTERS',
|
|
946
|
-
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
947
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
948
|
-
AD_STATISTICS: 'AD_STATISTICS',
|
|
949
947
|
VOLUME: 'VOLUME',
|
|
950
|
-
|
|
948
|
+
QUALITY: 'QUALITY',
|
|
951
949
|
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
952
|
-
|
|
953
|
-
AIRPLAY: 'AIRPLAY',
|
|
954
|
-
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
955
|
-
SKIP_AD: 'SKIP_AD',
|
|
956
|
-
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
957
|
-
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
958
|
-
AD_DURATION: 'AD_DURATION',
|
|
959
|
-
LIVE: 'LIVE',
|
|
950
|
+
PAUSE: 'PAUSE',
|
|
960
951
|
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
961
|
-
|
|
952
|
+
REPLAY: 'REPLAY',
|
|
953
|
+
OFF: 'OFF',
|
|
954
|
+
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
955
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
956
|
+
SKIP_AD: 'SKIP_AD',
|
|
957
|
+
AD_TIME: 'AD_TIME',
|
|
958
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
959
|
+
CAST: 'CAST',
|
|
960
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
961
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
962
962
|
};
|
|
@@ -797,10 +797,10 @@ shaka.media.MediaSourceEngine.prototype.clear=function(a){var b=this,c;return $j
|
|
|
797
797
|
null),0):d.jumpTo(0)})};shaka.media.MediaSourceEngine.prototype.resetCaptionParser=function(){this.captionParser_&&this.captionParser_.reset()};
|
|
798
798
|
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)})};
|
|
799
799
|
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_&&
|
|
800
|
-
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))
|
|
801
|
-
0)})};
|
|
802
|
-
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)},
|
|
803
|
-
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)})};
|
|
800
|
+
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)},
|
|
801
|
+
null));return m.length?p.yield(Promise.all(m),0):p.jumpTo(0)})};
|
|
802
|
+
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)},
|
|
803
|
+
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)})};
|
|
804
804
|
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)})};
|
|
805
805
|
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};
|
|
806
806
|
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)};
|
|
@@ -864,10 +864,10 @@ shaka.media.StallDetector.prototype.onStall=function(a){this.onStall_=a};shaka.m
|
|
|
864
864
|
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));
|
|
865
865
|
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};
|
|
866
866
|
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};
|
|
867
|
-
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_=
|
|
867
|
+
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_()})};
|
|
868
868
|
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_()};
|
|
869
|
-
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_};
|
|
870
|
-
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,
|
|
869
|
+
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_};
|
|
870
|
+
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,
|
|
871
871
|
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",
|
|
872
872
|
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))};
|
|
873
873
|
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_())})};
|
|
@@ -1540,7 +1540,7 @@ goog.exportProperty(shaka.Player.prototype,"getMediaElement",shaka.Player.protot
|
|
|
1540
1540
|
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);
|
|
1541
1541
|
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);
|
|
1542
1542
|
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);
|
|
1543
|
-
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.
|
|
1543
|
+
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";
|
|
1544
1544
|
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_++};
|
|
1545
1545
|
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};
|
|
1546
1546
|
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_};
|
|
@@ -1908,8 +1908,8 @@ shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_DATA=2;shaka.cea.DtvccPacketBuilder.DT
|
|
|
1908
1908
|
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&
|
|
1909
1909
|
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))};
|
|
1910
1910
|
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]"))};
|
|
1911
|
-
shaka.cea.Cea708Service.prototype.handleC0_=function(a,b,c){if(!this.currentWindow_)return null;if(24==b)
|
|
1912
|
-
|
|
1911
|
+
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()&&
|
|
1912
|
+
(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};
|
|
1913
1913
|
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?
|
|
1914
1914
|
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])};
|
|
1915
1915
|
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};
|
|
@@ -2039,9 +2039,9 @@ shaka.dash.SegmentList.parseMediaSegments_=function(a){var b=[a.representation.s
|
|
|
2039
2039
|
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(){};
|
|
2040
2040
|
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);
|
|
2041
2041
|
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),
|
|
2042
|
-
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);
|
|
2043
|
-
|
|
2044
|
-
|
|
2042
|
+
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(),
|
|
2043
|
+
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,
|
|
2044
|
+
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};
|
|
2045
2045
|
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};
|
|
2046
2046
|
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,
|
|
2047
2047
|
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}};
|
|
@@ -2057,12 +2057,14 @@ K,"Generated a segment outside of the period!");var O=[],P=b.numChunks;if(P)for(
|
|
|
2057
2057
|
A=m.getSegmentAvailabilityEnd()<r();F=m.isLive();if(A||F){var G=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=[];G<=J;){var K=D(G);M.push(K);G++}return L>r()&&!M.length?null:M})}return Promise.resolve(E)};
|
|
2058
2058
|
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,
|
|
2059
2059
|
"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};
|
|
2060
|
-
shaka.dash.TimelineSegmentIndex=function(a,b,c,d,e,f,g,h,k,l
|
|
2060
|
+
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);
|
|
2061
2061
|
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};
|
|
2062
2062
|
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())}};
|
|
2063
|
-
shaka.dash.TimelineSegmentIndex.prototype.appendTemplateInfo=function(a,b,c,d
|
|
2064
|
-
$jscomp.arrayFromIterable(a)));this.periodEnd_!==c&&(this.periodEnd_=c)}else this.templateInfo_=a,this.periodStart_=b,this.periodEnd_=c;
|
|
2065
|
-
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};
|
|
2063
|
+
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,
|
|
2064
|
+
$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)}};
|
|
2065
|
+
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};
|
|
2066
|
+
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_)}};
|
|
2067
|
+
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};
|
|
2066
2068
|
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};
|
|
2067
2069
|
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=
|
|
2068
2070
|
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,
|
|
@@ -2157,18 +2159,18 @@ p);return q.return(p)})};
|
|
|
2157
2159
|
shaka.dash.DashParser.prototype.parseManifest_=function(a,b,c){var d=this,e,f,g,h,k,l,m,n,p,q,r;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){if(1==t.nextAddress){e=a;f=d.config_.dash.manifestPreprocessor;g=shaka.util.PlayerConfiguration.defaultManifestPreprocessor;if(f!=g){shaka.Deprecate.deprecateFeature(5,"manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");h=shaka.util.XmlUtils.parseXml(e,c);if(!h)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2158
2160
|
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_INVALID_XML,b);f(h);e=shaka.util.XmlUtils.toArrayBuffer(h)}k=shaka.util.TXml.parseXml(e,c);if(!k)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_INVALID_XML,b);l=d.config_.dash.manifestPreprocessorTXml;m=shaka.util.PlayerConfiguration.defaultManifestPreprocessorTXml;l!=m&&l(k);if("Patch"===c)return t.return(d.processPatchManifest_(k));if(n=d.config_.dash.disableXlinkProcessing)return t.return(d.processManifest_(k,
|
|
2159
2161
|
b));p=d.config_.dash.xlinkFailGracefully;q=shaka.dash.MpdUtils.processXlinks(k,d.config_.retryParameters,p,b,d.playerInterface_.networkingEngine);d.operationManager_.manage(q);return t.yield(q.promise,2)}r=t.yieldResult;return t.return(d.processManifest_(r,b))})};
|
|
2160
|
-
shaka.dash.DashParser.prototype.processManifest_=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,x,w,z,B,C,y,A,D,F,H,E,G,L,J,M,K,I,O,P,N,Q,S,T,W,U,R,X,V,Y,ba,ca,Z,
|
|
2162
|
+
shaka.dash.DashParser.prototype.processManifest_=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,x,w,z,B,C,y,A,D,F,H,E,G,L,J,M,K,I,O,P,N,Q,S,T,W,U,R,X,V,Y,ba,ca,Z,da,ha,fa,ia,ea,na,ja,ka,la,ma;return $jscomp.asyncExecutePromiseGeneratorProgram(function(aa){switch(aa.nextAddress){case 1:d=shaka.util.TXml;goog.asserts.assert(c.config_,"Must call configure() before processManifest_()!");c.contentSteeringManager_&&c.contentSteeringManager_.clearPreviousLocations();e=[b];f=[];g=new Map;h=d.findChildren(a,
|
|
2161
2163
|
"Location");k=$jscomp.makeIterator(h);for(l=k.next();!l.done;l=k.next())if(m=l.value,n=m.attributes.serviceLocation,p=d.getContents(m))q=shaka.util.ManifestParserUtils.resolveUris(e,[p])[0],n&&(c.contentSteeringManager_?c.contentSteeringManager_.addLocation("Location",n,q):g.set(n,q)),f.push(q);c.contentSteeringManager_?(r=c.contentSteeringManager_.getLocations("Location",!0),0<r.length&&(e=c.manifestUris_=r)):f.length&&(e=c.manifestUris_=f);c.manifestPatchContext_.mpdId=a.attributes.id||"";c.manifestPatchContext_.publishTime=
|
|
2162
2164
|
d.parseAttr(a,"publishTime",d.parseDate)||0;c.patchLocationNodes_=d.findChildren(a,"PatchLocation");t=Promise.resolve();if((u=d.findChild(a,"ContentSteering"))&&c.playerInterface_){v=u.attributes.defaultServiceLocation;if(c.contentSteeringManager_)c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(v);else if(c.contentSteeringManager_=new shaka.util.ContentSteeringManager(c.playerInterface_),c.contentSteeringManager_.configure(c.config_),c.contentSteeringManager_.setManifestType(shaka.media.ManifestParser.DASH),
|
|
2163
2165
|
c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(v),x=d.getContents(u))(w=d.parseAttr(u,"queryBeforeStart",d.parseBoolean,!1))?t=c.contentSteeringManager_.requestInfo(x):c.contentSteeringManager_.requestInfo(x);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(F=$jscomp.makeIterator(A),H=F.next();!H.done;H=
|
|
2164
2166
|
F.next())E=H.value,G=E.attributes.serviceLocation,L=d.getContents(E),G&&L&&(c.contentSteeringManager_.addLocation("BaseURL",G,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&&
|
|
2165
2167
|
(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));
|
|
2166
2168
|
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=
|
|
2167
|
-
Y.value,ba.segmentIndex&&ba.segmentIndex.evict(X);else ca=c.config_.defaultPresentationDelay
|
|
2168
|
-
period:null,periodInfo:null,adaptationSet:null,representation:null,bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:K,mediaPresentationDuration:null,profiles:
|
|
2169
|
-
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,
|
|
2170
|
-
return aa.yield(c.postPeriodProcessing_(
|
|
2171
|
-
isLowLatency:c.isLowLatency_,startTime:null};if(!R.usingPresentationStartTime()){aa.jumpTo(7);break}
|
|
2169
|
+
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=
|
|
2170
|
+
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_&&
|
|
2171
|
+
(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,
|
|
2172
|
+
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),
|
|
2173
|
+
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()}})};
|
|
2172
2174
|
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()})};
|
|
2173
2175
|
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,x,w,z,B,C,y,A,D,F,H,E,G,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,
|
|
2174
2176
|
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===
|
|
@@ -2362,7 +2364,7 @@ shaka.hls.HlsParser.prototype.notifySegmentsForStreams_=function(a){var b=[];a=$
|
|
|
2362
2364
|
shaka.hls.HlsParser.prototype.finalizeStreams_=function(a){if(!this.isLive_())for(var b=this.getMinDuration_(),c=$jscomp.makeIterator(a),d=c.next();!d.done;d=c.next())d.value.stream.segmentIndex.fit(0,b);this.notifySegmentsForStreams_(a.map(function(f){return f.stream}));c=Array.from(this.uriToStreamInfosMap_.values()).filter(function(f){return f.stream.segmentIndex});var e=shaka.util.ManifestParserUtils.ContentType;b=c.some(function(f){return f.stream.type==e.AUDIO});d=c.some(function(f){return f.stream.type==
|
|
2363
2365
|
e.VIDEO});c=this.isLive_()&&!this.usesProgramDateTime_;b=!this.isLive_()&&this.usesProgramDateTime_&&!(b&&d);this.config_.hls.ignoreManifestProgramDateTime||c||b?this.syncStreamsWithSequenceNumber_(a,c):(this.syncStreamsWithProgramDateTime_(a),0<this.config_.hls.ignoreManifestProgramDateTimeForTypes.length&&this.syncStreamsWithSequenceNumber_(a))};shaka.hls.HlsParser.prototype.ignoreManifestProgramDateTimeFor_=function(a){return this.config_.hls.ignoreManifestProgramDateTime?!0:this.config_.hls.ignoreManifestProgramDateTimeForTypes.includes(a)};
|
|
2364
2366
|
shaka.hls.HlsParser.prototype.hasEnoughInfoToFinalizeStreams_=function(){if(!this.manifest_)return!1;for(var a=[],b=[],c=$jscomp.makeIterator(this.manifest_.variants),d=c.next();!d.done;d=c.next())d=d.value,d.video&&a.push(d.video),d.audio&&b.push(d.audio);return 0<a.length&&!a.some(function(e){return e.segmentIndex})||0<b.length&&!b.some(function(e){return e.segmentIndex})?!1:!0};
|
|
2365
|
-
shaka.hls.HlsParser.prototype.convertParsedPlaylistIntoStreamInfo_=function(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,x){v=void 0===v?!0:v;x=void 0===x?!0:x;var w=this,z,B,C,y,A,D,F,H,E,G,L,J,M,K,I,O,P,N,Q,S,T,W,U,R,X,V,Y,ba,ca;return $jscomp.asyncExecutePromiseGeneratorProgram(function(Z){switch(Z.nextAddress){case 1:z=c.segments||[];B=z.every(function(
|
|
2367
|
+
shaka.hls.HlsParser.prototype.convertParsedPlaylistIntoStreamInfo_=function(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,x){v=void 0===v?!0:v;x=void 0===x?!0:x;var w=this,z,B,C,y,A,D,F,H,E,G,L,J,M,K,I,O,P,N,Q,S,T,W,U,R,X,V,Y,ba,ca;return $jscomp.asyncExecutePromiseGeneratorProgram(function(Z){switch(Z.nextAddress){case 1:z=c.segments||[];B=z.every(function(da){return shaka.hls.Utils.getFirstTagWithName(da.tags,"EXT-X-GAP")?!0:!1});if(!z.length||B)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2366
2368
|
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_EMPTY_MEDIA_PLAYLIST);w.determinePresentationType_(c);w.isLive_()&&w.determineLastTargetDuration_(c);C=w.isLive_()?w.mediaSequenceToStartTimeByType_.get(g):new Map;y=w.createSegments_(c,C,b,d,g);A=y.segments;D=y.bandwidth;L=G=E=H=F=null;if(!(0<A.length&&v)){Z.jumpTo(2);break}return Z.yield(w.getBasicInfoFromSegments_(A),3);case 3:J=Z.yieldResult,g=J.type,h=J.language,m=J.channelCount,r=J.sampleRate,w.config_.disableText||(n=J.closedCaptions),
|
|
2367
2369
|
H=J.height,F=J.width,E=J.videoRange,G=J.colorGamut,L=J.frameRate,x&&(u=J.mimeType,f=J.codecs);case 2:if(u){Z.jumpTo(4);break}return Z.yield(w.guessMimeType_(g,f,A),5);case 5:u=Z.yieldResult,g!=shaka.util.ManifestParserUtils.ContentType.TEXT||f||"application/mp4"!=u||!A[0]||A[0].initSegmentReference||(u="text/vtt");case 4:return Z.yield(w.parseDrmInfo_(c,u,d,b),6);case 6:M=Z.yieldResult;K=M.drmInfos;I=M.keyIds;O=M.encrypted;P=M.aesEncrypted;if(O&&!K.length&&!P)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2368
2370
|
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED);N=w.makeStreamObject_(a,f,g,h,k,l,m,n,p,q,r,t);N.encrypted=O;N.drmInfos=K;N.keyIds=I;N.mimeType=u;D&&(N.bandwidth=D);w.setFullTypeForStream_(N);g==shaka.util.ManifestParserUtils.ContentType.VIDEO&&(F||H||E||G)&&w.addVideoAttributes_(N,F,H,L,E,null,G);w.isLive_()&&w.determineLastTargetDuration_(c);Q=A[0].startTime;S=A[A.length-1];T=S.endTime;W=new shaka.media.SegmentIndex(A);N.segmentIndex=W;R=(U=shaka.hls.Utils.getFirstTagWithName(c.tags,
|