shaka-player 4.11.12 → 4.11.13
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 +37 -37
- 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 +19 -19
- package/dist/shaka-player.compiled.debug.map +2 -2
- package/dist/shaka-player.compiled.externs.js +1 -1
- package/dist/shaka-player.compiled.js +67 -66
- 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 +24 -24
- package/dist/shaka-player.ui.debug.map +2 -2
- package/dist/shaka-player.ui.externs.js +1 -1
- package/dist/shaka-player.ui.js +284 -283
- package/dist/shaka-player.ui.map +3 -3
- package/lib/ads/interstitial_ad_manager.js +4 -3
- 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
|
-
|
|
917
|
-
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
918
|
-
REPLAY: 'REPLAY',
|
|
919
|
-
AD_STATISTICS: 'AD_STATISTICS',
|
|
915
|
+
SURROUND: 'SURROUND',
|
|
916
|
+
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
920
917
|
LIVE: 'LIVE',
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
918
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
919
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
920
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
921
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
924
922
|
CAST: 'CAST',
|
|
925
|
-
|
|
926
|
-
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
927
|
-
PAUSE: 'PAUSE',
|
|
928
|
-
REWIND: 'REWIND',
|
|
929
|
-
SURROUND: 'SURROUND',
|
|
930
|
-
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
923
|
+
LANGUAGE: 'LANGUAGE',
|
|
931
924
|
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
932
|
-
|
|
925
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
933
926
|
AIRPLAY: 'AIRPLAY',
|
|
934
|
-
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
935
|
-
LOOP: 'LOOP',
|
|
936
|
-
CAPTIONS: 'CAPTIONS',
|
|
937
|
-
PLAY: 'PLAY',
|
|
938
927
|
FAST_FORWARD: 'FAST_FORWARD',
|
|
939
|
-
ON: 'ON',
|
|
940
|
-
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
941
|
-
BACK: 'BACK',
|
|
942
|
-
FULL_SCREEN: 'FULL_SCREEN',
|
|
943
|
-
SKIP_AD: 'SKIP_AD',
|
|
944
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
945
|
-
VOLUME: 'VOLUME',
|
|
946
928
|
AD_DURATION: 'AD_DURATION',
|
|
947
|
-
|
|
948
|
-
|
|
929
|
+
LOOP: 'LOOP',
|
|
930
|
+
OFF: 'OFF',
|
|
931
|
+
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
932
|
+
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
933
|
+
RESOLUTION: 'RESOLUTION',
|
|
934
|
+
RECENTER_VR: 'RECENTER_VR',
|
|
935
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
936
|
+
AD_TIME: 'AD_TIME',
|
|
937
|
+
BACK: 'BACK',
|
|
938
|
+
CHAPTERS: 'CHAPTERS',
|
|
939
|
+
AD_STATISTICS: 'AD_STATISTICS',
|
|
940
|
+
REWIND: 'REWIND',
|
|
949
941
|
SEEK: 'SEEK',
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
MUTE: 'MUTE',
|
|
953
|
-
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
942
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
943
|
+
CAPTIONS: 'CAPTIONS',
|
|
954
944
|
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
945
|
+
PAUSE: 'PAUSE',
|
|
946
|
+
MUTE: 'MUTE',
|
|
947
|
+
STATISTICS: 'STATISTICS',
|
|
948
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
949
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
950
|
+
ON: 'ON',
|
|
951
|
+
UNMUTE: 'UNMUTE',
|
|
952
|
+
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
953
|
+
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
955
954
|
QUALITY: 'QUALITY',
|
|
956
|
-
|
|
955
|
+
VOLUME: 'VOLUME',
|
|
956
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
957
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
958
|
+
REPLAY: 'REPLAY',
|
|
959
|
+
PLAY: 'PLAY',
|
|
957
960
|
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
958
|
-
|
|
959
|
-
UNMUTE: 'UNMUTE',
|
|
960
|
-
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
961
|
-
OFF: 'OFF',
|
|
961
|
+
SKIP_AD: 'SKIP_AD',
|
|
962
962
|
};
|
|
@@ -3406,7 +3406,7 @@ declare namespace shaka.util.Error {
|
|
|
3406
3406
|
UNEXPECTED_TEST_REQUEST = 1009.0 ,
|
|
3407
3407
|
UNSUPPORTED_EXTERNAL_THUMBNAILS_URI = 2017.0 ,
|
|
3408
3408
|
UNSUPPORTED_SCHEME = 1000.0 ,
|
|
3409
|
-
VAST_INVALID_XML =
|
|
3409
|
+
VAST_INVALID_XML = 10007.0 ,
|
|
3410
3410
|
VIDEO_ERROR = 3016.0 ,
|
|
3411
3411
|
WEBM_CUES_ELEMENT_MISSING = 3007.0 ,
|
|
3412
3412
|
WEBM_CUE_TIME_ELEMENT_MISSING = 3013.0 ,
|
|
@@ -3406,7 +3406,7 @@ declare namespace shaka.util.Error {
|
|
|
3406
3406
|
UNEXPECTED_TEST_REQUEST = 1009.0 ,
|
|
3407
3407
|
UNSUPPORTED_EXTERNAL_THUMBNAILS_URI = 2017.0 ,
|
|
3408
3408
|
UNSUPPORTED_SCHEME = 1000.0 ,
|
|
3409
|
-
VAST_INVALID_XML =
|
|
3409
|
+
VAST_INVALID_XML = 10007.0 ,
|
|
3410
3410
|
VIDEO_ERROR = 3016.0 ,
|
|
3411
3411
|
WEBM_CUES_ELEMENT_MISSING = 3007.0 ,
|
|
3412
3412
|
WEBM_CUE_TIME_ELEMENT_MISSING = 3013.0 ,
|
|
@@ -514,7 +514,7 @@ shaka.util.Error.Code = {
|
|
|
514
514
|
'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004,
|
|
515
515
|
'MT_AD_MANAGER_NOT_INITIALIZED': 10005,
|
|
516
516
|
'INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED': 10006,
|
|
517
|
-
'VAST_INVALID_XML':
|
|
517
|
+
'VAST_INVALID_XML': 10007
|
|
518
518
|
};
|
|
519
519
|
/**
|
|
520
520
|
* 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,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,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,
|
|
180
180
|
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,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,
|
|
181
181
|
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,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,
|
|
182
|
-
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
|
+
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};
|
|
@@ -481,7 +481,7 @@ shaka.net.NetworkingEngine.prototype.filterRequest_=function(a,b,c){var d=shaka.
|
|
|
481
481
|
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)};
|
|
482
482
|
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),
|
|
483
483
|
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=
|
|
484
|
-
shaka.net.NetworkingEngine.RequestType.SEGMENT,y=0;b.requestStartTime=Date.now();var x=n(b.uris[e],b,a,function(A,B,D){q&&q.stop();r&&r.tickAfter(C/1E3);if(h.onProgressUpdated_&&a==w){y++;b.packetNumber=y;var F=h.allowSwitch_(c);h.onProgressUpdated_(A,B,F,b);m=!0;g.setBytes(D)}},function(A){
|
|
484
|
+
shaka.net.NetworkingEngine.RequestType.SEGMENT,y=0;b.requestStartTime=Date.now();var x=n(b.uris[e],b,a,function(A,B,D){q&&q.stop();r&&r.tickAfter(C/1E3);if(h.onProgressUpdated_&&a==w){y++;b.packetNumber=y;var F=h.allowSwitch_(c);h.onProgressUpdated_(A,B,F,b);m=!0;g.setBytes(D)}},function(A){u=!0;b.timeToFirstByte=Date.now()-b.requestStartTime;if(h.onHeadersReceived_)h.onHeadersReceived_(A,b,a)},{minBytesForProgressEvents:h.minBytesForProgressEvents_});if(!p)return x;var z=b.retryParameters.connectionTimeout;
|
|
485
485
|
z&&(q=new shaka.util.Timer(function(){t=!0;x.abort()}),q.tickAfter(z/1E3));var C=b.retryParameters.stallTimeout;C&&(r=new shaka.util.Timer(function(){t=!0;x.abort()}));return x}).chain(function(w){q&&q.stop();r&&r.stop();void 0==w.timeMs&&(w.timeMs=Date.now()-v);var y={response:w,gotProgress:m};if(!u&&h.onHeadersReceived_)h.onHeadersReceived_(w.headers,b,a);return y},function(w){q&&q.stop();r&&r.stop();if(h.onDownloadFailed_){var y=null,x=0;w instanceof shaka.util.Error&&(y=w,w.code==shaka.util.Error.Code.BAD_HTTP_STATUS&&
|
|
486
486
|
(x=w.data[1]));h.onDownloadFailed_(b,y,x,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 y=
|
|
487
487
|
(new Map).set("error",w),y=new shaka.util.FakeEvent("retry",y),h.dispatchEvent(y),e=(e+1)%b.uris.length,h.send_(a,b,c,d,e,w,g)}throw w;})};
|
|
@@ -1179,13 +1179,13 @@ goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"isTextVisible",sha
|
|
|
1179
1179
|
goog.exportProperty(shaka.text.SimpleTextDisplayer.prototype,"configure",shaka.text.SimpleTextDisplayer.prototype.configure);shaka.text.StubTextDisplayer=function(){};shaka.text.StubTextDisplayer.prototype.configure=function(a){};shaka.text.StubTextDisplayer.prototype.remove=function(a,b){};shaka.text.StubTextDisplayer.prototype.append=function(a){};shaka.text.StubTextDisplayer.prototype.destroy=function(){};shaka.text.StubTextDisplayer.prototype.isTextVisible=function(){return!1};shaka.text.StubTextDisplayer.prototype.setTextVisibility=function(a){};goog.exportSymbol("shaka.text.StubTextDisplayer",shaka.text.StubTextDisplayer);
|
|
1180
1180
|
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);
|
|
1181
1181
|
goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"remove",shaka.text.StubTextDisplayer.prototype.remove);goog.exportProperty(shaka.text.StubTextDisplayer.prototype,"configure",shaka.text.StubTextDisplayer.prototype.configure);shaka.util.Dom=function(){};shaka.util.Dom.createHTMLElement=function(a){return document.createElement(a)};shaka.util.Dom.createButton=function(){var a=document.createElement("button");a.setAttribute("type","button");return a};shaka.util.Dom.asHTMLElement=function(a){return a};shaka.util.Dom.asHTMLCanvasElement=function(a){return a};shaka.util.Dom.asHTMLMediaElement=function(a){return a};
|
|
1182
|
-
shaka.util.Dom.getElementByClassName=function(a,b){b=b.getElementsByClassName(a);goog.asserts.assert(1==b.length,"Should only be one element with class name "+a);return shaka.util.Dom.asHTMLElement(b[0])};shaka.util.Dom.removeAllChildren=function(a){for(;a.firstChild;)a.removeChild(a.firstChild)};goog.exportSymbol("shaka.util.Dom",shaka.util.Dom);goog.exportProperty(shaka.util.Dom,"removeAllChildren",shaka.util.Dom.removeAllChildren);shaka.text.UITextDisplayer=function(a,b,c){var d=this;goog.asserts.assert(b,"videoContainer should be valid.");this.isTextVisible_=!1;this.cues_=[];this.video_=a;this.videoContainer_=b;this.aspectRatio_=null;this.textContainer_=shaka.util.Dom.createHTMLElement("div");this.textContainer_.classList.add("shaka-text-container");this.textContainer_.style.textAlign=
|
|
1183
|
-
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||
|
|
1184
|
-
"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)}),
|
|
1185
|
-
shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
|
|
1182
|
+
shaka.util.Dom.getElementByClassName=function(a,b){b=b.getElementsByClassName(a);goog.asserts.assert(1==b.length,"Should only be one element with class name "+a);return shaka.util.Dom.asHTMLElement(b[0])};shaka.util.Dom.removeAllChildren=function(a){for(;a.firstChild;)a.removeChild(a.firstChild)};goog.exportSymbol("shaka.util.Dom",shaka.util.Dom);goog.exportProperty(shaka.util.Dom,"removeAllChildren",shaka.util.Dom.removeAllChildren);shaka.text.UITextDisplayer=function(a,b,c){var d=this;goog.asserts.assert(b,"videoContainer should be valid.");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=
|
|
1183
|
+
"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||
|
|
1184
|
+
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)}),
|
|
1185
|
+
this.resizeObserver_.observe(this.textContainer_));this.regionElements_=new Map};shaka.text.UITextDisplayer.prototype.configure=function(a){this.captionsTimer_&&this.captionsTimer_.tickEvery(a.captionsUpdatePeriod)};
|
|
1186
1186
|
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_()};
|
|
1187
1187
|
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()};
|
|
1188
|
-
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};
|
|
1188
|
+
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)};
|
|
1189
1189
|
shaka.text.UITextDisplayer.prototype.isElementUnderTextContainer_=function(a){for(;null!=a;){if(a==this.textContainer_)return!0;a=a.parentElement}return!1};
|
|
1190
1190
|
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,
|
|
1191
1191
|
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."),
|
|
@@ -1455,8 +1455,8 @@ shaka.Player.prototype.setMaxHardwareResolution=function(a,b){this.maxHwRes_.wid
|
|
|
1455
1455
|
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_};
|
|
1456
1456
|
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||
|
|
1457
1457
|
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)};
|
|
1458
|
-
shaka.Player.prototype.defaultConfig_=function(){var a=this,b=shaka.util.PlayerConfiguration.createDefault();b.streaming.failureCallback=function(c){a.defaultStreamingFailureCallback_(c)};b.textDisplayFactory=function(){
|
|
1459
|
-
return new shaka.text.StubTextDisplayer};return b};shaka.Player.prototype.setVideoContainer=function(a){this.videoContainer_=a};
|
|
1458
|
+
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.");
|
|
1459
|
+
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};
|
|
1460
1460
|
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))}};
|
|
1461
1461
|
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)&&
|
|
1462
1462
|
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,
|
|
@@ -1468,9 +1468,9 @@ var c=this.config_.streaming.liveSync.targetLatencyTolerance,d=this.config_.stre
|
|
|
1468
1468
|
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))};
|
|
1469
1469
|
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)))}};
|
|
1470
1470
|
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()&&
|
|
1471
|
-
(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;
|
|
1472
|
-
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?
|
|
1473
|
-
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;
|
|
1471
|
+
(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;
|
|
1472
|
+
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?
|
|
1473
|
+
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;
|
|
1474
1474
|
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&&
|
|
1475
1475
|
(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 ("+
|
|
1476
1476
|
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())}};
|
|
@@ -1531,7 +1531,7 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
|
|
|
1531
1531
|
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);
|
|
1532
1532
|
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);
|
|
1533
1533
|
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);
|
|
1534
|
-
goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.11.
|
|
1534
|
+
goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.11.13-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1535
1535
|
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_++};
|
|
1536
1536
|
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};
|
|
1537
1537
|
shaka.ads.ClientSideAd.prototype.isClientRendering=function(){return!0};shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};shaka.ads.ClientSideAd.prototype.getMinSuggestedDuration=function(){return this.ad_.getMinSuggestedDuration()};shaka.ads.ClientSideAd.prototype.getRemainingTime=function(){return this.manager_.getRemainingTime()};shaka.ads.ClientSideAd.prototype.isPaused=function(){return this.isPaused_};
|
|
@@ -1607,22 +1607,22 @@ shaka.ads.InterstitialAdManager.prototype.determineIfUsingBaseVideo_=function(){
|
|
|
1607
1607
|
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};
|
|
1608
1608
|
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()};
|
|
1609
1609
|
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()})};
|
|
1610
|
-
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:
|
|
1611
|
-
|
|
1610
|
+
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,canJump:!0,resumeOffset:c?0:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:d&&!c}]):shaka.log.warning("Unsupported MPD alternate",
|
|
1611
|
+
a)):shaka.log.alwaysWarn("Unsupported MPD alternate",a)};
|
|
1612
1612
|
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);
|
|
1613
1613
|
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,
|
|
1614
1614
|
$jscomp.arrayFromIterable(shaka.ads.Utils.parseVastToInterstitials(n,l.time)));k=h.next();p.jumpTo(5);break;case 3:b.addInterstitials(g),p.jumpToEnd()}})};
|
|
1615
1615
|
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,
|
|
1616
1616
|
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};
|
|
1617
|
-
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=
|
|
1617
|
+
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&&
|
|
1618
1618
|
c.startTime>=h.startTime?!1:!0)}if(k){if(d==b){e=h;break}d++}}}return e};
|
|
1619
1619
|
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,y,x,z;return $jscomp.asyncExecutePromiseGeneratorProgram(function(C){switch(C.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?
|
|
1620
1620
|
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){C.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(B){if(1==B.nextAddress)return"detach"!=A.state?B.jumpTo(0):shaka.util.Platform.isSmartTV()?
|
|
1621
1621
|
B.yield(new Promise(function(D){return(new shaka.util.Timer(D)).tickAfter(.1)}),3):B.jumpTo(3);h.resolve();f.adEventManager_.unlisten(f.basePlayer_,"onstatechange",k);B.jumpToEnd()})};f.adEventManager_.listen(f.basePlayer_,"onstatechange",k);return C.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!=
|
|
1622
1622
|
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,B;return $jscomp.asyncExecutePromiseGeneratorProgram(function(D){if(1==D.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),D.jumpTo(0)):
|
|
1623
|
-
f.usingBaseVideo_?D.yield(f.player_.detach(),4):D.yield(f.player_.unload(),4);f.usingBaseVideo_&&(B=a.resumeOffset,null==B&&(B=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",B))));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));f.adEventManager_.removeAll();f.playingAd_=!1;f.usingBaseVideo_
|
|
1624
|
-
f.determineIfUsingBaseVideo_();D.jumpToEnd()})};q=function(A){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(l)return B.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_ERROR,(new Map).set("originalEvent",A)));return B.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));
|
|
1625
|
-
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,t,b,c);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(u.canSkipNow())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));
|
|
1623
|
+
f.usingBaseVideo_?D.yield(f.player_.detach(),4):D.yield(f.player_.unload(),4);f.usingBaseVideo_&&(B=a.resumeOffset,null==B&&(B=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",B))));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||
|
|
1624
|
+
f.baseVideo_.play());f.determineIfUsingBaseVideo_();D.jumpToEnd()})};q=function(A){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(l)return B.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_ERROR,(new Map).set("originalEvent",A)));return B.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));
|
|
1625
|
+
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,t,b,c);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(u.canSkipNow())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));
|
|
1626
1626
|
v=new Set;f.adEventManager_.listenOnce(f.player_,"error",q);f.adEventManager_.listen(f.video_,"timeupdate",function(){var A=f.video_.duration;if(A){if(a.isSkippable&&a.skipOffset&&u.canSkipNow()&&0<u.getRemainingTime()&&0<u.getDuration())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));A=100*f.video_.currentTime/A;25<=A&&!v.has("firstquartile")?(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_FIRST_QUARTILE)),v.add("firstquartile")):50<=A&&!v.has("midpoint")?
|
|
1627
1627
|
(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MIDPOINT)),v.add("midpoint")):75<=A&&!v.has("thirdquartile")&&(n(),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_THIRD_QUARTILE)),v.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>=
|
|
1628
1628
|
A.playRangeEnd)r();else f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_PAUSED))});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))});C.setCatchFinallyBlocks(4);f.updatePlayerConfig_();a.startTime&&a.endTime&&Infinity!=a.endTime&&a.startTime!=a.endTime&&(w=a.endTime-a.startTime,0<w&&f.player_.configure("playRangeEnd",w));a.playoutLimit&&
|