shaka-player 4.12.8 → 4.12.9
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 +36 -36
- package/dist/shaka-player.compiled.d.ts +7 -0
- package/dist/shaka-player.compiled.debug.d.ts +7 -0
- package/dist/shaka-player.compiled.debug.externs.js +12 -0
- package/dist/shaka-player.compiled.debug.js +46 -40
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +12 -0
- package/dist/shaka-player.compiled.js +1068 -1066
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +7 -0
- package/dist/shaka-player.ui.debug.d.ts +7 -0
- package/dist/shaka-player.ui.debug.externs.js +12 -0
- package/dist/shaka-player.ui.debug.js +50 -44
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +12 -0
- package/dist/shaka-player.ui.js +1202 -1199
- package/dist/shaka-player.ui.map +3 -3
- package/externs/shaka/player.js +2 -1
- package/externs/shaka/text.js +7 -0
- 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 +22 -1
- package/lib/text/simple_text_displayer.js +37 -10
- package/lib/text/stub_text_displayer.js +7 -0
- package/lib/text/ui_text_displayer.js +7 -0
- 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
|
-
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
916
|
-
CAPTIONS: 'CAPTIONS',
|
|
917
915
|
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
916
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
917
|
+
AD_DURATION: 'AD_DURATION',
|
|
921
918
|
LOOP: 'LOOP',
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
919
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
920
|
+
QUALITY: 'QUALITY',
|
|
925
921
|
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
922
|
+
VOLUME: 'VOLUME',
|
|
923
|
+
ON: 'ON',
|
|
924
|
+
CHAPTERS: 'CHAPTERS',
|
|
925
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
926
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
927
|
+
LANGUAGE: 'LANGUAGE',
|
|
928
|
+
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
929
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
930
|
+
RESOLUTION: 'RESOLUTION',
|
|
929
931
|
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
932
|
+
SEEK: 'SEEK',
|
|
933
|
+
REWIND: 'REWIND',
|
|
934
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
935
|
+
SURROUND: 'SURROUND',
|
|
936
|
+
RECENTER_VR: 'RECENTER_VR',
|
|
937
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
938
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
939
|
+
UNMUTE: 'UNMUTE',
|
|
940
|
+
BACK: 'BACK',
|
|
941
|
+
STATISTICS: 'STATISTICS',
|
|
930
942
|
AD_STATISTICS: 'AD_STATISTICS',
|
|
943
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
931
944
|
FAST_FORWARD: 'FAST_FORWARD',
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
945
|
+
PAUSE: 'PAUSE',
|
|
946
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
935
947
|
SKIP_AD: 'SKIP_AD',
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
948
|
+
PLAY: 'PLAY',
|
|
949
|
+
CAPTIONS: 'CAPTIONS',
|
|
950
|
+
REPLAY: 'REPLAY',
|
|
951
|
+
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
952
|
+
CAST: 'CAST',
|
|
953
|
+
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
940
954
|
LIVE: 'LIVE',
|
|
941
|
-
BACK: 'BACK',
|
|
942
955
|
OFF: 'OFF',
|
|
943
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
944
956
|
AIRPLAY: 'AIRPLAY',
|
|
945
|
-
|
|
957
|
+
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
958
|
+
AD_TIME: 'AD_TIME',
|
|
959
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
946
960
|
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
947
|
-
|
|
948
|
-
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
949
|
-
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
950
|
-
STATISTICS: 'STATISTICS',
|
|
951
|
-
VOLUME: 'VOLUME',
|
|
952
|
-
CHAPTERS: 'CHAPTERS',
|
|
953
|
-
QUALITY: 'QUALITY',
|
|
954
|
-
CAST: 'CAST',
|
|
955
|
-
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
956
|
-
FULL_SCREEN: 'FULL_SCREEN',
|
|
957
|
-
PLAY: 'PLAY',
|
|
958
|
-
SEEK: 'SEEK',
|
|
959
|
-
REPLAY: 'REPLAY',
|
|
960
|
-
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
961
|
-
RESOLUTION: 'RESOLUTION',
|
|
961
|
+
MUTE: 'MUTE',
|
|
962
962
|
};
|
|
@@ -2804,6 +2804,7 @@ declare namespace shaka.text {
|
|
|
2804
2804
|
append (cues : any ) : any ;
|
|
2805
2805
|
configure (config : any ) : any ;
|
|
2806
2806
|
destroy ( ) : any ;
|
|
2807
|
+
enableTextDisplayer ( ) : any ;
|
|
2807
2808
|
isTextVisible ( ) : any ;
|
|
2808
2809
|
remove (start : any , end : any ) : any ;
|
|
2809
2810
|
setTextLanguage (language : any ) : any ;
|
|
@@ -2848,6 +2849,7 @@ declare namespace shaka.text {
|
|
|
2848
2849
|
append (cues : any ) : any ;
|
|
2849
2850
|
configure (config : any ) : any ;
|
|
2850
2851
|
destroy ( ) : any ;
|
|
2852
|
+
enableTextDisplayer ( ) : any ;
|
|
2851
2853
|
isTextVisible ( ) : any ;
|
|
2852
2854
|
remove (start : any , end : any ) : any ;
|
|
2853
2855
|
setTextLanguage (language : any ) : any ;
|
|
@@ -2891,6 +2893,7 @@ declare namespace shaka.text {
|
|
|
2891
2893
|
append (cues : any ) : any ;
|
|
2892
2894
|
configure (config : any ) : any ;
|
|
2893
2895
|
destroy ( ) : any ;
|
|
2896
|
+
enableTextDisplayer ( ) : any ;
|
|
2894
2897
|
isTextVisible ( ) : any ;
|
|
2895
2898
|
remove (start : any , end : any ) : any ;
|
|
2896
2899
|
setTextLanguage (language : any ) : any ;
|
|
@@ -5052,6 +5055,10 @@ declare namespace shaka.extern {
|
|
|
5052
5055
|
*/
|
|
5053
5056
|
configure (config : shaka.extern.TextDisplayerConfiguration ) : any ;
|
|
5054
5057
|
destroy ( ) : Promise < any > ;
|
|
5058
|
+
/**
|
|
5059
|
+
* Enable the current text displayer.
|
|
5060
|
+
*/
|
|
5061
|
+
enableTextDisplayer ( ) : any ;
|
|
5055
5062
|
/**
|
|
5056
5063
|
* Returns true if text is currently visible.
|
|
5057
5064
|
*/
|
|
@@ -2804,6 +2804,7 @@ declare namespace shaka.text {
|
|
|
2804
2804
|
append (cues : any ) : any ;
|
|
2805
2805
|
configure (config : any ) : any ;
|
|
2806
2806
|
destroy ( ) : any ;
|
|
2807
|
+
enableTextDisplayer ( ) : any ;
|
|
2807
2808
|
isTextVisible ( ) : any ;
|
|
2808
2809
|
remove (start : any , end : any ) : any ;
|
|
2809
2810
|
setTextLanguage (language : any ) : any ;
|
|
@@ -2848,6 +2849,7 @@ declare namespace shaka.text {
|
|
|
2848
2849
|
append (cues : any ) : any ;
|
|
2849
2850
|
configure (config : any ) : any ;
|
|
2850
2851
|
destroy ( ) : any ;
|
|
2852
|
+
enableTextDisplayer ( ) : any ;
|
|
2851
2853
|
isTextVisible ( ) : any ;
|
|
2852
2854
|
remove (start : any , end : any ) : any ;
|
|
2853
2855
|
setTextLanguage (language : any ) : any ;
|
|
@@ -2891,6 +2893,7 @@ declare namespace shaka.text {
|
|
|
2891
2893
|
append (cues : any ) : any ;
|
|
2892
2894
|
configure (config : any ) : any ;
|
|
2893
2895
|
destroy ( ) : any ;
|
|
2896
|
+
enableTextDisplayer ( ) : any ;
|
|
2894
2897
|
isTextVisible ( ) : any ;
|
|
2895
2898
|
remove (start : any , end : any ) : any ;
|
|
2896
2899
|
setTextLanguage (language : any ) : any ;
|
|
@@ -5052,6 +5055,10 @@ declare namespace shaka.extern {
|
|
|
5052
5055
|
*/
|
|
5053
5056
|
configure (config : shaka.extern.TextDisplayerConfiguration ) : any ;
|
|
5054
5057
|
destroy ( ) : Promise < any > ;
|
|
5058
|
+
/**
|
|
5059
|
+
* Enable the current text displayer.
|
|
5060
|
+
*/
|
|
5061
|
+
enableTextDisplayer ( ) : any ;
|
|
5055
5062
|
/**
|
|
5056
5063
|
* Returns true if text is currently visible.
|
|
5057
5064
|
*/
|
|
@@ -3067,6 +3067,10 @@ shaka.text.SimpleTextDisplayer = class {
|
|
|
3067
3067
|
* @override
|
|
3068
3068
|
*/
|
|
3069
3069
|
setTextLanguage(language) {}
|
|
3070
|
+
/**
|
|
3071
|
+
* @override
|
|
3072
|
+
*/
|
|
3073
|
+
enableTextDisplayer() {}
|
|
3070
3074
|
};
|
|
3071
3075
|
/**
|
|
3072
3076
|
* A stub text displayer plugin that does nothing
|
|
@@ -3101,6 +3105,10 @@ shaka.text.StubTextDisplayer = class {
|
|
|
3101
3105
|
* @override
|
|
3102
3106
|
*/
|
|
3103
3107
|
setTextLanguage(language) {}
|
|
3108
|
+
/**
|
|
3109
|
+
* @override
|
|
3110
|
+
*/
|
|
3111
|
+
enableTextDisplayer() {}
|
|
3104
3112
|
};
|
|
3105
3113
|
/**
|
|
3106
3114
|
* The text displayer plugin for the Shaka Player UI. Can also be used directly
|
|
@@ -3143,6 +3151,10 @@ shaka.text.UITextDisplayer = class {
|
|
|
3143
3151
|
* @override
|
|
3144
3152
|
*/
|
|
3145
3153
|
setTextLanguage(language) {}
|
|
3154
|
+
/**
|
|
3155
|
+
* @override
|
|
3156
|
+
*/
|
|
3157
|
+
enableTextDisplayer() {}
|
|
3146
3158
|
};
|
|
3147
3159
|
/**
|
|
3148
3160
|
* @summary Manage the conversion to WebVTT.
|
|
@@ -806,10 +806,10 @@ shaka.media.MediaSourceEngine.prototype.clear=function(a){var b=this,c;return $j
|
|
|
806
806
|
null),0):d.jumpTo(0)})};shaka.media.MediaSourceEngine.prototype.resetCaptionParser=function(){this.captionParser_&&this.captionParser_.reset()};
|
|
807
807
|
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)})};
|
|
808
808
|
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_&&
|
|
809
|
-
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))
|
|
810
|
-
0)})};
|
|
811
|
-
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)},
|
|
812
|
-
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)})};
|
|
809
|
+
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)},
|
|
810
|
+
null));return m.length?p.yield(Promise.all(m),0):p.jumpTo(0)})};
|
|
811
|
+
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)},
|
|
812
|
+
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)})};
|
|
813
813
|
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)})};
|
|
814
814
|
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};
|
|
815
815
|
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)};
|
|
@@ -871,10 +871,10 @@ shaka.media.StallDetector.prototype.onStall=function(a){this.onStall_=a};shaka.m
|
|
|
871
871
|
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));
|
|
872
872
|
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};
|
|
873
873
|
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};
|
|
874
|
-
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_=
|
|
874
|
+
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_()})};
|
|
875
875
|
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_()};
|
|
876
|
-
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_};
|
|
877
|
-
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,
|
|
876
|
+
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_};
|
|
877
|
+
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,
|
|
878
878
|
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",
|
|
879
879
|
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))};
|
|
880
880
|
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_())})};
|
|
@@ -1182,23 +1182,26 @@ shaka.text.Utils.mapShakaCueToNativeCue=function(a){if(a.startTime>=a.endTime)re
|
|
|
1182
1182
|
a.textAlign&&"center"!=c.align&&(c.align="middle");a.writingMode==b.writingMode.VERTICAL_LEFT_TO_RIGHT?c.vertical="lr":a.writingMode==b.writingMode.VERTICAL_RIGHT_TO_LEFT&&(c.vertical="rl");a.lineInterpretation==b.lineInterpretation.PERCENTAGE&&(c.snapToLines=!1);null!=a.line&&(c.line=a.line);null!=a.position&&(c.position=a.position);return c};
|
|
1183
1183
|
shaka.text.Utils.mapNativeCueToShakaCue=function(a){if(Infinity===a.endTime||a.endTime<a.startTime)return null;var b=new shaka.text.Cue(a.startTime,a.endTime,a.text);b.line="number"===typeof a.line?a.line:null;a.lineAlign&&(b.lineAlign=a.lineAlign);b.lineInterpretation=a.snapToLines?shaka.text.Cue.lineInterpretation.LINE_NUMBER:shaka.text.Cue.lineInterpretation.PERCENTAGE;b.position="number"===typeof a.position?a.position:null;a.positionAlign&&(b.positionAlign=a.positionAlign);b.size=a.size;b.textAlign=
|
|
1184
1184
|
a.align;"lr"===a.vertical?b.writingMode=shaka.text.Cue.writingMode.VERTICAL_LEFT_TO_RIGHT:"rl"===a.vertical&&(b.writingMode=shaka.text.Cue.writingMode.VERTICAL_RIGHT_TO_LEFT);a.region&&(b.region.id=a.region.id,b.region.height=a.region.lines,b.region.heightUnits=shaka.text.CueRegion.units.LINES,b.region.regionAnchorX=a.region.regionAnchorX,b.region.regionAnchorY=a.region.regionAnchorY,b.region.scroll=a.region.scroll,b.region.viewportAnchorX=a.region.viewportAnchorX,b.region.viewportAnchorY=a.region.viewportAnchorY,
|
|
1185
|
-
b.region.viewportAnchorUnits=shaka.text.CueRegion.units.PERCENTAGE,b.region.width=a.region.width,b.region.widthUnits=shaka.text.CueRegion.units.PERCENTAGE);shaka.text.Cue.parseCuePayload(b);return b};shaka.text.SimpleTextDisplayer=function(a,b){this.textTrack_=null;
|
|
1185
|
+
b.region.viewportAnchorUnits=shaka.text.CueRegion.units.PERCENTAGE,b.region.width=a.region.width,b.region.widthUnits=shaka.text.CueRegion.units.PERCENTAGE);shaka.text.Cue.parseCuePayload(b);return b};shaka.text.SimpleTextDisplayer=function(a,b){this.video_=a;this.textTrackLabel_=b;this.textTrack_=null;a=$jscomp.makeIterator(Array.from(this.video_.textTracks));for(b=a.next();!b.done;b=a.next())b=b.value,"metadata"!==b.kind&&"chapters"!==b.kind&&(b.mode="disabled",b.label==this.textTrackLabel_&&(this.textTrack_=b));this.textTrack_&&(this.textTrack_.mode="hidden")};shaka.text.SimpleTextDisplayer.prototype.configure=function(a){};
|
|
1186
1186
|
shaka.text.SimpleTextDisplayer.prototype.remove=function(a,b){if(!this.textTrack_)return!1;shaka.text.SimpleTextDisplayer.removeWhere_(this.textTrack_,function(c){return c.startTime<b&&c.endTime>a});return!0};
|
|
1187
1187
|
shaka.text.SimpleTextDisplayer.prototype.append=function(a){if(this.textTrack_){var b=shaka.text.Utils.getCuesToFlatten(a),c=[];a=this.textTrack_.cues?Array.from(this.textTrack_.cues):[];b=$jscomp.makeIterator(b);for(var d=b.next(),e={};!d.done;e={inCue:void 0},d=b.next())e.inCue=d.value,!a.some(function(f){return function(g){return g.startTime==f.inCue.startTime&&g.endTime==f.inCue.endTime&&g.text==f.inCue.payload?!0:!1}}(e))&&e.inCue.payload&&(d=shaka.text.Utils.mapShakaCueToNativeCue(e.inCue))&&
|
|
1188
1188
|
c.push(d);a=c.slice().sort(function(f,g){return f.startTime!=g.startTime?f.startTime-g.startTime:f.endTime!=g.endTime?f.endTime-g.startTime:"line"in VTTCue.prototype?c.indexOf(g)-c.indexOf(f):c.indexOf(f)-c.indexOf(g)});a=$jscomp.makeIterator(a);for(b=a.next();!b.done;b=a.next())this.textTrack_.addCue(b.value)}};
|
|
1189
|
-
shaka.text.SimpleTextDisplayer.prototype.destroy=function(){this.textTrack_&&(shaka.text.SimpleTextDisplayer.removeWhere_(this.textTrack_,function(a){return!0}),this.textTrack_.mode="disabled");this.textTrack_=null;return Promise.resolve()};shaka.text.SimpleTextDisplayer.prototype.isTextVisible=function(){return this.textTrack_?"showing"==this.textTrack_.mode:!1};
|
|
1190
|
-
shaka.text.SimpleTextDisplayer.prototype.
|
|
1189
|
+
shaka.text.SimpleTextDisplayer.prototype.destroy=function(){this.textTrack_&&(shaka.text.SimpleTextDisplayer.removeWhere_(this.textTrack_,function(a){return!0}),this.textTrack_.mode="disabled");this.textTrack_=this.video_=null;return Promise.resolve()};shaka.text.SimpleTextDisplayer.prototype.isTextVisible=function(){return this.textTrack_?"showing"==this.textTrack_.mode:!1};
|
|
1190
|
+
shaka.text.SimpleTextDisplayer.prototype.setTextVisibility=function(a){a&&!this.textTrack_&&this.createTextTrack_();this.textTrack_&&(this.textTrack_.mode=a?"showing":"hidden")};shaka.text.SimpleTextDisplayer.prototype.setTextLanguage=function(a){};shaka.text.SimpleTextDisplayer.prototype.enableTextDisplayer=function(){this.createTextTrack_()};
|
|
1191
|
+
shaka.text.SimpleTextDisplayer.prototype.createTextTrack_=function(){this.video_&&!this.textTrack_&&(this.textTrack_=this.video_.addTextTrack("subtitles",this.textTrackLabel_),this.textTrack_.mode="hidden")};
|
|
1192
|
+
shaka.text.SimpleTextDisplayer.removeWhere_=function(a,b){var c=a.mode,d="showing"==c?"showing":"hidden";a.mode=d;goog.asserts.assert(a.cues,'Cues should be accessible when mode is set to "'+d+'".');d=$jscomp.makeIterator(Array.from(a.cues));for(var e=d.next();!e.done;e=d.next())(e=e.value)&&b(e)&&a.removeCue(e);a.mode=c};goog.exportSymbol("shaka.text.SimpleTextDisplayer",shaka.text.SimpleTextDisplayer);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"enableTextDisplayer",shaka.text.SimpleTextDisplayer.prototype.enableTextDisplayer);
|
|
1191
1193
|
goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"setTextLanguage",shaka.text.SimpleTextDisplayer.prototype.setTextLanguage);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"setTextVisibility",shaka.text.SimpleTextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"isTextVisible",shaka.text.SimpleTextDisplayer.prototype.isTextVisible);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"destroy",shaka.text.SimpleTextDisplayer.prototype.destroy);
|
|
1192
1194
|
goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"append",shaka.text.SimpleTextDisplayer.prototype.append);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"remove",shaka.text.SimpleTextDisplayer.prototype.remove);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"configure",shaka.text.SimpleTextDisplayer.prototype.configure);shaka.text.StubTextDisplayer=function(){};shaka.text.StubTextDisplayer.prototype.configure=function(a){};shaka.text.StubTextDisplayer.prototype.remove=function(a,b){};shaka.text.StubTextDisplayer.prototype.append=function(a){};shaka.text.StubTextDisplayer.prototype.destroy=function(){};shaka.text.StubTextDisplayer.prototype.isTextVisible=function(){return!1};shaka.text.StubTextDisplayer.prototype.setTextVisibility=function(a){};shaka.text.StubTextDisplayer.prototype.setTextLanguage=function(a){};
|
|
1193
|
-
|
|
1194
|
-
goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"
|
|
1195
|
+
shaka.text.StubTextDisplayer.prototype.enableTextDisplayer=function(){};goog.exportSymbol("shaka.text.StubTextDisplayer",shaka.text.StubTextDisplayer);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"enableTextDisplayer",shaka.text.StubTextDisplayer.prototype.enableTextDisplayer);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"setTextLanguage",shaka.text.StubTextDisplayer.prototype.setTextLanguage);
|
|
1196
|
+
goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"setTextVisibility",shaka.text.StubTextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"isTextVisible",shaka.text.StubTextDisplayer.prototype.isTextVisible);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"destroy",shaka.text.StubTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"append",shaka.text.StubTextDisplayer.prototype.append);
|
|
1197
|
+
goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"remove",shaka.text.StubTextDisplayer.prototype.remove);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"configure",shaka.text.StubTextDisplayer.prototype.configure);shaka.text.UITextDisplayer=function(a,b){var c=this;goog.asserts.assert(b,"videoContainer should be valid.");document.fullscreenEnabled||shaka.log.alwaysWarn("Using UITextDisplayer in a browser without Fullscreen API support causes subtitles to not be rendered in fullscreen");this.isTextVisible_=!1;this.cues_=[];this.video_=a;this.videoContainer_=b;this.aspectRatio_=null;this.textContainer_=shaka.util.Dom.createHTMLElement("div");this.textContainer_.classList.add("shaka-text-container");this.textContainer_.style.textAlign=
|
|
1195
1198
|
"center";this.textContainer_.style.display="flex";this.textContainer_.style.flexDirection="column";this.textContainer_.style.alignItems="center";this.textContainer_.style.justifyContent="flex-end";this.videoContainer_.appendChild(this.textContainer_);this.captionsTimer_=(new shaka.util.Timer(function(){c.video_.paused||c.updateCaptions_()})).tickEvery(.25);this.currentCuesMap_=new Map;this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(document,"fullscreenchange",function(){c.updateCaptions_(!0)});
|
|
1196
1199
|
this.eventManager_.listen(this.video_,"seeking",function(){c.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"resize",function(){var d=c.video_,e=d.videoWidth;d=d.videoHeight;c.aspectRatio_=e&&d?e/d:null});this.resizeObserver_=null;"ResizeObserver"in window&&(this.resizeObserver_=new ResizeObserver(function(){c.updateCaptions_(!0)}),this.resizeObserver_.observe(this.textContainer_));this.regionElements_=new Map};
|
|
1197
1200
|
shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
|
|
1198
1201
|
shaka.text.UITextDisplayer.prototype.append=function(a){var b=[].concat($jscomp.arrayFromIterable(this.cues_));a=$jscomp.makeIterator(shaka.text.Utils.removeDuplicates(a));for(var c=a.next(),d={};!c.done;d={cue$jscomp$22:void 0},c=a.next())d.cue$jscomp$22=c.value,b.some(function(e){return function(f){return shaka.text.Cue.equal(f,e.cue$jscomp$22)}}(d))||this.cues_.push(d.cue$jscomp$22);this.updateCaptions_()};
|
|
1199
1202
|
shaka.text.UITextDisplayer.prototype.destroy=function(){if(!this.textContainer_)return Promise.resolve();this.videoContainer_.removeChild(this.textContainer_);this.textContainer_=null;this.isTextVisible_=!1;this.cues_=[];this.captionsTimer_&&this.captionsTimer_.stop();this.currentCuesMap_.clear();this.eventManager_&&(this.eventManager_.release(),this.eventManager_=null);this.resizeObserver_&&(this.resizeObserver_.disconnect(),this.resizeObserver_=null);return Promise.resolve()};
|
|
1200
1203
|
shaka.text.UITextDisplayer.prototype.remove=function(a,b){if(!this.textContainer_)return!1;var c=this.cues_.length;this.cues_=this.cues_.filter(function(d){return d.startTime<a||d.endTime>=b});this.updateCaptions_(c>this.cues_.length);return!0};shaka.text.UITextDisplayer.prototype.isTextVisible=function(){return this.isTextVisible_};shaka.text.UITextDisplayer.prototype.setTextVisibility=function(a){this.isTextVisible_=a;this.updateCaptions_(!0)};
|
|
1201
|
-
shaka.text.UITextDisplayer.prototype.setTextLanguage=function(a){a&&"und"!=a?this.textContainer_.setAttribute("lang",a):this.textContainer_.setAttribute("lang","")};shaka.text.UITextDisplayer.prototype.isElementUnderTextContainer_=function(a){for(;null!=a;){if(a==this.textContainer_)return!0;a=a.parentElement}return!1};
|
|
1204
|
+
shaka.text.UITextDisplayer.prototype.setTextLanguage=function(a){a&&"und"!=a?this.textContainer_.setAttribute("lang",a):this.textContainer_.setAttribute("lang","")};shaka.text.UITextDisplayer.prototype.enableTextDisplayer=function(){};shaka.text.UITextDisplayer.prototype.isElementUnderTextContainer_=function(a){for(;null!=a;){if(a==this.textContainer_)return!0;a=a.parentElement}return!1};
|
|
1202
1205
|
shaka.text.UITextDisplayer.prototype.updateCuesRecursive_=function(a,b,c,d){var e=!1,f=[],g=[];a=$jscomp.makeIterator(a);for(var h=a.next();!h.done;h=a.next()){h=h.value;d.push(h);var k=this.currentCuesMap_.get(h),l=h.startTime<=c&&h.endTime>c,m=k?k.wrapper:null;k&&(f.push(k.cueElement),k.regionElement&&f.push(k.regionElement),l||(e=!0,this.currentCuesMap_.delete(h),k=null));l&&(g.push(h),k?this.isElementUnderTextContainer_(m)||(e=!0):(this.createCue_(h,d),k=this.currentCuesMap_.get(h),m=k.wrapper,
|
|
1203
1206
|
e=!0));0<h.nestedCues.length&&m&&this.updateCuesRecursive_(h.nestedCues,m,c,d);k=d.pop();goog.asserts.assert(k==h,"Parent cues should be kept in order")}if(e){c=$jscomp.makeIterator(f);for(d=c.next();!d.done;d=c.next())d=d.value,d.parentElement&&d.parentElement.removeChild(d);g.sort(function(n,p){return n.startTime!=p.startTime?n.startTime-p.startTime:n.endTime-p.endTime});g=$jscomp.makeIterator(g);for(c=g.next();!c.done;c=g.next())c=this.currentCuesMap_.get(c.value),goog.asserts.assert(c,"cueRegistry should exist."),
|
|
1204
1207
|
c.regionElement?(c.regionElement.contains(b)&&c.regionElement.removeChild(b),b.appendChild(c.regionElement),c.regionElement.appendChild(c.cueElement)):b.appendChild(c.cueElement)}};
|
|
@@ -1221,9 +1224,9 @@ this.aspectRatio_&&1>this.aspectRatio_&&(h=32),c=0>c?100+c/h*100:c/h*100),g==e.l
|
|
|
1221
1224
|
f.right=c+"%":b.lineAlign==e.lineAlign.END&&(f.left=100-c+"%"))));f.lineHeight=b.lineHeight;c=this.computeCuePositionAlignment_(b);c==e.positionAlign.LEFT?(f.cssFloat="left",null!==b.position&&(f.position="absolute",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.left=b.position+"%",f.width="auto"):f.top=b.position+"%")):c==e.positionAlign.RIGHT?(f.cssFloat="right",null!==b.position&&(f.position="absolute",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.right=100-b.position+"%",
|
|
1222
1225
|
f.width="auto"):f.bottom=b.position+"%")):null!==b.position&&50!=b.position&&(f.position="absolute",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.left=b.position+"%",f.width="auto"):f.top=b.position+"%");f.textAlign=b.textAlign;f.textDecoration=b.textDecoration.join(" ");f.writingMode=b.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==b.writingMode||(f.webkitWritingMode=b.writingMode);b.size&&(b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?f.width=b.size+
|
|
1223
1226
|
"%":f.height=b.size+"%")};shaka.text.UITextDisplayer.getLengthValueInfo_=function(a){return(a=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(a[1]),unit:a[2]}:null};shaka.text.UITextDisplayer.convertLengthValue_=function(a,b,c){var d=shaka.text.UITextDisplayer.getLengthValueInfo_(a);if(!d)return a;var e=d.value;switch(d.unit){case "%":return shaka.text.UITextDisplayer.getAbsoluteLengthInPixels_(e/100,b,c);case "c":return shaka.text.UITextDisplayer.getAbsoluteLengthInPixels_(e,b,c);default:return a}};
|
|
1224
|
-
shaka.text.UITextDisplayer.getAbsoluteLengthInPixels_=function(a,b,c){return c.clientHeight*a/b.cellResolution.rows+"px"};shaka.text.UITextDisplayer.inheritProperty_=function(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null};goog.exportSymbol("shaka.text.UITextDisplayer",shaka.text.UITextDisplayer);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"
|
|
1225
|
-
goog.exportProperty(shaka.text.UITextDisplayer.prototype,"
|
|
1226
|
-
goog.exportProperty(shaka.text.UITextDisplayer.prototype,"append",shaka.text.UITextDisplayer.prototype.append);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"configure",shaka.text.UITextDisplayer.prototype.configure);shaka.text.WebVttGenerator=function(){};
|
|
1227
|
+
shaka.text.UITextDisplayer.getAbsoluteLengthInPixels_=function(a,b,c){return c.clientHeight*a/b.cellResolution.rows+"px"};shaka.text.UITextDisplayer.inheritProperty_=function(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null};goog.exportSymbol("shaka.text.UITextDisplayer",shaka.text.UITextDisplayer);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"enableTextDisplayer",shaka.text.UITextDisplayer.prototype.enableTextDisplayer);
|
|
1228
|
+
goog.exportProperty(shaka.text.UITextDisplayer.prototype,"setTextLanguage",shaka.text.UITextDisplayer.prototype.setTextLanguage);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"setTextVisibility",shaka.text.UITextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"isTextVisible",shaka.text.UITextDisplayer.prototype.isTextVisible);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"remove",shaka.text.UITextDisplayer.prototype.remove);
|
|
1229
|
+
goog.exportProperty(shaka.text.UITextDisplayer.prototype,"destroy",shaka.text.UITextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"append",shaka.text.UITextDisplayer.prototype.append);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"configure",shaka.text.UITextDisplayer.prototype.configure);shaka.text.WebVttGenerator=function(){};
|
|
1227
1230
|
shaka.text.WebVttGenerator.convert=function(a,b){var c=function(f){for(var g=f,h=$jscomp.makeIterator(b),k=h.next();!k.done;k=h.next())k=k.value,k.end&&k.start<f&&(g+=k.end-k.start);f=Math.floor(g/3600);h=Math.floor(g/60%60);k=Math.floor(g%60);g=Math.floor(1E3*g%1E3);return(10>f?"0":"")+f+":"+(10>h?"0":"")+h+":"+(10>k?"0":"")+k+"."+(100>g?10>g?"00":"0":"")+g},d=shaka.text.Utils.getCuesToFlatten(a);a="WEBVTT\n\n";d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())e=e.value,a+=c(e.startTime)+
|
|
1228
1231
|
" --\x3e "+c(e.endTime)+function(f){var g=[],h=shaka.text.Cue;switch(f.textAlign){case h.textAlign.LEFT:g.push("align:left");break;case h.textAlign.RIGHT:g.push("align:right");break;case h.textAlign.CENTER:g.push("align:middle");break;case h.textAlign.START:g.push("align:start");break;case h.textAlign.END:g.push("align:end")}switch(f.writingMode){case h.writingMode.VERTICAL_LEFT_TO_RIGHT:g.push("vertical:lr");break;case h.writingMode.VERTICAL_RIGHT_TO_LEFT:g.push("vertical:rl")}return g.length?" "+
|
|
1229
1232
|
g.join(" "):""}(e)+"\n",a+=e.payload+"\n\n";return a};goog.exportSymbol("shaka.text.WebVttGenerator",shaka.text.WebVttGenerator);shaka.util.CmcdManager=function(a,b){this.playerInterface_=a;this.config_=b;this.sf_=void 0;this.playbackStarted_=!1;this.buffering_=!0;this.lowLatency_=this.starved_=!1};shaka.util.CmcdManager.prototype.configure=function(a){this.config_=a};shaka.util.CmcdManager.prototype.reset=function(){this.playbackStarted_=!1;this.buffering_=!0;this.lowLatency_=this.starved_=!1};
|
|
@@ -1295,12 +1298,12 @@ shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.NO_VIDEO_ELEMENT);if(!d.a
|
|
|
1295
1298
|
z.yield(d.mutex_.acquire(w),4);case 4:return z.yield(h(),5);case 5:return z.yield(x(),6);case 6:return z.yield(h(),7);case 7:e&&d.config_&&e.reconfigure(d.config_);case 2:z.enterFinallyBlock(),d.mutex_.release(),z.leaveFinallyBlock(0)}})};v.setCatchFinallyBlocks(5,6);null==b&&e&&(b=e.getStartTime());d.startTime_=b;d.fullyLoaded_=!1;d.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Loading));if(e){c=e.getMimeType();v.jumpTo(8);break}if(c){v.jumpTo(8);break}return v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){if(1==
|
|
1296
1299
|
x.nextAddress)return x.yield(d.guessMimeType_(f),2);c=x.yieldResult;x.jumpToEnd()})},"guessMimeType_"),8);case 8:l=!!e;if(e){e.setEventHandoffTarget(d);d.stats_=e.getStats();v.jumpTo(11);break}return v.yield(d.preloadInner_(f,b,c,!0),12);case 12:(e=v.yieldResult)?(e.markIsLoad(),e.setEventHandoffTarget(d),d.stats_=e.getStats(),e.start(),e.waitForFinish().catch(function(){})):d.stats_=new shaka.util.Stats;case 11:return m=!e,n=Date.now()/1E3,d.stats_=e?e.getStats():new shaka.util.Stats,d.assetUri_=
|
|
1297
1300
|
f,d.mimeType_=c||null,m?v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){goog.asserts.assert(c,"We should know the mimeType by now!");return x.yield(d.initializeSrcEqualsDrmInner_(c),0)})},"initializeSrcEqualsDrmInner_"),21):v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){if(1==x.nextAddress)return x.yield(e.waitForManifest(),2);d.parserFactory_=e.getParserFactory();d.parser_=e.receiveParser();d.manifest_=e.getManifest();x.jumpToEnd()})},
|
|
1298
|
-
"waitForFinish"),15);case 15:if(d.mediaSourceEngine_){v.jumpTo(16);break}return v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){return x.yield(d.initializeMediaSourceEngineInner_(),0)})},"initializeMediaSourceEngineInner_"),16);case 16:return
|
|
1299
|
-
d.parser_&&d.parser_.setMediaElement&&d.video_&&d.parser_.setMediaElement(d.video_);d.regionTimeline_=e.receiveRegionTimeline();d.qualityObserver_=e.getQualityObserver();if(p=e.getCurrentAdaptationSetCriteria())d.currentAdaptationSetCriteria_=p;l&&d.video_&&"AUDIO"===d.video_.nodeName&&
|
|
1300
|
-
0)})},"drmEngine_.attach"),19);case 19:return!(q=e.getAbrManagerFactory())||d.abrManagerFactory_&&d.abrManagerFactory_==q||(d.abrManager_=e.receiveAbrManager(),d.abrManagerFactory_=e.getAbrManagerFactory(),"function"!=typeof d.abrManager_.setMediaElement&&(shaka.Deprecate.deprecateFeature(5,
|
|
1301
|
-
"AbrManager w/o
|
|
1302
|
-
t,r),0)})},"loadInner_"),20);case 20:e.stopQueuingLatePhaseQueuedOperations();d.mimeType_&&shaka.util.Platform.isSafari()&&shaka.util.MimeUtils.isHlsType(d.mimeType_)&&d.mediaSourceEngine_.addSecondarySource(d.assetUri_,d.mimeType_);v.jumpTo(14);break;case 21:return v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){goog.asserts.assert(c,
|
|
1303
|
-
case 6:v.enterFinallyBlock();if(!e){v.jumpTo(23);break}return v.yield(e.destroy(),23);case 23:d.preloadNextUrl_=null;v.leaveFinallyBlock(0);break;case 5:u=v.enterCatchBlock();if(!u||u.code==shaka.util.Error.Code.LOAD_INTERRUPTED){v.jumpTo(25);break}return v.yield(d.unload(!1),25);case 25:throw u;}})};
|
|
1301
|
+
"waitForFinish"),15);case 15:if(d.mediaSourceEngine_){v.jumpTo(16);break}return v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){return x.yield(d.initializeMediaSourceEngineInner_(),0)})},"initializeMediaSourceEngineInner_"),16);case 16:return d.manifest_&&d.manifest_.textStreams.length&&(d.textDisplayer_.enableTextDisplayer?d.textDisplayer_.enableTextDisplayer():shaka.Deprecate.deprecateFeature(5,"Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!')),
|
|
1302
|
+
v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){return x.yield(e.waitForFinish(),0)})},"waitForFinish"),18);case 18:d.config_=e.getConfiguration();d.manifestFilterer_=e.getManifestFilterer();d.parser_&&d.parser_.setMediaElement&&d.video_&&d.parser_.setMediaElement(d.video_);d.regionTimeline_=e.receiveRegionTimeline();d.qualityObserver_=e.getQualityObserver();if(p=e.getCurrentAdaptationSetCriteria())d.currentAdaptationSetCriteria_=p;l&&d.video_&&"AUDIO"===d.video_.nodeName&&
|
|
1303
|
+
(d.makeManifestAudioOnly_(),d.configure("manifest.disableVideo",!0));d.drmEngine_=e.receiveDrmEngine();return v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){return x.yield(d.drmEngine_.attach(d.video_),0)})},"drmEngine_.attach"),19);case 19:return!(q=e.getAbrManagerFactory())||d.abrManagerFactory_&&d.abrManagerFactory_==q||(d.abrManager_=e.receiveAbrManager(),d.abrManagerFactory_=e.getAbrManagerFactory(),"function"!=typeof d.abrManager_.setMediaElement&&(shaka.Deprecate.deprecateFeature(5,
|
|
1304
|
+
"AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),d.abrManager_.setMediaElement=function(){}),"function"!=typeof d.abrManager_.setCmsdManager&&(shaka.Deprecate.deprecateFeature(5,"AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),d.abrManager_.setCmsdManager=function(){}),"function"!=typeof d.abrManager_.trySuggestStreams&&(shaka.Deprecate.deprecateFeature(5,"AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),
|
|
1305
|
+
d.abrManager_.trySuggestStreams=function(){})),r=e.receiveSegmentPrefetchesById(),t=e.getPrefetchedVariant(),v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){return x.yield(d.loadInner_(n,t,r),0)})},"loadInner_"),20);case 20:e.stopQueuingLatePhaseQueuedOperations();d.mimeType_&&shaka.util.Platform.isSafari()&&shaka.util.MimeUtils.isHlsType(d.mimeType_)&&d.mediaSourceEngine_.addSecondarySource(d.assetUri_,d.mimeType_);v.jumpTo(14);break;case 21:return v.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){goog.asserts.assert(c,
|
|
1306
|
+
"We should know the mimeType by now!");return x.yield(d.srcEqualsInner_(n,c),0)})},"srcEqualsInner_"),14);case 14:d.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Loaded));case 6:v.enterFinallyBlock();if(!e){v.jumpTo(23);break}return v.yield(e.destroy(),23);case 23:d.preloadNextUrl_=null;v.leaveFinallyBlock(0);break;case 5:u=v.enterCatchBlock();if(!u||u.code==shaka.util.Error.Code.LOAD_INTERRUPTED){v.jumpTo(25);break}return v.yield(d.unload(!1),25);case 25:throw u;}})};
|
|
1304
1307
|
shaka.Player.prototype.makeManifestAudioOnly_=function(){for(var a=$jscomp.makeIterator(this.manifest_.variants),b=a.next();!b.done;b=a.next())b=b.value,b.video&&(b.video.closeSegmentIndex(),b.video=null),b.bandwidth=b.audio&&b.audio.bandwidth?b.audio.bandwidth:0;this.manifest_.variants=this.manifest_.variants.filter(function(c){return c.audio})};
|
|
1305
1308
|
shaka.Player.prototype.unloadAndSavePreload=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){return 1==e.nextAddress?e.yield(c.savePreload_(),2):3!=e.nextAddress?(d=e.yieldResult,e.yield(c.unload(a,b),3)):e.return(d)})};
|
|
1306
1309
|
shaka.Player.prototype.detachAndSavePreload=function(a,b){a=void 0===a?!1:a;b=void 0===b?!1:b;var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){return 1==e.nextAddress?e.yield(c.savePreload_(b),2):3!=e.nextAddress?(d=e.yieldResult,e.yield(c.detach(a),3)):e.return(d)})};
|
|
@@ -1349,7 +1352,8 @@ v.mode});u&&(u.mode="hidden")},c.loadEventManager_.listen(d,"enterpictureinpictu
|
|
|
1349
1352
|
function(){return h()}),k=d,k.webkitSupportsFullscreen&&c.loadEventManager_.listen(k,"webkitpresentationmodechanged",function(){"inline"!=k.webkitPresentationMode?g():h()}));c.addBasicMediaListeners_(d,a);l=c.cmcdManager_.appendSrcData(c.assetUri_,b);!l.includes("#t=")&&(0<c.config_.playRangeStart||isFinite(c.config_.playRangeEnd))&&(l+="#t=",0<c.config_.playRangeStart&&(l+=c.config_.playRangeStart),isFinite(c.config_.playRangeEnd)&&(l+=","+c.config_.playRangeEnd));if(!c.mediaSourceEngine_){t.jumpTo(2);
|
|
1350
1353
|
break}return t.yield(c.mediaSourceEngine_.destroy(),3);case 3:c.mediaSourceEngine_=null;case 2:return shaka.util.Dom.removeAllChildren(d),d.src=l,(shaka.util.Platform.isTizen()||shaka.util.Platform.isWebOS())&&d.load(),"none"!=d.preload&&!d.autoplay&&shaka.util.MimeUtils.isHlsType(b)&&shaka.util.Platform.safariVersion()&&d.load(),c.loadMode_=shaka.Player.LoadMode.SRC_EQUALS,c.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Streaming)),m=new shaka.util.PublicPromise,shaka.util.MediaReadyState.waitForReadyState(d,
|
|
1351
1354
|
HTMLMediaElement.HAVE_METADATA,c.loadEventManager_,function(){c.playhead_.ready();m.resolve()}),shaka.util.MediaReadyState.waitForReadyState(d,HTMLMediaElement.HAVE_CURRENT_DATA,c.loadEventManager_,function(){var u,v,x,w,z;return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(1==B.nextAddress)return c.setupPreferredAudioOnSrc_(),u=c.getFilteredTextTracks_(),u.find(function(C){return"disabled"!=C.mode})?(0<u.length&&(c.isTextVisible_=!0,c.textDisplayer_.setTextVisibility(!0)),B.jumpTo(2)):
|
|
1352
|
-
B.yield(new Promise(function(C){c.loadEventManager_.listenOnce(d.textTracks,"change",C);(new shaka.util.Timer(C)).tickAfter(1)}),2);if(e)return B.return();v=!1;x=$jscomp.makeIterator(u);for(w=x.next();!w.done;w=x.next())z=w.value,"disabled"!==z.mode&&
|
|
1355
|
+
B.yield(new Promise(function(C){c.loadEventManager_.listenOnce(d.textTracks,"change",C);(new shaka.util.Timer(C)).tickAfter(1)}),2);if(e)return B.return();c.getFilteredTextTracks_().length&&(c.textDisplayer_.enableTextDisplayer?c.textDisplayer_.enableTextDisplayer():shaka.Deprecate.deprecateFeature(5,"Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!'));v=!1;x=$jscomp.makeIterator(u);for(w=x.next();!w.done;w=x.next())z=w.value,"disabled"!==z.mode&&
|
|
1356
|
+
(v?(z.mode="disabled",shaka.log.alwaysWarn("Found more than one enabled text track, disabling it",z)):(c.enableNativeTrack_(z),v=!0));c.setupPreferredTextOnSrc_();B.jumpToEnd()})}),d.error?m.reject(c.videoErrorToShakaError_()):"none"==d.preload&&(shaka.log.alwaysWarn('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),
|
|
1353
1357
|
m.resolve()),c.loadEventManager_.listenOnce(d,"error",function(){m.reject(c.videoErrorToShakaError_())}),t.yield(shaka.util.Functional.promiseWithTimeout(c.config_.streaming.loadTimeout,m),4);case 4:if((n=c.isLive())&&(c.config_.streaming.liveSync&&c.config_.streaming.liveSync.enabled||c.config_.streaming.liveSync.panicMode)||c.config_.streaming.vodDynamicPlaybackRate)p=function(){return c.onTimeUpdate_()},c.loadEventManager_.listen(d,"timeupdate",p);n||(q=function(){return c.onVideoProgress_()},
|
|
1354
1358
|
c.loadEventManager_.listen(d,"timeupdate",q),c.onVideoProgress_());c.adManager_&&(c.adManager_.onManifestUpdated(n),n&&(r=c.seekRange().end,c.loadEventManager_.listen(d,"progress",function(){var u=c.seekRange().end;r!=u&&(c.adManager_.onManifestUpdated(c.isLive()),r=u)})));c.fullyLoaded_=!0;t.jumpToEnd()}})};shaka.Player.prototype.setupPreferredAudioOnSrc_=function(){var a=this.config_.preferredAudioLanguage;""!=a&&this.selectAudioLanguage(a,this.config_.preferredVariantRole)};
|
|
1355
1359
|
shaka.Player.prototype.setupPreferredTextOnSrc_=function(){var a=this.config_.preferredTextLanguage;""!=a&&this.selectTextLanguage(a,this.config_.preferredTextRole,this.config_.preferForcedSubs)};
|
|
@@ -1545,7 +1549,7 @@ goog.exportProperty(shaka.Player.prototype,"getMediaElement",shaka.Player.protot
|
|
|
1545
1549
|
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);
|
|
1546
1550
|
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);
|
|
1547
1551
|
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);
|
|
1548
|
-
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.12.
|
|
1552
|
+
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.12.9-debug";
|
|
1549
1553
|
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_++};
|
|
1550
1554
|
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};
|
|
1551
1555
|
shaka.ads.ClientSideAd.prototype.isClientRendering=function(){return!0};shaka.ads.ClientSideAd.prototype.isUsingAnotherMediaElement=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_};
|
|
@@ -1915,8 +1919,8 @@ shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_DATA=2;shaka.cea.DtvccPacketBuilder.DT
|
|
|
1915
1919
|
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&
|
|
1916
1920
|
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))};
|
|
1917
1921
|
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]"))};
|
|
1918
|
-
shaka.cea.Cea708Service.prototype.handleC0_=function(a,b,c){if(!this.currentWindow_)return null;if(24==b)
|
|
1919
|
-
|
|
1922
|
+
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()&&
|
|
1923
|
+
(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};
|
|
1920
1924
|
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?
|
|
1921
1925
|
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])};
|
|
1922
1926
|
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};
|
|
@@ -2048,9 +2052,9 @@ shaka.dash.SegmentList.parseMediaSegments_=function(a){var b=[a.representation.s
|
|
|
2048
2052
|
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(){};
|
|
2049
2053
|
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);
|
|
2050
2054
|
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),
|
|
2051
|
-
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);
|
|
2052
|
-
|
|
2053
|
-
|
|
2055
|
+
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(),
|
|
2056
|
+
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,
|
|
2057
|
+
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};
|
|
2054
2058
|
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};
|
|
2055
2059
|
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,
|
|
2056
2060
|
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}};
|
|
@@ -2066,12 +2070,14 @@ K,"Generated a segment outside of the period!");var O=[],Q=b.numChunks;if(Q)for(
|
|
|
2066
2070
|
A=m.getSegmentAvailabilityEnd()<r();E=m.isLive();if(A||E){var F=Math.max(c,g+1);c=t;a.representation.availabilityTimeOffset&&(c=.1);H.updateEvery(c,function(){var G=m.getSegmentAvailabilityStart();H.evict(G);var L=$jscomp.makeIterator(y());L.next();L=L.next().value;for(var M=[];F<=L;){var K=D(F);M.push(K);F++}return G>r()&&!M.length?null:M})}return Promise.resolve(H)};
|
|
2067
2071
|
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,
|
|
2068
2072
|
"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};
|
|
2069
|
-
shaka.dash.TimelineSegmentIndex=function(a,b,c,d,e,f,g,h,k,l
|
|
2073
|
+
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);
|
|
2070
2074
|
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};
|
|
2071
2075
|
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())}};
|
|
2072
|
-
shaka.dash.TimelineSegmentIndex.prototype.appendTemplateInfo=function(a,b,c,d
|
|
2073
|
-
$jscomp.arrayFromIterable(a)));this.periodEnd_!==c&&(this.periodEnd_=c)}else this.templateInfo_=a,this.periodStart_=b,this.periodEnd_=c;
|
|
2074
|
-
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};
|
|
2076
|
+
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,
|
|
2077
|
+
$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)}};
|
|
2078
|
+
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};
|
|
2079
|
+
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_)}};
|
|
2080
|
+
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};
|
|
2075
2081
|
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};
|
|
2076
2082
|
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=
|
|
2077
2083
|
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,
|
|
@@ -2166,18 +2172,18 @@ p);return q.return(p)})};
|
|
|
2166
2172
|
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,
|
|
2167
2173
|
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,
|
|
2168
2174
|
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))})};
|
|
2169
|
-
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,E,J,H,F,G,L,M,K,I,O,Q,N,T,R,S,X,U,P,Y,V,W,ba,ca,Z,
|
|
2175
|
+
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,E,J,H,F,G,L,M,K,I,O,Q,N,T,R,S,X,U,P,Y,V,W,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,
|
|
2170
2176
|
"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=
|
|
2171
2177
|
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),
|
|
2172
2178
|
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(E=$jscomp.makeIterator(A),J=E.next();!J.done;J=
|
|
2173
2179
|
E.next())H=J.value,F=H.attributes.serviceLocation,G=d.getContents(H),F&&G&&(c.contentSteeringManager_.addLocation("BaseURL",F,G),D=!0);c.lastCalculatedBaseUris_=null;D&&c.contentSteeringManager_||(L=A.map(d.getContents),c.lastCalculatedBaseUris_=shaka.util.ManifestParserUtils.resolveUris(e,L));M=function(){return c.contentSteeringManager_&&D?c.contentSteeringManager_.getLocations("BaseURL"):c.lastCalculatedBaseUris_?c.lastCalculatedBaseUris_:[]};c.manifestPatchContext_.getBaseUris=M;K=0;A&&A.length&&
|
|
2174
2180
|
(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);Q=d.parseAttr(a,"availabilityStartTime",d.parseDate);N=d.parseAttr(a,"timeShiftBufferDepth",d.parseDuration);T=c.config_.dash.ignoreSuggestedPresentationDelay;R=null;T||(R=d.parseAttr(a,"suggestedPresentationDelay",d.parseDuration));
|
|
2175
2181
|
S=c.config_.dash.ignoreMaxSegmentDuration;X=null;S||(X=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;if(c.manifest_)for(P=c.manifest_.presentationTimeline,Y=P.getSegmentAvailabilityStart(),V=$jscomp.makeIterator(Object.values(c.streamMap_)),W=V.next();!W.done;W=V.next())ba=W.value,ba.segmentIndex&&
|
|
2176
|
-
ba.segmentIndex.evict(Y);else ca=c.config_.defaultPresentationDelay
|
|
2177
|
-
adaptationSet:null,representation:null,bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:K,mediaPresentationDuration:null,profiles:
|
|
2178
|
-
c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());c.lowLatencyMode_&&P.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_);P.notifyMaxSegmentDuration(X||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&P.assertIsValid();return aa.yield(t,2);case 2:c.lowLatencyMode_&&(O=0,
|
|
2179
|
-
return aa.yield(c.postPeriodProcessing_(
|
|
2180
|
-
isLowLatency:c.isLowLatency_,startTime:null};if(!P.usingPresentationStartTime()){aa.jumpTo(7);break}
|
|
2182
|
+
ba.segmentIndex.evict(Y);else ca=0,ca=null!=R?Math.min(R,N||Infinity):0<c.config_.defaultPresentationDelay?c.config_.defaultPresentationDelay:Math.min(1.5*O,N||Infinity),P=new shaka.media.PresentationTimeline(Q,ca,c.config_.dash.autoCorrectDrift);P.setStatic("static"==U);(Z=P.isLive())&&!isNaN(c.config_.availabilityWindowOverride)&&(N=c.config_.availabilityWindowOverride);null==N&&(N=Infinity);P.setSegmentAvailabilityDuration(N);da=a.attributes.profiles||"";c.manifestPatchContext_.profiles=da.split(",");
|
|
2183
|
+
ha={dynamic:"static"!=U,presentationTimeline:P,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||P.setDuration(ia||Infinity);c.isLowLatency_&&!c.lowLatencyMode_&&(na=c.playerInterface_.isAutoLowLatencyMode())&&
|
|
2184
|
+
(c.playerInterface_.enableLowLatencyMode(),c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());c.lowLatencyMode_&&P.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_);P.notifyMaxSegmentDuration(X||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&P.assertIsValid();return aa.yield(t,2);case 2:c.lowLatencyMode_&&(O=0,ja=null!=R?R:c.config_.defaultPresentationDelay,P.setDelay(ja));if(!c.manifest_)return aa.yield(c.periodCombiner_.combinePeriods(ea,ha.dynamic),6);c.manifest_.periodCount=
|
|
2185
|
+
ea.length;c.manifest_.gapCount=c.gapCount_;return aa.yield(c.postPeriodProcessing_(ea,!1),4);case 6:c.manifest_={presentationTimeline:P,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),nextUrl:c.parseMpdChaining_(a),
|
|
2186
|
+
periodCount:ea.length,gapCount:c.gapCount_,isLowLatency:c.isLowLatency_,startTime:null};if(!P.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();P.setClockOffset(ma);case 7:P.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),c.cleanStreamMap_(),aa.jumpToEnd()}})};
|
|
2181
2187
|
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()})};
|
|
2182
2188
|
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,E,J,H,F,G;return $jscomp.asyncExecutePromiseGeneratorProgram(function(L){if(1==L.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,
|
|
2183
2189
|
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===
|
|
@@ -2373,7 +2379,7 @@ shaka.hls.HlsParser.prototype.notifySegmentsForStreams_=function(a){var b=[];a=$
|
|
|
2373
2379
|
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==
|
|
2374
2380
|
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)};
|
|
2375
2381
|
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};
|
|
2376
|
-
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,E,J,H,F,G,L,M,K,I,O,Q,N,T,R,S,X,U,P,Y,V,W,ba,ca;return $jscomp.asyncExecutePromiseGeneratorProgram(function(Z){switch(Z.nextAddress){case 1:z=c.segments||[];B=z.every(function(
|
|
2382
|
+
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,E,J,H,F,G,L,M,K,I,O,Q,N,T,R,S,X,U,P,Y,V,W,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,
|
|
2377
2383
|
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;G=F=H=J=E=null;if(!(0<A.length&&v)){Z.jumpTo(2);break}return Z.yield(w.getBasicInfoFromSegments_(A),3);case 3:L=Z.yieldResult,g=L.type,h=L.language,m=L.channelCount,r=L.sampleRate,w.config_.disableText||(n=L.closedCaptions),
|
|
2378
2384
|
J=L.height,E=L.width,H=L.videoRange,F=L.colorGamut,G=L.frameRate,x&&(u=L.mimeType,f=L.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;Q=M.aesEncrypted;if(O&&!K.length&&!Q)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2379
2385
|
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&&(E||J||H||F)&&w.addVideoAttributes_(N,E,J,G,H,null,F);w.isLive_()&&w.determineLastTargetDuration_(c);T=A[0].startTime;R=A[A.length-1];S=R.endTime;X=new shaka.media.SegmentIndex(A);N.segmentIndex=X;P=(U=shaka.hls.Utils.getFirstTagWithName(c.tags,
|