shaka-player 4.12.0 → 4.12.1
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/deps.js +1 -1
- package/dist/locales.js +39 -39
- package/dist/shaka-player.compiled.d.ts +1 -1
- package/dist/shaka-player.compiled.debug.d.ts +1 -1
- package/dist/shaka-player.compiled.debug.externs.js +1 -1
- package/dist/shaka-player.compiled.debug.js +22 -21
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +1 -1
- package/dist/shaka-player.compiled.js +153 -152
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +1 -1
- package/dist/shaka-player.ui.debug.d.ts +1 -1
- package/dist/shaka-player.ui.debug.externs.js +1 -1
- package/dist/shaka-player.ui.debug.js +27 -26
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +1 -1
- package/dist/shaka-player.ui.js +280 -279
- package/dist/shaka-player.ui.map +3 -3
- package/lib/ads/interstitial_ad_manager.js +4 -3
- package/lib/dash/dash_parser.js +11 -2
- package/lib/net/networking_engine.js +3 -3
- package/lib/player.js +12 -2
- package/lib/text/ui_text_displayer.js +8 -0
- package/lib/util/error.js +1 -1
- package/package.json +1 -1
- package/ui/playback_rate_selection.js +6 -2
package/dist/deps.js
CHANGED
|
@@ -156,7 +156,7 @@ goog.addDependency('../../../../lib/text/stub_text_displayer.js', ['shaka.text.S
|
|
|
156
156
|
goog.addDependency('../../../../lib/text/text_engine.js', ['shaka.text.TextEngine'], ['goog.asserts', 'shaka.Deprecate', 'shaka.media.ClosedCaptionParser', 'shaka.text.Cue', 'shaka.util.BufferUtils', 'shaka.util.IDestroyable', 'shaka.util.MimeUtils'], {'lang': 'es8'});
|
|
157
157
|
goog.addDependency('../../../../lib/text/text_utils.js', ['shaka.text.Utils'], ['shaka.log', 'shaka.text.Cue', 'shaka.text.CueRegion'], {'lang': 'es6'});
|
|
158
158
|
goog.addDependency('../../../../lib/text/ttml_text_parser.js', ['shaka.text.TtmlTextParser'], ['goog.Uri', 'goog.asserts', 'shaka.log', 'shaka.text.Cue', 'shaka.text.CueRegion', 'shaka.text.TextEngine', 'shaka.util.ArrayUtils', 'shaka.util.Error', 'shaka.util.StringUtils', 'shaka.util.TXml'], {'lang': 'es6'});
|
|
159
|
-
goog.addDependency('../../../../lib/text/ui_text_displayer.js', ['shaka.text.UITextDisplayer'], ['goog.asserts', 'shaka.Deprecate', 'shaka.text.Cue', 'shaka.text.CueRegion', 'shaka.text.Utils', 'shaka.util.Dom', 'shaka.util.EventManager', 'shaka.util.Timer'], {'lang': 'es6'});
|
|
159
|
+
goog.addDependency('../../../../lib/text/ui_text_displayer.js', ['shaka.text.UITextDisplayer'], ['goog.asserts', 'shaka.Deprecate', 'shaka.log', 'shaka.text.Cue', 'shaka.text.CueRegion', 'shaka.text.Utils', 'shaka.util.Dom', 'shaka.util.EventManager', 'shaka.util.Timer'], {'lang': 'es6'});
|
|
160
160
|
goog.addDependency('../../../../lib/text/vtt_text_parser.js', ['shaka.text.VttTextParser'], ['goog.asserts', 'shaka.log', 'shaka.media.ManifestParser', 'shaka.text.Cue', 'shaka.text.CueRegion', 'shaka.text.TextEngine', 'shaka.util.Error', 'shaka.util.StringUtils', 'shaka.util.TextParser'], {'lang': 'es6'});
|
|
161
161
|
goog.addDependency('../../../../lib/text/web_vtt_generator.js', ['shaka.text.WebVttGenerator'], ['shaka.text.Cue', 'shaka.text.Utils'], {'lang': 'es6'});
|
|
162
162
|
goog.addDependency('../../../../lib/transmuxer/aac_transmuxer.js', ['shaka.transmuxer.AacTransmuxer'], ['shaka.media.Capabilities', 'shaka.transmuxer.ADTS', 'shaka.transmuxer.TransmuxerEngine', 'shaka.util.BufferUtils', 'shaka.util.Error', 'shaka.util.Id3Utils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Mp4Generator', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es6'});
|
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
|
-
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
917
|
-
CHAPTERS: 'CHAPTERS',
|
|
918
|
-
PAUSE: 'PAUSE',
|
|
919
|
-
UNMUTE: 'UNMUTE',
|
|
920
|
-
FULL_SCREEN: 'FULL_SCREEN',
|
|
921
|
-
MUTE: 'MUTE',
|
|
922
|
-
SEEK: 'SEEK',
|
|
923
|
-
FAST_FORWARD: 'FAST_FORWARD',
|
|
924
|
-
STATISTICS: 'STATISTICS',
|
|
925
|
-
AD_DURATION: 'AD_DURATION',
|
|
926
|
-
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
927
|
-
AD_STATISTICS: 'AD_STATISTICS',
|
|
928
|
-
SKIP_AD: 'SKIP_AD',
|
|
929
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
930
|
-
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
931
|
-
BACK: 'BACK',
|
|
932
|
-
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
933
|
-
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
934
|
-
PLAY: 'PLAY',
|
|
935
|
-
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
936
|
-
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
915
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
937
916
|
RECENTER_VR: 'RECENTER_VR',
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
941
|
-
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
942
|
-
SURROUND: 'SURROUND',
|
|
917
|
+
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
918
|
+
AD_DURATION: 'AD_DURATION',
|
|
943
919
|
AIRPLAY: 'AIRPLAY',
|
|
944
|
-
|
|
945
|
-
|
|
920
|
+
PAUSE: 'PAUSE',
|
|
921
|
+
AD_TIME: 'AD_TIME',
|
|
946
922
|
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
923
|
+
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
947
924
|
REPLAY: 'REPLAY',
|
|
948
|
-
RESOLUTION: 'RESOLUTION',
|
|
949
|
-
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
950
925
|
CAPTIONS: 'CAPTIONS',
|
|
951
|
-
|
|
926
|
+
PLAY: 'PLAY',
|
|
927
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
928
|
+
BACK: 'BACK',
|
|
929
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
930
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
931
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
932
|
+
AD_STATISTICS: 'AD_STATISTICS',
|
|
933
|
+
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
934
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
935
|
+
CAST: 'CAST',
|
|
936
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
952
937
|
LIVE: 'LIVE',
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
938
|
+
LANGUAGE: 'LANGUAGE',
|
|
939
|
+
RESOLUTION: 'RESOLUTION',
|
|
940
|
+
FAST_FORWARD: 'FAST_FORWARD',
|
|
957
941
|
OFF: 'OFF',
|
|
942
|
+
SURROUND: 'SURROUND',
|
|
943
|
+
UNMUTE: 'UNMUTE',
|
|
944
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
945
|
+
SKIP_AD: 'SKIP_AD',
|
|
946
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
947
|
+
STATISTICS: 'STATISTICS',
|
|
948
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
949
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
950
|
+
MUTE: 'MUTE',
|
|
951
|
+
ON: 'ON',
|
|
952
|
+
CHAPTERS: 'CHAPTERS',
|
|
953
|
+
VOLUME: 'VOLUME',
|
|
958
954
|
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
955
|
+
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
956
|
+
LOOP: 'LOOP',
|
|
957
|
+
SEEK: 'SEEK',
|
|
958
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
959
|
+
QUALITY: 'QUALITY',
|
|
960
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
961
|
+
REWIND: 'REWIND',
|
|
962
962
|
};
|
|
@@ -3416,7 +3416,7 @@ declare namespace shaka.util.Error {
|
|
|
3416
3416
|
UNEXPECTED_TEST_REQUEST = 1009.0 ,
|
|
3417
3417
|
UNSUPPORTED_EXTERNAL_THUMBNAILS_URI = 2017.0 ,
|
|
3418
3418
|
UNSUPPORTED_SCHEME = 1000.0 ,
|
|
3419
|
-
VAST_INVALID_XML =
|
|
3419
|
+
VAST_INVALID_XML = 10007.0 ,
|
|
3420
3420
|
VIDEO_ERROR = 3016.0 ,
|
|
3421
3421
|
WEBM_CUES_ELEMENT_MISSING = 3007.0 ,
|
|
3422
3422
|
WEBM_CUE_TIME_ELEMENT_MISSING = 3013.0 ,
|
|
@@ -3416,7 +3416,7 @@ declare namespace shaka.util.Error {
|
|
|
3416
3416
|
UNEXPECTED_TEST_REQUEST = 1009.0 ,
|
|
3417
3417
|
UNSUPPORTED_EXTERNAL_THUMBNAILS_URI = 2017.0 ,
|
|
3418
3418
|
UNSUPPORTED_SCHEME = 1000.0 ,
|
|
3419
|
-
VAST_INVALID_XML =
|
|
3419
|
+
VAST_INVALID_XML = 10007.0 ,
|
|
3420
3420
|
VIDEO_ERROR = 3016.0 ,
|
|
3421
3421
|
WEBM_CUES_ELEMENT_MISSING = 3007.0 ,
|
|
3422
3422
|
WEBM_CUE_TIME_ELEMENT_MISSING = 3013.0 ,
|
|
@@ -515,7 +515,7 @@ shaka.util.Error.Code = {
|
|
|
515
515
|
'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004,
|
|
516
516
|
'MT_AD_MANAGER_NOT_INITIALIZED': 10005,
|
|
517
517
|
'INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED': 10006,
|
|
518
|
-
'VAST_INVALID_XML':
|
|
518
|
+
'VAST_INVALID_XML': 10007
|
|
519
519
|
};
|
|
520
520
|
/**
|
|
521
521
|
* A timer allows a single function to be executed at a later time or at
|
|
@@ -179,7 +179,7 @@ DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPOR
|
|
|
179
179
|
AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,
|
|
180
180
|
LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,
|
|
181
181
|
ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,
|
|
182
|
-
MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:
|
|
182
|
+
MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007};goog.exportProperty(shaka.util.Error,"Code",shaka.util.Error.Code);shaka.util.Lazy=function(a){this.gen_=a;this.value_=void 0};shaka.util.Lazy.prototype.value=function(){void 0==this.value_&&(this.value_=this.gen_(),goog.asserts.assert(void 0!=this.value_,"Unable to create lazy value"));return this.value_};shaka.util.Lazy.prototype.reset=function(){this.value_=void 0};shaka.util.DrmUtils=function(){};shaka.util.DrmUtils.isBrowserSupported=function(){return!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration};shaka.util.DrmUtils.areDrmCompatible=function(a,b){return a.length&&b.length&&a!==b?0<shaka.util.DrmUtils.getCommonDrmInfos(a,b).length:!0};
|
|
183
183
|
shaka.util.DrmUtils.getCommonDrmInfos=function(a,b){if(!a.length)return b;if(!b.length)return a;var c=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.keySystem==f.keySystem){e=new Map;var g=(d.initData||[]).concat(f.initData||[]);g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next())h=h.value,e.set(h.keyId,h);e=Array.from(e.values());g=d.keyIds&&f.keyIds?new Set([].concat($jscomp.arrayFromIterable(d.keyIds),
|
|
184
184
|
$jscomp.arrayFromIterable(f.keyIds))):d.keyIds||f.keyIds;c.push({keySystem:d.keySystem,licenseServerUri:d.licenseServerUri||f.licenseServerUri,distinctiveIdentifierRequired:d.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,persistentStateRequired:d.persistentStateRequired||f.persistentStateRequired,videoRobustness:d.videoRobustness||f.videoRobustness,audioRobustness:d.audioRobustness||f.audioRobustness,serverCertificate:d.serverCertificate||f.serverCertificate,serverCertificateUri:d.serverCertificateUri||
|
|
185
185
|
f.serverCertificateUri,initData:e,keyIds:g});break}}return c};shaka.util.DrmUtils.keySystem=function(a){return a?a.keySystem:""};shaka.util.DrmUtils.isPlayReadyKeySystem=function(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1};shaka.util.DrmUtils.isFairPlayKeySystem=function(a){return a?!!a.match(/^com\.apple\.fps/):!1};shaka.util.DrmUtils.generateKeySystemCacheKey_=function(a,b,c){return a+"#"+b+"#"+c};
|
|
@@ -480,7 +480,7 @@ shaka.net.NetworkingEngine.prototype.filterRequest_=function(a,b,c){var d=shaka.
|
|
|
480
480
|
shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.REQUEST_FILTER_ERROR,h);})};shaka.net.NetworkingEngine.prototype.makeRequestWithRetry_=function(a,b,c,d){var e=new shaka.net.Backoff(b.retryParameters,!1);return this.send_(a,b,c,e,0,null,d)};
|
|
481
481
|
shaka.net.NetworkingEngine.prototype.send_=function(a,b,c,d,e,f,g){var h=this;this.forceHTTP_&&(b.uris[e]=b.uris[e].replace("https://","http://"));this.forceHTTPS_&&(b.uris[e]=b.uris[e].replace("http://","https://"));if(0<e&&this.onRetry_)this.onRetry_(a,c,b.uris[e],b.uris[e-1]);var k=new goog.Uri(b.uris[e]),l=k.getScheme(),m=!1;l||(l=shaka.net.NetworkingEngine.getLocationProtocol_(),goog.asserts.assert(":"==l[l.length-1],"location.protocol expected to end with a colon!"),l=l.slice(0,-1),k.setScheme(l),
|
|
482
482
|
b.uris[e]=k.toString());l=l.toLowerCase();var n=(l=shaka.net.NetworkingEngine.schemes_[l])?l.plugin:null;if(!n)return shaka.util.AbortableOperation.failed(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.UNSUPPORTED_SCHEME,k));var p=l.progressSupport,q=null,r=null,t=!1,u=!1,v;return shaka.util.AbortableOperation.notAbortable(d.attempt()).chain(function(){if(h.destroyed_)return shaka.util.AbortableOperation.aborted();v=Date.now();var w=
|
|
483
|
-
shaka.net.NetworkingEngine.RequestType.SEGMENT,x=0;b.requestStartTime=Date.now();var y=n(b.uris[e],b,a,function(B,A,C){q&&q.stop();r&&r.tickAfter(D/1E3);if(h.onProgressUpdated_&&a==w){x++;b.packetNumber=x;var E=h.allowSwitch_(c);h.onProgressUpdated_(B,A,E,b);m=!0;g.setBytes(C)}},function(B){
|
|
483
|
+
shaka.net.NetworkingEngine.RequestType.SEGMENT,x=0;b.requestStartTime=Date.now();var y=n(b.uris[e],b,a,function(B,A,C){q&&q.stop();r&&r.tickAfter(D/1E3);if(h.onProgressUpdated_&&a==w){x++;b.packetNumber=x;var E=h.allowSwitch_(c);h.onProgressUpdated_(B,A,E,b);m=!0;g.setBytes(C)}},function(B){u=!0;b.timeToFirstByte=Date.now()-b.requestStartTime;if(h.onHeadersReceived_)h.onHeadersReceived_(B,b,a)},{minBytesForProgressEvents:h.minBytesForProgressEvents_});if(!p)return y;var z=b.retryParameters.connectionTimeout;
|
|
484
484
|
z&&(q=new shaka.util.Timer(function(){t=!0;y.abort()}),q.tickAfter(z/1E3));var D=b.retryParameters.stallTimeout;D&&(r=new shaka.util.Timer(function(){t=!0;y.abort()}));return y}).chain(function(w){q&&q.stop();r&&r.stop();void 0==w.timeMs&&(w.timeMs=Date.now()-v);var x={response:w,gotProgress:m};if(!u&&h.onHeadersReceived_)h.onHeadersReceived_(w.headers,b,a);return x},function(w){q&&q.stop();r&&r.stop();if(h.onDownloadFailed_){var x=null,y=0;w instanceof shaka.util.Error&&(x=w,w.code==shaka.util.Error.Code.BAD_HTTP_STATUS&&
|
|
485
485
|
(y=w.data[1]));h.onDownloadFailed_(b,x,y,t)}if(h.destroyed_)return shaka.util.AbortableOperation.aborted();t&&(w=new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.TIMEOUT,b.uris[e],a));if(w instanceof shaka.util.Error){if(w.code==shaka.util.Error.Code.OPERATION_ABORTED)throw w;if(w.code==shaka.util.Error.Code.ATTEMPTS_EXHAUSTED)throw goog.asserts.assert(f,"Should have last error"),f;if(w.severity==shaka.util.Error.Severity.RECOVERABLE)return x=
|
|
486
486
|
(new Map).set("error",w),x=new shaka.util.FakeEvent("retry",x),h.dispatchEvent(x),e=(e+1)%b.uris.length,h.send_(a,b,c,d,e,w,g)}throw w;})};
|
|
@@ -1184,13 +1184,13 @@ shaka.text.SimpleTextDisplayer.removeWhere_=function(a,b){var c=a.mode,d="showin
|
|
|
1184
1184
|
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);goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"append",shaka.text.SimpleTextDisplayer.prototype.append);
|
|
1185
1185
|
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){};
|
|
1186
1186
|
goog.exportSymbol("shaka.text.StubTextDisplayer",shaka.text.StubTextDisplayer);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"setTextLanguage",shaka.text.StubTextDisplayer.prototype.setTextLanguage);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"setTextVisibility",shaka.text.StubTextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"isTextVisible",shaka.text.StubTextDisplayer.prototype.isTextVisible);
|
|
1187
|
-
goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"destroy",shaka.text.StubTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"append",shaka.text.StubTextDisplayer.prototype.append);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,c){var d=this;goog.asserts.assert(b,"videoContainer should be valid.");this.isTextVisible_=!1;this.cues_=[];this.video_=a;this.videoContainer_=b;this.aspectRatio_=null;this.textContainer_=shaka.util.Dom.createHTMLElement("div");this.textContainer_.classList.add("shaka-text-container");this.textContainer_.style.textAlign=
|
|
1188
|
-
this.textContainer_.style.justifyContent="flex-end";this.videoContainer_.appendChild(this.textContainer_);c&&c.captionsUpdatePeriod||shaka.Deprecate.deprecateFeature(5,"UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config.");a=c&&c.captionsUpdatePeriod?c.captionsUpdatePeriod:.25;this.captionsTimer_=(new shaka.util.Timer(function(){d.video_.paused||
|
|
1189
|
-
"fullscreenchange",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"seeking",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"resize",function(){var e=d.video_,f=e.videoWidth;e=e.videoHeight;d.aspectRatio_=f&&e?f/e:null});this.resizeObserver_=null;"ResizeObserver"in window&&(this.resizeObserver_=new ResizeObserver(function(){d.updateCaptions_(!0)}),
|
|
1190
|
-
shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
|
|
1187
|
+
goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"destroy",shaka.text.StubTextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"append",shaka.text.StubTextDisplayer.prototype.append);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,c){var d=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=
|
|
1188
|
+
"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_);c&&c.captionsUpdatePeriod||shaka.Deprecate.deprecateFeature(5,"UITextDisplayer w/ config","Please migrate to initializing UITextDisplayer with a config.");a=c&&c.captionsUpdatePeriod?c.captionsUpdatePeriod:.25;this.captionsTimer_=(new shaka.util.Timer(function(){d.video_.paused||
|
|
1189
|
+
d.updateCaptions_()})).tickEvery(a);this.currentCuesMap_=new Map;this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(document,"fullscreenchange",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"seeking",function(){d.updateCaptions_(!0)});this.eventManager_.listen(this.video_,"resize",function(){var e=d.video_,f=e.videoWidth;e=e.videoHeight;d.aspectRatio_=f&&e?f/e:null});this.resizeObserver_=null;"ResizeObserver"in window&&(this.resizeObserver_=new ResizeObserver(function(){d.updateCaptions_(!0)}),
|
|
1190
|
+
this.resizeObserver_.observe(this.textContainer_));this.regionElements_=new Map};shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
|
|
1191
1191
|
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_()};
|
|
1192
1192
|
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()};
|
|
1193
|
-
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};
|
|
1193
|
+
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)};
|
|
1194
1194
|
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};
|
|
1195
1195
|
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,
|
|
1196
1196
|
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."),
|
|
@@ -1462,8 +1462,8 @@ shaka.Player.prototype.setMaxHardwareResolution=function(a,b){this.maxHwRes_.wid
|
|
|
1462
1462
|
shaka.Player.prototype.getManifest=function(){shaka.log.alwaysWarn("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees. It may change at any time! Please consider filing a feature request for whatever you use getManifest() for.");return this.manifest_};shaka.Player.prototype.getManifestParserFactory=function(){return this.parserFactory_};
|
|
1463
1463
|
shaka.Player.prototype.getFetchedPlaybackInfo=function(){var a={video:null,audio:null,text:null};if(this.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE)return a;var b=shaka.util.ManifestParserUtils.ContentType,c=this.streamingEngine_.getCurrentVariant(),d=this.streamingEngine_.getCurrentTextStream(),e=this.video_.currentTime;c=$jscomp.makeIterator([c.video,c.audio,d]);for(d=c.next();!d.done;d=c.next())if((d=d.value)&&d.segmentIndex){var f=d.segmentIndex.find(e);f=d.segmentIndex.get(f);f={codecs:f.codecs||
|
|
1464
1464
|
d.codecs,mimeType:f.mimeType||d.mimeType,bandwidth:f.bandwidth||d.bandwidth};d.type==b.VIDEO?(f.width=d.width,f.height=d.height,a.video=f):d.type==b.AUDIO?a.audio=f:d.type==b.TEXT&&(a.text=f)}return a};shaka.Player.prototype.addVariantToSwitchHistory_=function(a,b){this.stats_.getSwitchHistory().updateCurrentVariant(a,b)};shaka.Player.prototype.addTextStreamToSwitchHistory_=function(a,b){this.stats_.getSwitchHistory().updateCurrentText(a,b)};
|
|
1465
|
-
shaka.Player.prototype.defaultConfig_=function(){var a=this,b=shaka.util.PlayerConfiguration.createDefault();b.streaming.failureCallback=function(c){a.defaultStreamingFailureCallback_(c)};b.textDisplayFactory=function(){
|
|
1466
|
-
return new shaka.text.StubTextDisplayer};return b};shaka.Player.prototype.setVideoContainer=function(a){this.videoContainer_=a};
|
|
1465
|
+
shaka.Player.prototype.defaultConfig_=function(){var a=this,b=shaka.util.PlayerConfiguration.createDefault();b.streaming.failureCallback=function(c){a.defaultStreamingFailureCallback_(c)};b.textDisplayFactory=function(){var c=shaka.util.Platform;if(!a.videoContainer_||c.safariVersion()&&!document.fullscreenEnabled){if(HTMLMediaElement.prototype.addTextTrack)return new shaka.text.SimpleTextDisplayer(a.video_,shaka.Player.TextTrackLabel);shaka.log.warning("Text tracks are not supported by the browser, disabling.");
|
|
1466
|
+
return new shaka.text.StubTextDisplayer}c=a.getConfiguration();return new shaka.text.UITextDisplayer(a.video_,a.videoContainer_,c.textDisplayer)};return b};shaka.Player.prototype.setVideoContainer=function(a){this.videoContainer_=a};
|
|
1467
1467
|
shaka.Player.prototype.defaultStreamingFailureCallback_=function(a){if(this.isLive()){var b=null;a.code==shaka.util.Error.Code.BAD_HTTP_STATUS||a.code==shaka.util.Error.Code.HTTP_ERROR?(b=1,this.config_.streaming.lowLatencyMode&&(b=.1)):a.code==shaka.util.Error.Code.TIMEOUT&&(b=.1);null!=b&&(a.severity=shaka.util.Error.Severity.RECOVERABLE,shaka.log.warning("Live streaming error. Retrying automatically..."),this.retryStreaming(b))}};
|
|
1468
1468
|
shaka.Player.prototype.makeTextStreamsForClosedCaptions_=function(a){for(var b=shaka.util.ManifestParserUtils.ContentType,c=shaka.util.ManifestParserUtils.TextStreamKind,d=shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE,e=shaka.util.MimeUtils.CEA708_CLOSED_CAPTION_MIMETYPE,f=new Set,g=$jscomp.makeIterator(a.textStreams),h=g.next();!h.done;h=g.next())h=h.value,h.mimeType!=d&&h.mimeType!=e||f.add(h.originalId);g=$jscomp.makeIterator(a.variants);for(h=g.next();!h.done;h=g.next())if((h=h.value.video)&&
|
|
1469
1469
|
h.closedCaptions)for(var k=$jscomp.makeIterator(h.closedCaptions.keys()),l=k.next();!l.done;l=k.next())if(l=l.value,!f.has(l)){var m=l.startsWith("CC")?d:e,n=new shaka.media.MetaSegmentIndex,p=h.closedCaptions.get(l);m={id:this.nextExternalStreamId_++,originalId:l,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:n,mimeType:m,codecs:"",kind:c.CLOSED_CAPTION,encrypted:!1,drmInfos:[],keyIds:new Set,language:p,originalLanguage:p,label:null,type:b.TEXT,primary:!1,trickModeVideo:null,
|
|
@@ -1475,9 +1475,9 @@ var c=this.config_.streaming.liveSync.targetLatencyTolerance,d=this.config_.stre
|
|
|
1475
1475
|
shaka.Player.prototype.onRateChange_=function(){var a=this.video_.playbackRate;0!=a&&(this.playRateController_&&this.playRateController_.set(a),a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.RateChange),this.dispatchEvent(a))};
|
|
1476
1476
|
shaka.Player.prototype.updateStateHistory_=function(){if(this.stats_&&this.bufferObserver_){var a=shaka.media.BufferingObserver.State,b=this.stats_.getStateHistory(),c="playing";this.bufferObserver_.getState()==a.STARVING?c="buffering":this.video_.ended?c="ended":this.video_.paused&&(c="paused");b.update(c)&&(a=shaka.util.FakeEvent.EventName.StateChanged,c=(new Map).set("newstate",c),this.dispatchEvent(shaka.Player.makeEvent_(a,c)))}};
|
|
1477
1477
|
shaka.Player.prototype.onTimeUpdate_=function(){var a=this.video_.playbackRate,b=this.isLive();if(this.config_.streaming.vodDynamicPlaybackRate&&!b){var c=this.config_.streaming.vodDynamicPlaybackRateLowBufferRate,d=this.getBufferFullness(),e=this.config_.streaming.vodDynamicPlaybackRateBufferRatio;d<=e?a!=c&&(shaka.log.debug("Buffer fullness ratio ("+d+") is less than the vodDynamicPlaybackRateBufferRatio ("+e+"). Updating playbackRate to "+c),this.trickPlay(c,!1)):1==d&&a!==this.playRateController_.getDefaultRate()&&
|
|
1478
|
-
(shaka.log.debug("Buffer is full. Cancel trick play."),this.cancelTrickPlay())}if(b&&(b=this.seekRange(),Number.isFinite(b.end)&&!(this.video_.currentTime<b.start))){c=this.config_.streaming.liveSync.targetLatencyTolerance;d=this.config_.streaming.liveSync.dynamicTargetLatency.enabled;e=this.config_.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(this.config_.streaming.liveSync&&this.config_.streaming.liveSync.enabled){var f=this.config_.streaming.liveSync.targetLatency;
|
|
1479
|
-
Math.max(0,f-c);var k=this.config_.streaming.liveSync.maxPlaybackRate;var l=this.config_.streaming.liveSync.minPlaybackRate}else this.manifest_&&this.manifest_.serviceDescription&&(f=this.manifest_.serviceDescription.targetLatency,null!=this.manifest_.serviceDescription.targetLatency?g=this.manifest_.serviceDescription.targetLatency+c:null!=this.manifest_.serviceDescription.maxLatency&&(g=this.manifest_.serviceDescription.maxLatency),null!=this.manifest_.serviceDescription.targetLatency?
|
|
1480
|
-
this.manifest_.serviceDescription.targetLatency-c):null!=this.manifest_.serviceDescription.minLatency&&(h=this.manifest_.serviceDescription.minLatency),k=this.manifest_.serviceDescription.maxPlaybackRate||this.config_.streaming.liveSync.maxPlaybackRate,l=this.manifest_.serviceDescription.minPlaybackRate||this.config_.streaming.liveSync.minPlaybackRate);this.currentTargetLatency_||"number"!==typeof f||(this.currentTargetLatency_=f);var m=this.config_.streaming.liveSync.dynamicTargetLatency.maxAttempts;
|
|
1478
|
+
(shaka.log.debug("Buffer is full. Cancel trick play."),this.cancelTrickPlay())}if(b&&(b=this.seekRange(),Number.isFinite(b.end)&&!(this.video_.currentTime<b.start||this.video_.paused))){c=this.config_.streaming.liveSync.targetLatencyTolerance;d=this.config_.streaming.liveSync.dynamicTargetLatency.enabled;e=this.config_.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(this.config_.streaming.liveSync&&this.config_.streaming.liveSync.enabled){var f=this.config_.streaming.liveSync.targetLatency;
|
|
1479
|
+
var g=f+c;var h=Math.max(0,f-c);var k=this.config_.streaming.liveSync.maxPlaybackRate;var l=this.config_.streaming.liveSync.minPlaybackRate}else this.manifest_&&this.manifest_.serviceDescription&&(f=this.manifest_.serviceDescription.targetLatency,null!=this.manifest_.serviceDescription.targetLatency?g=this.manifest_.serviceDescription.targetLatency+c:null!=this.manifest_.serviceDescription.maxLatency&&(g=this.manifest_.serviceDescription.maxLatency),null!=this.manifest_.serviceDescription.targetLatency?
|
|
1480
|
+
h=Math.max(0,this.manifest_.serviceDescription.targetLatency-c):null!=this.manifest_.serviceDescription.minLatency&&(h=this.manifest_.serviceDescription.minLatency),k=this.manifest_.serviceDescription.maxPlaybackRate||this.config_.streaming.liveSync.maxPlaybackRate,l=this.manifest_.serviceDescription.minPlaybackRate||this.config_.streaming.liveSync.minPlaybackRate);this.currentTargetLatency_||"number"!==typeof f||(this.currentTargetLatency_=f);var m=this.config_.streaming.liveSync.dynamicTargetLatency.maxAttempts;
|
|
1481
1481
|
d&&this.targetLatencyReached_&&null!==this.currentTargetLatency_&&"number"===typeof f&&this.rebufferingCount_<m&&Date.now()-this.targetLatencyReached_>1E3*e&&(e=this.config_.streaming.liveSync.dynamicTargetLatency.minLatency,this.currentTargetLatency_=Math.max(this.currentTargetLatency_-(f-e)/2,e+c),this.targetLatencyReached_=Date.now());d&&null!==this.currentTargetLatency_&&(g=this.currentTargetLatency_+c,h=this.currentTargetLatency_-c);f=b.end-this.video_.currentTime;c=0;this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&
|
|
1482
1482
|
(d=this.video_.buffered,0<d.length&&(c=d.end(d.length-1),c=Math.max(k,c-b.end)));b=this.config_.streaming.liveSync.panicMode;d=1E3*this.config_.streaming.liveSync.panicThreshold;e=Date.now()-this.bufferObserver_.getLastRebufferTime();b&&!l&&(l=this.config_.streaming.liveSync.minPlaybackRate);b&&l&&e<=d?a!=l&&(shaka.log.debug("Time since last rebuffer ("+e+"s) is less than the live sync panicThreshold ("+d+"s). Updating playbackRate to "+l),this.trickPlay(l,!1)):g&&k&&f-c>g?(a!=k&&(shaka.log.debug("Latency ("+
|
|
1483
1483
|
f+"s) is greater than live sync maxLatency ("+g+"s). Updating playbackRate to "+k),this.trickPlay(k,!1)),this.targetLatencyReached_=null):h&&l&&f-c<h?(a!=l&&(shaka.log.debug("Latency ("+f+"s) is smaller than live sync minLatency ("+h+"s). Updating playbackRate to "+l),this.trickPlay(l,!1)),this.targetLatencyReached_=null):a!==this.playRateController_.getDefaultRate()&&(this.cancelTrickPlay(),this.targetLatencyReached_=Date.now())}};
|
|
@@ -1539,7 +1539,7 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
|
|
|
1539
1539
|
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);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);
|
|
1540
1540
|
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);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);
|
|
1541
1541
|
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);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);
|
|
1542
|
-
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.
|
|
1542
|
+
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.1-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1543
1543
|
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_++};
|
|
1544
1544
|
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};
|
|
1545
1545
|
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_};
|
|
@@ -1615,22 +1615,22 @@ shaka.ads.InterstitialAdManager.prototype.determineIfUsingBaseVideo_=function(){
|
|
|
1615
1615
|
this.video_=this.adVideo_))}};shaka.ads.InterstitialAdManager.prototype.stop=function(){this.adEventManager_&&this.adEventManager_.removeAll();this.interstitialIds_.clear();this.interstitials_.clear();this.player_.destroyAllPreloads();this.preloadManagerInterstitials_.clear();this.player_.detach();this.playingAd_=!1;this.lastPlayedAd_=this.lastTime_=null};
|
|
1616
1616
|
shaka.ads.InterstitialAdManager.prototype.release=function(){this.stop();this.eventManager_&&this.eventManager_.release();this.adEventManager_&&this.adEventManager_.release();this.adContainer_&&shaka.util.Dom.removeAllChildren(this.adContainer_);this.timeUpdateTimer_&&(this.timeUpdateTimer_.stop(),this.timeUpdateTimer_=null);this.pollTimer_&&(this.pollTimer_.stop(),this.pollTimer_=null);this.player_.destroy()};
|
|
1617
1617
|
shaka.ads.InterstitialAdManager.prototype.addMetadata=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return b.updatePlayerConfig_(),d.yield(b.getInterstitialsInfo_(a),2);c=d.yieldResult;c.length?b.addInterstitials(c):shaka.log.alwaysWarn("Unsupported HLS interstitial",a);d.jumpToEnd()})};
|
|
1618
|
-
shaka.ads.InterstitialAdManager.prototype.addRegion=function(a){for(var b,c,d=$jscomp.makeIterator(a.eventNode.children),e=d.next();!e.done;e=d.next()){var f=e.value;if("AlternativeMPD"==f.tagName&&(e=f.attributes.uri,f=f.attributes.mode,e)){b=e;c=f;break}}b?(d="replace"==c,c="insert"==c,d||c?this.addInterstitials([{id:null,startTime:a.startTime,endTime:
|
|
1618
|
+
shaka.ads.InterstitialAdManager.prototype.addRegion=function(a){for(var b,c,d=$jscomp.makeIterator(a.eventNode.children),e=d.next();!e.done;e=d.next()){var f=e.value;if("AlternativeMPD"==f.tagName&&(e=f.attributes.uri,f=f.attributes.mode,e)){b=e;c=f;break}}b?(d="replace"==c,c="insert"==c,d||c?this.addInterstitials([{id:null,startTime:a.startTime,endTime:a.endTime,uri:b,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:c?0:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:d&&
|
|
1619
1619
|
!c}]):shaka.log.warning("Unsupported MPD alternate",a)):shaka.log.alwaysWarn("Unsupported MPD alternate",a)};
|
|
1620
1620
|
shaka.ads.InterstitialAdManager.prototype.addAdUrlInterstitial=function(a){var b=this,c,d,e,f,g,h,k,l,m,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){switch(p.nextAddress){case 1:return c=shaka.net.NetworkingEngine,d={type:c.AdvancedRequestType.INTERSTITIAL_AD_URL},p.yield(b.makeAdRequest_(a,d),2);case 2:e=p.yieldResult;f=shaka.util.TXml.parseXml(e,"VAST,vmap:VMAP");if(!f)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.ADS,shaka.util.Error.Code.VAST_INVALID_XML);
|
|
1621
1621
|
g=[];if("VAST"==f.tagName){g=shaka.ads.Utils.parseVastToInterstitials(f,b.lastTime_);p.jumpTo(3);break}if("vmap:VMAP"!=f.tagName){p.jumpTo(3);break}h=$jscomp.makeIterator(shaka.ads.Utils.parseVMAP(f));k=h.next();case 5:if(k.done){p.jumpTo(3);break}l=k.value;return p.yield(b.makeAdRequest_(l.uri,d),8);case 8:m=p.yieldResult;n=shaka.util.TXml.parseXml(m,"VAST");if(!n)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.ADS,shaka.util.Error.Code.VAST_INVALID_XML);g.push.apply(g,
|
|
1622
1622
|
$jscomp.arrayFromIterable(shaka.ads.Utils.parseVastToInterstitials(n,l.time)));k=h.next();p.jumpTo(5);break;case 3:b.addInterstitials(g),p.jumpToEnd()}})};
|
|
1623
1623
|
shaka.ads.InterstitialAdManager.prototype.addInterstitials=function(a){var b=!1;a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=c.id||JSON.stringify(c);if(!this.interstitialIds_.has(d)){b=!0;this.interstitialIds_.add(d);this.interstitials_.add(c);d=!1;if(c.pre&&null==this.lastTime_)d=!0;else if(0==c.startTime&&!c.canJump)d=!0;else if(null!=this.lastTime_){var e=c.startTime-this.lastTime_;0<e&&10>=e&&(d=!0)}d&&(this.preloadManagerInterstitials_.has(c)||this.preloadManagerInterstitials_.set(c,
|
|
1624
1624
|
this.player_.preload(c.uri)))}}b&&this.cuepointsChanged_()};shaka.ads.InterstitialAdManager.prototype.createMediaElement_=function(){var a=document.createElement(this.baseVideo_.tagName);a.autoplay=!0;a.style.position="absolute";a.style.top="0";a.style.left="0";a.style.width="100%";a.style.height="100%";a.style.backgroundColor="rgb(0, 0, 0)";a.setAttribute("playsinline","");return a};
|
|
1625
|
-
shaka.ads.InterstitialAdManager.prototype.getCurrentInterstitial_=function(a,b,c){var d=0,e=null;if(this.interstitials_.size&&null!=this.lastTime_){var f=this.baseVideo_.ended,g=Array.from(this.interstitials_).sort(function(m,n){return n.startTime-m.startTime});g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=!1;if(a)k=h.pre;else if(f)k=h.post;else if(!h.pre&&!h.post){var l=this.lastTime_-Math.round(1E3*h.startTime)/1E3;0<l&&(1>=l||!h.canJump)&&(k=
|
|
1625
|
+
shaka.ads.InterstitialAdManager.prototype.getCurrentInterstitial_=function(a,b,c){var d=0,e=null;if(this.interstitials_.size&&null!=this.lastTime_){var f=this.baseVideo_.ended,g=Array.from(this.interstitials_).sort(function(m,n){return n.startTime-m.startTime});g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next()){h=h.value;var k=!1;if(a)k=h.pre;else if(f)k=h.post;else if(!h.pre&&!h.post){var l=this.lastTime_-Math.round(1E3*h.startTime)/1E3;0<l&&(1>=l||!h.canJump)&&(k=c&&!c.pre&&!c.post&&
|
|
1626
1626
|
c.startTime>=h.startTime?!1:!0)}if(k){if(d==b){e=h;break}d++}}}return e};
|
|
1627
1627
|
shaka.ads.InterstitialAdManager.prototype.setupAd_=function(a,b,c,d,e){e=void 0===e?0:e;var f=this,g,h,k,l,m,n,p,q,r,t,u,v,w,x,y,z,D;return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){switch(B.nextAddress){case 1:f.determineIfUsingBaseVideo_();goog.asserts.assert(f.video_,"Must have video");f.lastPlayedAd_=a;shaka.log.info("Starting interstitial",a.startTime,"at",f.lastTime_);g=Date.now();!f.video_.parentElement&&f.adContainer_&&f.adContainer_.appendChild(f.video_);1==c&&1==b&&(b=Array.from(f.interstitials_).filter(function(A){return a.pre?
|
|
1628
1628
|
A.pre==a.pre:a.post?A.post==a.post:.001>Math.abs(A.startTime-a.startTime)}).length);if(a.once||a.pre)e++,f.interstitials_.delete(a),f.cuepointsChanged_();f.playingAd_=!0;if(!f.usingBaseVideo_||1!=c){B.jumpTo(2);break}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_PAUSE_REQUESTED,(new Map).set("saveLivePosition",!0)));h=new shaka.util.PublicPromise;k=function(A){return $jscomp.asyncExecutePromiseGeneratorProgram(function(C){if(1==C.nextAddress)return"detach"!=A.state?C.jumpTo(0):shaka.util.Platform.isSmartTV()?
|
|
1629
1629
|
C.yield(new Promise(function(E){return(new shaka.util.Timer(E)).tickAfter(.1)}),3):C.jumpTo(3);h.resolve();f.adEventManager_.unlisten(f.basePlayer_,"onstatechange",k);C.jumpToEnd()})};f.adEventManager_.listen(f.basePlayer_,"onstatechange",k);return B.yield(h,2);case 2:f.usingBaseVideo_||(f.baseVideo_.pause(),null!=a.resumeOffset&&0!=a.resumeOffset&&(f.baseVideo_.currentTime+=a.resumeOffset));l=!1;m=null;n=function(){if(!f.usingBaseVideo_&&null==a.resumeOffset)if(a.timelineRange&&a.endTime&&Infinity!=
|
|
1630
1630
|
a.endTime)f.baseVideo_.currentTime!=a.endTime&&(f.baseVideo_.currentTime=a.endTime);else{var A=Date.now();f.baseVideo_.currentTime+=(A-d)/1E3;d=A}};p=function(){var A,C;return $jscomp.asyncExecutePromiseGeneratorProgram(function(E){if(1==E.nextAddress)return n(),m&&m.stop(),goog.asserts.assert("number"==typeof e,"Should be an number!"),(A=f.getCurrentInterstitial_(a.pre,c-e))?(f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED)),f.adEventManager_.removeAll(),f.setupAd_(A,b,++c,d,e),E.jumpTo(0)):
|
|
1631
|
-
f.usingBaseVideo_?E.yield(f.player_.detach(),4):E.yield(f.player_.unload(),4);f.usingBaseVideo_&&(C=a.resumeOffset,null==C&&(C=a.timelineRange&&a.endTime&&Infinity!=a.endTime?a.endTime-(f.lastTime_||0):(Date.now()-d)/1E3),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED,(new Map).set("offset",C))));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));f.adEventManager_.removeAll();f.playingAd_=!1;f.usingBaseVideo_
|
|
1632
|
-
f.determineIfUsingBaseVideo_();E.jumpToEnd()})};q=function(A){return $jscomp.asyncExecutePromiseGeneratorProgram(function(C){if(l)return C.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_ERROR,(new Map).set("originalEvent",A)));return C.yield(p(),0)})};r=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){if(1==A.nextAddress){if(l)return A.return();l=!0;return A.yield(p(),2)}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_COMPLETE));
|
|
1633
|
-
t=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){if(l)return A.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIPPED));return A.yield(p(),0)})};u=new shaka.ads.InterstitialAd(f.video_,a.isSkippable,a.skipOffset,a.skipFor,t,b,c,!f.usingBaseVideo_);f.usingBaseVideo_||(u.setMuted(f.baseVideo_.muted),u.setVolume(f.baseVideo_.volume));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STARTED,(new Map).set("ad",u)));if(v=u.canSkipNow())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));
|
|
1631
|
+
f.usingBaseVideo_?E.yield(f.player_.detach(),4):E.yield(f.player_.unload(),4);f.usingBaseVideo_&&(C=a.resumeOffset,null==C&&(C=a.timelineRange&&a.endTime&&Infinity!=a.endTime?a.endTime-(f.lastTime_||0):(Date.now()-d)/1E3),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED,(new Map).set("offset",C))));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));f.adEventManager_.removeAll();f.playingAd_=!1;f.usingBaseVideo_?f.cuepointsChanged_():(n(),f.baseVideo_.ended||
|
|
1632
|
+
f.baseVideo_.play());f.determineIfUsingBaseVideo_();E.jumpToEnd()})};q=function(A){return $jscomp.asyncExecutePromiseGeneratorProgram(function(C){if(l)return C.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_ERROR,(new Map).set("originalEvent",A)));return C.yield(p(),0)})};r=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){if(1==A.nextAddress){if(l)return A.return();l=!0;return A.yield(p(),2)}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_COMPLETE));
|
|
1633
|
+
A.jumpToEnd()})};t=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){if(l)return A.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIPPED));return A.yield(p(),0)})};u=new shaka.ads.InterstitialAd(f.video_,a.isSkippable,a.skipOffset,a.skipFor,t,b,c,!f.usingBaseVideo_);f.usingBaseVideo_||(u.setMuted(f.baseVideo_.muted),u.setVolume(f.baseVideo_.volume));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STARTED,(new Map).set("ad",u)));if(v=u.canSkipNow())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));
|
|
1634
1634
|
w=new Set;f.adEventManager_.listenOnce(f.player_,"error",q);f.adEventManager_.listen(f.video_,"timeupdate",function(){var A=f.video_.duration;if(A){var C=u.canSkipNow();if(v!=C&&0<u.getRemainingTime()&&0<u.getDuration())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));v=C;A=100*f.video_.currentTime/A;25<=A&&!w.has("firstquartile")?(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_FIRST_QUARTILE)),w.add("firstquartile")):50<=A&&!w.has("midpoint")?(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MIDPOINT)),
|
|
1635
1635
|
w.add("midpoint")):75<=A&&!w.has("thirdquartile")&&(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_THIRD_QUARTILE)),w.add("thirdquartile"))}});f.adEventManager_.listenOnce(f.player_,"complete",r);f.adEventManager_.listen(f.video_,"play",function(){f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_RESUMED))});f.adEventManager_.listen(f.video_,"pause",function(){var A=f.player_.getConfiguration();if(f.video_.currentTime>=A.playRangeEnd)r();else f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_PAUSED))});
|
|
1636
1636
|
f.adEventManager_.listen(f.video_,"volumechange",function(){if(f.video_.muted)f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MUTED));else f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_VOLUME_CHANGED))});B.setCatchFinallyBlocks(4);f.updatePlayerConfig_();a.startTime&&a.endTime&&Infinity!=a.endTime&&a.startTime!=a.endTime&&(x=a.endTime-a.startTime,0<x&&f.player_.configure("playRangeEnd",x));a.playoutLimit&&(m=(new shaka.util.Timer(function(){u.skip()})).tickAfter(a.playoutLimit),f.player_.configure("playRangeEnd",
|
|
@@ -2163,12 +2163,12 @@ d.parseAttr(a,"publishTime",d.parseDate)||0;c.patchLocationNodes_=d.findChildren
|
|
|
2163
2163
|
c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(v),w=d.getContents(u))(x=d.parseAttr(u,"queryBeforeStart",d.parseBoolean,!1))?t=c.contentSteeringManager_.requestInfo(w):c.contentSteeringManager_.requestInfo(w);y=$jscomp.makeIterator(g.keys());for(z=y.next();!z.done;z=y.next())D=z.value,B=g.get(D),c.contentSteeringManager_.addLocation("Location",D,B)}A=d.findChildren(a,"BaseURL");C=!1;if(c.contentSteeringManager_)for(E=$jscomp.makeIterator(A),H=E.next();!H.done;H=
|
|
2164
2164
|
E.next())G=H.value,F=G.attributes.serviceLocation,I=d.getContents(G),F&&I&&(c.contentSteeringManager_.addLocation("BaseURL",F,I),C=!0);c.lastCalculatedBaseUris_=null;C&&c.contentSteeringManager_||(L=A.map(d.getContents),c.lastCalculatedBaseUris_=shaka.util.ManifestParserUtils.resolveUris(e,L));J=function(){return c.contentSteeringManager_&&C?c.contentSteeringManager_.getLocations("BaseURL"):c.lastCalculatedBaseUris_?c.lastCalculatedBaseUris_:[]};c.manifestPatchContext_.getBaseUris=J;M=0;A&&A.length&&
|
|
2165
2165
|
(M=d.parseAttr(A[0],"availabilityTimeOffset",d.parseFloat)||0);c.manifestPatchContext_.availabilityTimeOffset=M;K=c.config_.dash.ignoreMinBufferTime;O=0;K||(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));
|
|
2166
|
-
S=c.config_.dash.ignoreMaxSegmentDuration;V=null;S||(V=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;
|
|
2166
|
+
S=c.config_.dash.ignoreMaxSegmentDuration;V=null;S||(V=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,X=$jscomp.makeIterator(Object.values(c.streamMap_)),Z=X.next();!Z.done;Z=X.next())W=Z.value,W.segmentIndex&&W.segmentIndex.evict(P.getSegmentAvailabilityStart());
|
|
2167
2167
|
else Y=c.config_.defaultPresentationDelay||1.5*O,ca=null!=R?R:Y,P=new shaka.media.PresentationTimeline(Q,ca,c.config_.dash.autoCorrectDrift);P.setStatic("static"==U);(aa=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(",");ha={dynamic:"static"!=U,presentationTimeline:P,period:null,periodInfo:null,adaptationSet:null,representation:null,
|
|
2168
2168
|
bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:M,mediaPresentationDuration:null,profiles:da.split(","),roles:null,urlParams:function(){return""}};c.gapCount_=0;fa=c.parsePeriods_(ha,J,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())&&(c.playerInterface_.enableLowLatencyMode(),c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());
|
|
2169
2169
|
c.lowLatencyMode_&&P.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_);P.notifyMaxSegmentDuration(V||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&P.assertIsValid();return ba.yield(t,2);case 2:c.lowLatencyMode_&&(O=0,ja=null!=R?R:c.config_.defaultPresentationDelay,P.setDelay(ja));if(!c.manifest_)return ba.yield(c.periodCombiner_.combinePeriods(ea,ha.dynamic),6);c.manifest_.periodCount=ea.length;c.manifest_.gapCount=c.gapCount_;return ba.yield(c.postPeriodProcessing_(ea,!1),4);case 6:c.manifest_=
|
|
2170
2170
|
{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),periodCount:ea.length,gapCount:c.gapCount_,isLowLatency:c.isLowLatency_,startTime:null};if(!P.usingPresentationStartTime()){ba.jumpTo(7);
|
|
2171
|
-
break}ka=shaka.util.TXml;la=ka.findChildren(a,"UTCTiming");return ba.yield(c.parseUtcTiming_(J,la),8);case 8:ma=ba.yieldResult;if(!c.playerInterface_)return ba.return();P.setClockOffset(ma);case 7:P.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),ba.jumpToEnd()}})};
|
|
2171
|
+
break}ka=shaka.util.TXml;la=ka.findChildren(a,"UTCTiming");return ba.yield(c.parseUtcTiming_(J,la),8);case 8:ma=ba.yieldResult;if(!c.playerInterface_)return ba.return();P.setClockOffset(ma);case 7:P.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),c.cleanStreamMap_(),ba.jumpToEnd()}})};
|
|
2172
2172
|
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
2173
|
shaka.dash.DashParser.prototype.processPatchManifest_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,y,z,D,B,A,C,E,H,G,F,I;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,
|
|
2174
2174
|
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===
|
|
@@ -2192,7 +2192,8 @@ shaka.dash.DashParser.prototype.parsePeriods_=function(a,b,c,d){var e=shaka.util
|
|
|
2192
2192
|
!this.lastManifestUpdatePeriodIds_.includes(q)&&l+1!=c.length)shaka.log.debug("Skipping Period with ID "+q+" as its start time is smaller than the largest period start time that has been seen, and ID is unseen before");else{null!==p&&(null===this.largestPeriodStartTime_||p>this.largestPeriodStartTime_)&&(this.largestPeriodStartTime_=p);k=this.parsePeriod_(a,b,{start:p,duration:t,node:m,isLastPeriod:null==t||!n});h.push(k);a.period.id&&t&&(this.periodDurations_[a.period.id]=t);if(null==t){n&&shaka.log.warning("Skipping Period",
|
|
2193
2193
|
l+1,"and any subsequent Periods:","Period",l+1,"does not have a valid start time.",n);k=null;break}k=p+t}}if(d)for(a=$jscomp.makeIterator(h),b=a.next();!b.done;b=a.next())b=b.value.id,this.lastManifestUpdatePeriodIds_.includes(b)||this.lastManifestUpdatePeriodIds_.push(b);else this.lastManifestUpdatePeriodIds_=h.map(function(v){return v.id});return null!=f?(null!=k&&Math.abs(k-g-f)>shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS&&shaka.log.warning("@mediaPresentationDuration does not match the total duration ",
|
|
2194
2194
|
"of all Periods."),{periods:h,duration:f+g,durationDerivedFromPeriods:!1}):{periods:h,duration:k,durationDerivedFromPeriods:!0}};
|
|
2195
|
-
shaka.dash.DashParser.prototype.cleanStreamMap_=function(){var a=this,b=Object.keys(this.indexStreamMap_).filter(function(
|
|
2195
|
+
shaka.dash.DashParser.prototype.cleanStreamMap_=function(){var a=this,b=Object.keys(this.indexStreamMap_).filter(function(h){return!a.lastManifestUpdatePeriodIds_.includes(h)});b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=!0,e=$jscomp.makeIterator(this.indexStreamMap_[c]),f=e.next();!f.done;f=e.next()){f=f.value;var g=this.streamMap_[f];g.segmentIndex&&!g.segmentIndex.isEmpty()?d=!1:(this.periodCombiner_&&this.periodCombiner_.deleteStream(this.streamMap_[f],
|
|
2196
|
+
c),delete this.streamMap_[f])}d&&delete this.indexStreamMap_[c]}};
|
|
2196
2197
|
shaka.dash.DashParser.prototype.parsePeriod_=function(a,b,c){var d=this,e=shaka.util.Functional,f=shaka.util.TXml,g=shaka.util.ManifestParserUtils.ContentType;goog.asserts.assert(c.node,"periodInfo.node should exist");a.period=this.createFrame_(c.node,null,b);a.periodInfo=c;a.period.availabilityTimeOffset=a.availabilityTimeOffset;a.period.id||(shaka.log.info("No Period ID given for Period with start time "+c.start+", Assigning a default"),a.period.id="__shaka_period_"+c.start);var h=f.findChildren(c.node,
|
|
2197
2198
|
"EventStream");b=a.presentationTimeline.getSegmentAvailabilityStart();h=$jscomp.makeIterator(h);for(var k=h.next();!k.done;k=h.next())this.parseEventStream_(c.start,c.duration,k.value,b);b=f.findChildren(c.node,"SupplementalProperty");b=$jscomp.makeIterator(b);for(h=b.next();!h.done;h=b.next())if(h=h.value,"urn:mpeg:dash:urlparam:2014"==h.attributes.schemeIdUri&&(h=this.getURLParametersFunction_(h)))a.urlParams=h;e=f.findChildren(c.node,"AdaptationSet").map(function(m,n){return d.parseAdaptationSet_(a,
|
|
2198
2199
|
n,m)}).filter(e.isNotNull);if(a.dynamic){c=[];f=$jscomp.makeIterator(e);for(b=f.next();!b.done;b=f.next())for(b=$jscomp.makeIterator(b.value.representationIds),h=b.next();!h.done;h=b.next())c.push(h.value);f=new Set(c);if(c.length!=f.size)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);}c=e.filter(function(m){return!m.trickModeFor});e=e.filter(function(m){return m.trickModeFor});if(!this.config_.disableIFrames)for(e=
|