shaka-player 4.2.2 → 4.2.3
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/.github/workflows/build-and-test.yaml +11 -6
- package/.github/workflows/compute-incremental-coverage.py +14 -3
- package/.github/workflows/demo-version-index.yaml +1 -1
- package/.github/workflows/nightly-demo.yaml +1 -1
- package/.github/workflows/release-please.yaml +5 -5
- package/.github/workflows/report-incremental-coverage.yaml +1 -1
- package/.github/workflows/selenium-lab-tests.yaml +8 -6
- package/AUTHORS +1 -0
- package/CHANGELOG.md +17 -0
- package/CONTRIBUTORS +1 -0
- package/dist/deps.js +3 -3
- package/dist/locales.js +32 -32
- package/dist/shaka-player.compiled.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.externs.js +1 -0
- package/dist/shaka-player.compiled.debug.js +38 -37
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +1 -0
- package/dist/shaka-player.compiled.js +657 -657
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +1 -0
- package/dist/shaka-player.ui.debug.d.ts +1 -0
- package/dist/shaka-player.ui.debug.externs.js +1 -0
- package/dist/shaka-player.ui.debug.js +40 -40
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +1 -0
- package/dist/shaka-player.ui.js +772 -772
- package/dist/shaka-player.ui.map +3 -3
- package/docs/tutorials/welcome.md +2 -2
- package/lib/ads/client_side_ad_manager.js +5 -2
- package/lib/hls/hls_parser.js +18 -7
- package/lib/media/drm_engine.js +7 -6
- package/lib/media/playhead.js +1 -1
- package/lib/offline/indexeddb/storage_mechanism.js +24 -0
- package/lib/player.js +1 -1
- package/lib/polyfill/media_capabilities.js +7 -6
- package/lib/text/ttml_text_parser.js +69 -93
- package/lib/text/vtt_text_parser.js +1 -1
- package/lib/util/error.js +7 -0
- package/lib/util/periods.js +9 -9
- package/lib/util/platform.js +0 -10
- package/lib/util/xml_utils.js +45 -6
- package/package.json +1 -1
- package/test/offline/storage_integration.js +30 -0
- package/test/text/vtt_text_parser_unit.js +23 -1
- package/test/util/periods_unit.js +149 -11
- package/test/util/xml_utils_unit.js +64 -0
|
@@ -2717,6 +2717,7 @@ declare namespace shaka.util.Error {
|
|
|
2717
2717
|
HTTP_ERROR = 1002.0 ,
|
|
2718
2718
|
INCONSISTENT_DRM_ACROSS_PERIODS = 4038.0 ,
|
|
2719
2719
|
INDEXED_DB_ERROR = 9001.0 ,
|
|
2720
|
+
INDEXED_DB_INIT_TIMED_OUT = 9017.0 ,
|
|
2720
2721
|
INIT_DATA_TRANSFORM_ERROR = 6016.0 ,
|
|
2721
2722
|
INVALID_HLS_TAG = 4016.0 ,
|
|
2722
2723
|
INVALID_MP4_CEA = 2010.0 ,
|
|
@@ -2717,6 +2717,7 @@ declare namespace shaka.util.Error {
|
|
|
2717
2717
|
HTTP_ERROR = 1002.0 ,
|
|
2718
2718
|
INCONSISTENT_DRM_ACROSS_PERIODS = 4038.0 ,
|
|
2719
2719
|
INDEXED_DB_ERROR = 9001.0 ,
|
|
2720
|
+
INDEXED_DB_INIT_TIMED_OUT = 9017.0 ,
|
|
2720
2721
|
INIT_DATA_TRANSFORM_ERROR = 6016.0 ,
|
|
2721
2722
|
INVALID_HLS_TAG = 4016.0 ,
|
|
2722
2723
|
INVALID_MP4_CEA = 2010.0 ,
|
|
@@ -310,6 +310,7 @@ shaka.util.Error.Code = {
|
|
|
310
310
|
'STORAGE_LIMIT_REACHED': 9014,
|
|
311
311
|
'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
|
|
312
312
|
'MODIFY_OPERATION_NOT_SUPPORTED': 9016,
|
|
313
|
+
'INDEXED_DB_INIT_TIMED_OUT': 9017,
|
|
313
314
|
'CS_IMA_SDK_MISSING': 10000,
|
|
314
315
|
'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
|
|
315
316
|
'SS_IMA_SDK_MISSING': 10002,
|
|
@@ -188,7 +188,7 @@ DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADE
|
|
|
188
188
|
NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,HLS_AES_128_INVALID_IV_LENGTH:4043,HLS_AES_128_INVALID_KEY_LENGTH:4044,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,
|
|
189
189
|
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,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,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,
|
|
190
190
|
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,
|
|
191
|
-
MODIFY_OPERATION_NOT_SUPPORTED:9016,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};goog.exportProperty(shaka.util.Error,"Code",shaka.util.Error.Code);shaka.util.Functional=function(){};shaka.util.Functional.createFallbackPromiseChain=function(a,b){return a.reduce(function(c,d){return c["catch"](function(){return b(d)})},Promise.reject())};shaka.util.Functional.collapseArrays=function(a,b){return a.concat(b)};shaka.util.Functional.ignored=function(){};shaka.util.Functional.noop=function(){};shaka.util.Functional.isNotNull=function(a){return null!=a};shaka.util.ManifestParserUtils=function(){};shaka.util.ManifestParserUtils.resolveUris=function(a,b){var c=shaka.util.Functional;if(0==b.length)return a;var d=b.map(function(e){return new goog.Uri(e)});return a.map(function(e){return new goog.Uri(e)}).map(function(e){return d.map(function(f){return e.resolve(f)})}).reduce(c.collapseArrays,[]).map(function(e){return e.toString()})};
|
|
191
|
+
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};goog.exportProperty(shaka.util.Error,"Code",shaka.util.Error.Code);shaka.util.Functional=function(){};shaka.util.Functional.createFallbackPromiseChain=function(a,b){return a.reduce(function(c,d){return c["catch"](function(){return b(d)})},Promise.reject())};shaka.util.Functional.collapseArrays=function(a,b){return a.concat(b)};shaka.util.Functional.ignored=function(){};shaka.util.Functional.noop=function(){};shaka.util.Functional.isNotNull=function(a){return null!=a};shaka.util.ManifestParserUtils=function(){};shaka.util.ManifestParserUtils.resolveUris=function(a,b){var c=shaka.util.Functional;if(0==b.length)return a;var d=b.map(function(e){return new goog.Uri(e)});return a.map(function(e){return new goog.Uri(e)}).map(function(e){return d.map(function(f){return e.resolve(f)})}).reduce(c.collapseArrays,[]).map(function(e){return e.toString()})};
|
|
192
192
|
shaka.util.ManifestParserUtils.createDrmInfo=function(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:b||[],keyIds:new Set}};
|
|
193
193
|
shaka.util.ManifestParserUtils.guessCodecs=function(a,b){if(1==b.length)return b[0];var c=shaka.util.ManifestParserUtils.guessCodecsSafe(a,b);if(null!=c)return c;throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,b);};
|
|
194
194
|
shaka.util.ManifestParserUtils.guessCodecsSafe=function(a,b){for(var c=$jscomp.makeIterator(shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==shaka.util.ManifestParserUtils.ContentType.TEXT?"":null};shaka.util.ManifestParserUtils.ContentType={VIDEO:"video",AUDIO:"audio",TEXT:"text",IMAGE:"image",APPLICATION:"application"};
|
|
@@ -278,9 +278,8 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
|
|
|
278
278
|
"\u5ee3\u544a [AD_ON]/[NUM_ADS]"],["AD_TIME","\u5ee3\u544a\uff1a[AD_TIME]"],["AUTO_QUALITY","\u81ea\u52d5"],["BACK","\u8fd4\u56de"],["CAPTIONS","\u5b57\u5e55"],["CAST","\u6295\u653e..."],["ENTER_LOOP_MODE","\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["ENTER_PICTURE_IN_PICTURE","\u9032\u5165\u5b50\u6bcd\u756b\u9762"],["EXIT_FULL_SCREEN","\u9000\u51fa\u5168\u87a2\u5e55\u6a21\u5f0f"],["EXIT_LOOP_MODE","\u505c\u6b62\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["EXIT_PICTURE_IN_PICTURE",
|
|
279
279
|
"\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN","\u5168\u87a2\u5e55"],["LANGUAGE","\u8a9e\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u74b0\u64ad\u653e"],["MORE_SETTINGS","\u986f\u793a\u66f4\u591a\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u7a2e\u8a9e\u8a00"],["MUTE","\u975c\u97f3"],["NOT_APPLICABLE","\u4e0d\u9069\u7528"],["OFF","\u95dc\u9589"],["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],
|
|
280
280
|
["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["RESOLUTION","\u89e3\u6790\u5ea6"],["REWIND","\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]))};
|
|
281
|
-
shaka.ui.Locales.Ids={
|
|
282
|
-
UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",
|
|
283
|
-
SEEK:"SEEK"};shaka.abr={};shaka.abr.Ewma=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a);this.totalWeight_=this.estimate_=0};shaka.abr.Ewma.prototype.updateAlpha=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a)};shaka.abr.Ewma.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);c=b*(1-c)+c*this.estimate_;isNaN(c)||(this.estimate_=c,this.totalWeight_+=a)};
|
|
281
|
+
shaka.ui.Locales.Ids={EXIT_LOOP_MODE:"EXIT_LOOP_MODE",BACK:"BACK",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",NOT_APPLICABLE:"NOT_APPLICABLE",MUTE:"MUTE",PAUSE:"PAUSE",SKIP_AD:"SKIP_AD",LOOP:"LOOP",PLAY:"PLAY",SUBTITLE_FORCED:"SUBTITLE_FORCED",RESOLUTION:"RESOLUTION",REWIND:"REWIND",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",SEEK:"SEEK",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",AD_DURATION:"AD_DURATION",FULL_SCREEN:"FULL_SCREEN",CAST:"CAST",AD_PROGRESS:"AD_PROGRESS",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",
|
|
282
|
+
UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",REPLAY:"REPLAY",AUTO_QUALITY:"AUTO_QUALITY",LIVE:"LIVE",VOLUME:"VOLUME",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",ON:"ON",SKIP_TO_LIVE:"SKIP_TO_LIVE",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",OFF:"OFF",LANGUAGE:"LANGUAGE",QUALITY:"QUALITY",MORE_SETTINGS:"MORE_SETTINGS",CAPTIONS:"CAPTIONS",AIRPLAY:"AIRPLAY",UNMUTE:"UNMUTE",AD_TIME:"AD_TIME",FAST_FORWARD:"FAST_FORWARD",PLAYBACK_RATE:"PLAYBACK_RATE",STATISTICS:"STATISTICS"};shaka.abr={};shaka.abr.Ewma=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a);this.totalWeight_=this.estimate_=0};shaka.abr.Ewma.prototype.updateAlpha=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a)};shaka.abr.Ewma.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);c=b*(1-c)+c*this.estimate_;isNaN(c)||(this.estimate_=c,this.totalWeight_+=a)};
|
|
284
283
|
shaka.abr.Ewma.prototype.getEstimate=function(){return this.estimate_/(1-Math.pow(this.alpha_,this.totalWeight_))};shaka.abr.EwmaBandwidthEstimator=function(){this.fast_=new shaka.abr.Ewma(2);this.slow_=new shaka.abr.Ewma(5);this.bytesSampled_=0;this.minTotalBytes_=128E3;this.minBytes_=16E3};shaka.abr.EwmaBandwidthEstimator.prototype.configure=function(a){this.minTotalBytes_=a.minTotalBytes;this.minBytes_=a.minBytes;this.fast_.updateAlpha(a.fastHalfLife);this.slow_.updateAlpha(a.slowHalfLife)};
|
|
285
284
|
shaka.abr.EwmaBandwidthEstimator.prototype.sample=function(a,b){if(!(b<this.minBytes_)){var c=8E3*b/a,d=a/1E3;this.bytesSampled_+=b;this.fast_.sample(d,c);this.slow_.sample(d,c)}};shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate=function(a){return this.bytesSampled_<this.minTotalBytes_?a:Math.min(this.fast_.getEstimate(),this.slow_.getEstimate())};shaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate=function(){return this.bytesSampled_>=this.minTotalBytes_};shaka.util.ArrayUtils=function(){};shaka.util.ArrayUtils.defaultEquals=function(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b};shaka.util.ArrayUtils.remove=function(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)};shaka.util.ArrayUtils.count=function(a,b){for(var c=0,d=$jscomp.makeIterator(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};
|
|
286
285
|
shaka.util.ArrayUtils.hasSameElements=function(a,b,c){c||(c=shaka.util.ArrayUtils.defaultEquals);if(a.length!=b.length)return!1;b=b.slice();var d={};a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;d={$jscomp$loop$prop$item$653:d.$jscomp$loop$prop$item$653},e=a.next()){d.$jscomp$loop$prop$item$653=e.value;e=b.findIndex(function(f){return function(g){return c(f.$jscomp$loop$prop$item$653,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length};
|
|
@@ -302,7 +301,7 @@ goog.exportProperty(shaka.util.BufferUtils,"toUint8",shaka.util.BufferUtils.toUi
|
|
|
302
301
|
goog.exportProperty(shaka.dependencies,"has",shaka.dependencies.has);goog.exportProperty(shaka.dependencies,"add",shaka.dependencies.add);shaka.dependencies.Allowed={muxjs:"muxjs"};goog.exportProperty(shaka.dependencies,"Allowed",shaka.dependencies.Allowed);shaka.dependencies.dependencies_=new Map([[shaka.dependencies.Allowed.muxjs,function(){return window.muxjs}]]);shaka.util.PublicPromise=function(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c};shaka.util.PublicPromise.prototype.resolve=function(a){};shaka.util.PublicPromise.prototype.reject=function(a){};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.DelayedTick=function(a){this.onTick_=a;this.cancelPending_=null};shaka.util.DelayedTick.prototype.tickAfter=function(a){var b=this;this.stop();var c=!0,d=null;this.cancelPending_=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){if(c)b.onTick_()},1E3*a);return this};shaka.util.DelayedTick.prototype.stop=function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)};shaka.util.Timer=function(a){this.onTick_=a;this.ticker_=null};shaka.util.Timer.prototype.tickNow=function(){this.stop();this.onTick_();return this};shaka.util.Timer.prototype.tickAfter=function(a){var b=this;this.stop();this.ticker_=(new shaka.util.DelayedTick(function(){b.onTick_()})).tickAfter(a);return this};shaka.util.Timer.prototype.tickEvery=function(a){var b=this;this.stop();this.ticker_=(new shaka.util.DelayedTick(function(){b.ticker_.tickAfter(a);b.onTick_()})).tickAfter(a);return this};
|
|
303
302
|
shaka.util.Timer.prototype.stop=function(){this.ticker_&&(this.ticker_.stop(),this.ticker_=null)};goog.exportSymbol("shaka.util.Timer",shaka.util.Timer);goog.exportProperty(shaka.util.Timer.prototype,"stop",shaka.util.Timer.prototype.stop);goog.exportProperty(shaka.util.Timer.prototype,"tickEvery",shaka.util.Timer.prototype.tickEvery);goog.exportProperty(shaka.util.Timer.prototype,"tickAfter",shaka.util.Timer.prototype.tickAfter);goog.exportProperty(shaka.util.Timer.prototype,"tickNow",shaka.util.Timer.prototype.tickNow);shaka.util.Platform=function(){};shaka.util.Platform.supportsMediaSource=function(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1};shaka.util.Platform.supportsMediaType=function(a){return""!=shaka.util.Platform.anyMediaElement().canPlayType(a)};shaka.util.Platform.isEdge=function(){return navigator.userAgent.match(/Edge?\//)?!0:!1};shaka.util.Platform.isLegacyEdge=function(){return navigator.userAgent.match(/Edge\//)?!0:!1};shaka.util.Platform.isIE=function(){return shaka.util.Platform.userAgentContains_("Trident/")};
|
|
304
303
|
shaka.util.Platform.isXboxOne=function(){return shaka.util.Platform.userAgentContains_("Xbox One")};shaka.util.Platform.isTizen=function(){return shaka.util.Platform.userAgentContains_("Tizen")};shaka.util.Platform.isTizen4=function(){return shaka.util.Platform.userAgentContains_("Tizen 4")};shaka.util.Platform.isTizen3=function(){return shaka.util.Platform.userAgentContains_("Tizen 3")};shaka.util.Platform.isTizen2=function(){return shaka.util.Platform.userAgentContains_("Tizen 2")};
|
|
305
|
-
shaka.util.Platform.isWebOS=function(){return shaka.util.Platform.userAgentContains_("Web0S")};shaka.util.Platform.isWebOS3=function(){return shaka.util.Platform.userAgentContains_("Web0S")&&shaka.util.Platform.userAgentContains_("Chrome/38.0.2125.122 Safari/537.36")};shaka.util.Platform.isChromecast=function(){return shaka.util.Platform.userAgentContains_("CrKey")};
|
|
304
|
+
shaka.util.Platform.isWebOS=function(){return shaka.util.Platform.userAgentContains_("Web0S")};shaka.util.Platform.isWebOS3=function(){return shaka.util.Platform.userAgentContains_("Web0S")&&shaka.util.Platform.userAgentContains_("Chrome/38.0.2125.122 Safari/537.36")};shaka.util.Platform.isChromecast=function(){return shaka.util.Platform.userAgentContains_("CrKey")};
|
|
306
305
|
shaka.util.Platform.chromeVersion=function(){if(!shaka.util.Platform.userAgentContains_("Chrome"))return null;var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null};shaka.util.Platform.isChrome=function(){return shaka.util.Platform.userAgentContains_("Chrome")&&!shaka.util.Platform.isEdge()};
|
|
307
306
|
shaka.util.Platform.isApple=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!shaka.util.Platform.isTizen()&&!shaka.util.Platform.isEOS()&&!shaka.util.Platform.isPS4()&&!shaka.util.Platform.isAmazonFireTV()};shaka.util.Platform.isPS5=function(){return shaka.util.Platform.userAgentContains_("PlayStation 5")};shaka.util.Platform.isPS4=function(){return shaka.util.Platform.userAgentContains_("PlayStation 4")};shaka.util.Platform.isAmazonFireTV=function(){return shaka.util.Platform.userAgentContains_("AFT")};
|
|
308
307
|
shaka.util.Platform.safariVersion=function(){if(!shaka.util.Platform.isApple())return null;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null};shaka.util.Platform.isSafari=function(){return!!shaka.util.Platform.safariVersion()};shaka.util.Platform.isEOS=function(){return shaka.util.Platform.userAgentContains_("PC=EOS")};
|
|
@@ -491,7 +490,16 @@ if(0<a.version){b=a.reader.readUint32();for(var c=0;c<b;c++){var d=shaka.util.Ui
|
|
|
491
490
|
shaka.util.Pssh.createPssh=function(a,b,c,d){goog.asserts.assert(16==b.byteLength,"Invalid system ID length");var e=a.length,f=12+b.length+4+e;0<d&&(f+=4+16*c.size);var g=new Uint8Array(f),h=shaka.util.BufferUtils.toDataView(g),k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;1>d?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(0<d)for(h.setUint32(k,c.size),k+=4,b=shaka.util.Uint8ArrayUtils,c=$jscomp.makeIterator(c),d=c.next();!d.done;d=c.next())d=b.fromHex(d.value),
|
|
492
491
|
g.set(d,k),k+=d.length;h.setUint32(k,e);k+=4;g.set(a,k);goog.asserts.assert(k+e===f,"PSSH invalid length.");return g};
|
|
493
492
|
shaka.util.Pssh.normaliseInitData=function(a){if(!a)return a;var b=new shaka.util.Pssh(a);if(1>=b.data.length)return a;a=[];var c={};b=$jscomp.makeIterator(b.data);for(var d=b.next();!d.done;c={$jscomp$loop$prop$initData$457$665:c.$jscomp$loop$prop$initData$457$665},d=b.next())c.$jscomp$loop$prop$initData$457$665=d.value,a.some(function(e){return function(f){return shaka.util.BufferUtils.equal(f,e.$jscomp$loop$prop$initData$457$665)}}(c))||a.push(c.$jscomp$loop$prop$initData$457$665);return shaka.util.Uint8ArrayUtils.concat.apply(shaka.util.Uint8ArrayUtils,
|
|
494
|
-
$jscomp.arrayFromIterable(a))};shaka.
|
|
493
|
+
$jscomp.arrayFromIterable(a))};shaka.util.XmlUtils=function(){};shaka.util.XmlUtils.findChild=function(a,b){var c=shaka.util.XmlUtils.findChildren(a,b);return 1!=c.length?null:c[0]};shaka.util.XmlUtils.findChildNS=function(a,b,c){a=shaka.util.XmlUtils.findChildrenNS(a,b,c);return 1!=a.length?null:a[0]};shaka.util.XmlUtils.findChildren=function(a,b){for(var c=[],d=$jscomp.makeIterator(a.childNodes),e=d.next();!e.done;e=d.next())e=e.value,e instanceof Element&&e.tagName==b&&c.push(e);return c};
|
|
494
|
+
shaka.util.XmlUtils.getChildren=function(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})};shaka.util.XmlUtils.findChildrenNS=function(a,b,c){var d=[];a=$jscomp.makeIterator(a.childNodes);for(var e=a.next();!e.done;e=a.next())e=e.value,e instanceof Element&&e.localName==c&&e.namespaceURI==b&&d.push(e);return d};shaka.util.XmlUtils.getAttributeNS=function(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null};
|
|
495
|
+
shaka.util.XmlUtils.getAttributeNSList=function(a,b,c){b=$jscomp.makeIterator(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,a.hasAttributeNS(d,c))return a.getAttributeNS(d,c);return null};shaka.util.XmlUtils.getContents=function(a){var b=shaka.util.XmlUtils;return Array.from(a.childNodes).every(b.isText)?a.textContent.trim():null};shaka.util.XmlUtils.isText=function(a){return a.nodeType==Node.TEXT_NODE||a.nodeType==Node.CDATA_SECTION_NODE};
|
|
496
|
+
shaka.util.XmlUtils.parseAttr=function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e};shaka.util.XmlUtils.parseDate=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3};
|
|
497
|
+
shaka.util.XmlUtils.parseDuration=function(a){if(!a)return null;var b=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$").exec(a);if(!b)return shaka.log.warning("Invalid duration string:",a),null;a=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null};
|
|
498
|
+
shaka.util.XmlUtils.parseRange=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null};shaka.util.XmlUtils.parseInt=function(a){a=Number(a);return 0===a%1?a:null};shaka.util.XmlUtils.parsePositiveInt=function(a){a=Number(a);return 0===a%1&&0<a?a:null};shaka.util.XmlUtils.parseNonNegativeInt=function(a){a=Number(a);return 0===a%1&&0<=a?a:null};
|
|
499
|
+
shaka.util.XmlUtils.parseFloat=function(a){a=Number(a);return isNaN(a)?null:a};shaka.util.XmlUtils.evalDivision=function(a){var b;var c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c};
|
|
500
|
+
shaka.util.XmlUtils.parseXmlString=function(a,b){var c=new DOMParser,d=shaka.util.XmlUtils.trustedHTMLFromString_.value()(a),e=null;try{e=c.parseFromString(d,"text/xml")}catch(f){return shaka.log.error("XML parsing exception:",f),null}goog.asserts.assert(e,"Parsed XML document cannot be null!");c=e.documentElement;if(!c)return shaka.log.error("XML document was empty!"),null;d=c.getElementsByTagName("parsererror");if(d.length)return shaka.log.error("XML parser error found:",d[0]),null;if(c.tagName!=
|
|
501
|
+
b)return shaka.log.error('XML tag name does not match expected "'+b+'":',c.tagName),null;for(e=document.createNodeIterator(e,NodeFilter.SHOW_ALL);d=e.nextNode();)if(d instanceof HTMLElement||d instanceof SVGElement)return shaka.log.error("XML document embeds unsafe content!"),null;return c};shaka.util.XmlUtils.parseXml=function(a,b){try{var c=shaka.util.StringUtils.fromUTF8(a);return shaka.util.XmlUtils.parseXmlString(c,b)}catch(d){return shaka.log.error("parseXmlString threw!",d),null}};
|
|
502
|
+
shaka.util.XmlUtils.trustedHTMLFromString_=new shaka.util.Lazy(function(){if("undefined"!==typeof trustedTypes){var a=trustedTypes.createPolicy("shaka-player#xml",{createHTML:function(b){return b}});return function(b){return a.createHTML(b)}}return function(b){return b}});shaka.media.DrmEngine=function(a,b){var c=this;b=void 0===b?1:b;this.playerInterface_=a;this.supportedTypes_=new Set;this.video_=this.mediaKeys_=null;this.initializedForStorage_=this.initialized_=!1;this.licenseTimeSeconds_=0;this.currentDrmInfo_=null;this.eventManager_=new shaka.util.EventManager;this.activeSessions_=new Map;this.offlineSessionIds_=[];this.allSessionsLoaded_=new shaka.util.PublicPromise;this.config_=null;this.onError_=function(d){c.allSessionsLoaded_.reject(d);a.onError(d)};this.keyStatusByKeyId_=
|
|
495
503
|
new Map;this.announcedKeyStatusByKeyId_=new Map;this.keyStatusTimer_=new shaka.util.Timer(function(){return c.processKeyStatusChanges_()});this.usePersistentLicenses_=!1;this.mediaKeyMessageEvents_=[];this.initialRequestsSent_=!1;this.expirationTimer_=(new shaka.util.Timer(function(){c.pollExpiration_()})).tickEvery(b);this.allSessionsLoaded_["catch"](function(){});this.destroyer_=new shaka.util.Destroyer(function(){return c.destroyNow_()});this.srcEquals_=!1;this.mediaKeysAttached_=null};
|
|
496
504
|
shaka.media.DrmEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
|
|
497
505
|
shaka.media.DrmEngine.prototype.destroyNow_=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){switch(b.nextAddress){case 1:return a.eventManager_.release(),a.eventManager_=null,a.allSessionsLoaded_.reject(),a.expirationTimer_.stop(),a.expirationTimer_=null,a.keyStatusTimer_.stop(),a.keyStatusTimer_=null,b.yield(a.closeOpenSessions_(),2);case 2:if(!a.video_){b.jumpTo(3);break}goog.asserts.assert(!a.video_.src,"video src must be removed first!");b.setCatchFinallyBlocks(4);
|
|
@@ -501,11 +509,11 @@ shaka.media.DrmEngine.prototype.initForRemoval=function(a,b,c,d,e){var f=new Map
|
|
|
501
509
|
shaka.media.DrmEngine.prototype.init_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,u;return $jscomp.asyncExecutePromiseGeneratorProgram(function(v){if(1==v.nextAddress){goog.asserts.assert(b.config_,"DrmEngine configure() must be called before init()!");if(c=b.configureClearKey_())for(d=$jscomp.makeIterator(a),e=d.next();!e.done;e=d.next())f=e.value,f.video&&(f.video.drmInfos=[c]),f.audio&&(f.audio.drmInfos=[c]);g=a.some(function(t){return t.video&&t.video.drmInfos.length||t.audio&&t.audio.drmInfos.length?
|
|
502
510
|
!0:!1});g||(h=shaka.util.MapUtils.asMap(b.config_.servers),shaka.media.DrmEngine.replaceDrmInfo_(a,h));k=$jscomp.makeIterator(a);for(e=k.next();!e.done;e=k.next())for(l=e.value,m=b.getVariantDrmInfos_(l),n=$jscomp.makeIterator(m),p=n.next();!p.done;p=n.next())q=p.value,shaka.media.DrmEngine.fillInDrmInfoDefaults_(q,shaka.util.MapUtils.asMap(b.config_.servers),shaka.util.MapUtils.asMap(b.config_.advanced||{}),b.config_.keySystemsMapping);return v.yield(shaka.util.StreamUtils.getDecodingInfosForVariants(a,
|
|
503
511
|
b.usePersistentLicenses_,b.srcEquals_),2)}r=g||Object.keys(b.config_.servers).length;if(!r)return b.initialized_=!0,v["return"](Promise.resolve());u=b.queryMediaKeys_(void 0,a);return v["return"](g?u:u["catch"](function(){}))})};
|
|
504
|
-
shaka.media.DrmEngine.prototype.attachMediaKeys_=function(){var a=this,b;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){switch(c.nextAddress){case 1:if(a.video_.mediaKeys)return c["return"]();if(!a.mediaKeysAttached_){c.jumpTo(2);break}return c.yield(a.mediaKeysAttached_,3);case 3:return c["return"]();case 2:return c.setCatchFinallyBlocks(4),a.mediaKeysAttached_=a.video_.setMediaKeys(a.mediaKeys_),c.yield(a.mediaKeysAttached_,6);case 6:c.leaveTryBlock(5);
|
|
505
|
-
goog.asserts.assert(b instanceof Error,"Wrong error type!"),a.onError_(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO,b.message));case 5:a.destroyer_.ensureNotDestroyed(),c.jumpToEnd()}})};
|
|
512
|
+
shaka.media.DrmEngine.prototype.attachMediaKeys_=function(){var a=this,b;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){switch(c.nextAddress){case 1:if(a.video_.mediaKeys)return c["return"]();if(!a.mediaKeysAttached_){c.jumpTo(2);break}return c.yield(a.mediaKeysAttached_,3);case 3:return a.destroyer_.ensureNotDestroyed(),c["return"]();case 2:return c.setCatchFinallyBlocks(4),a.mediaKeysAttached_=a.video_.setMediaKeys(a.mediaKeys_),c.yield(a.mediaKeysAttached_,6);case 6:c.leaveTryBlock(5);
|
|
513
|
+
break;case 4:b=c.enterCatchBlock(),goog.asserts.assert(b instanceof Error,"Wrong error type!"),a.onError_(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO,b.message));case 5:a.destroyer_.ensureNotDestroyed(),c.jumpToEnd()}})};
|
|
506
514
|
shaka.media.DrmEngine.prototype.onEncryptedEvent_=function(a){var b=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return c.yield(b.attachMediaKeys_(),2);b.newInitData(a.initDataType,shaka.util.BufferUtils.toUint8(a.initData));c.jumpToEnd()})};
|
|
507
515
|
shaka.media.DrmEngine.prototype.attach=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress){if(!b.mediaKeys_)return b.eventManager_.listenOnce(a,"encrypted",function(e){b.onError_(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO))}),d["return"]();b.video_=a;b.eventManager_.listenOnce(b.video_,"play",function(){return b.onPlay_()});"webkitCurrentPlaybackTargetIsWireless"in
|
|
508
|
-
b.video_&&b.eventManager_.listen(b.video_,"webkitcurrentplaybacktargetiswirelesschanged",function(){return b.closeOpenSessions_()});return(c=b.currentDrmInfo_.initData.find(function(e){return 0<e.initData.length}))||
|
|
516
|
+
b.video_&&b.eventManager_.listen(b.video_,"webkitcurrentplaybacktargetiswirelesschanged",function(){return b.closeOpenSessions_()});return(c=b.currentDrmInfo_.initData.find(function(e){return 0<e.initData.length}))||"com.apple.fps"!==b.currentDrmInfo_.keySystem||b.offlineSessionIds_.length?d.yield(b.attachMediaKeys_(),2):d.jumpTo(2)}b.createOrLoad();c||b.offlineSessionIds_.length||b.config_.parseInbandPsshEnabled||b.eventManager_.listen(b.video_,"encrypted",function(e){return b.onEncryptedEvent_(e)});
|
|
509
517
|
d.jumpToEnd()})};
|
|
510
518
|
shaka.media.DrmEngine.prototype.setServerCertificate=function(){var a=this,b,c,d,e,f,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){switch(h.nextAddress){case 1:goog.asserts.assert(a.initialized_,"Must call init() before setServerCertificate");if(!a.mediaKeys_||!a.currentDrmInfo_)return h["return"]();if(!a.currentDrmInfo_.serverCertificateUri||a.currentDrmInfo_.serverCertificate&&a.currentDrmInfo_.serverCertificate.length){h.jumpTo(2);break}b=shaka.net.NetworkingEngine.makeRequest([a.currentDrmInfo_.serverCertificateUri],a.config_.retryParameters);
|
|
511
519
|
h.setCatchFinallyBlocks(3);c=a.playerInterface_.netEngine.request(shaka.net.NetworkingEngine.RequestType.SERVER_CERTIFICATE,b);return h.yield(c.promise,5);case 5:d=h.yieldResult;a.currentDrmInfo_.serverCertificate=shaka.util.BufferUtils.toUint8(d.data);h.leaveTryBlock(4);break;case 3:throw e=h.enterCatchBlock(),goog.asserts.assert(e instanceof shaka.util.Error,"Wrong NetworkingEngine error type!"),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.SERVER_CERTIFICATE_REQUEST_FAILED,
|
|
@@ -545,10 +553,10 @@ shaka.media.DrmEngine.prototype.sendLicenseRequest_=function(a){var b=this,c,d,e
|
|
|
545
553
|
l=Date.now(),w.setCatchFinallyBlocks(2),n=b.playerInterface_.netEngine.request(h,k),w.yield(n.promise,4);case 4:m=w.yieldResult;w.leaveTryBlock(3);break;case 2:return p=w.enterCatchBlock(),goog.asserts.assert(p instanceof shaka.util.Error,"Wrong NetworkingEngine error type!"),q=new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.LICENSE_REQUEST_FAILED,p),b.onError_(q),e&&e.updatePromise&&e.updatePromise.reject(q),w["return"]();case 3:if(b.destroyer_.destroyed())return w["return"]();
|
|
546
554
|
b.licenseTimeSeconds_+=(Date.now()-l)/1E3;b.config_.logLicenseExchange&&(r=shaka.util.Uint8ArrayUtils.toBase64(m.data),shaka.log.info("EME license response",r));w.setCatchFinallyBlocks(5);shaka.log.v1("Updating session",c.sessionId);return w.yield(c.update(m.data),7);case 7:w.leaveTryBlock(6);break;case 5:return u=w.enterCatchBlock(),v=new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED,u.message),b.onError_(v),e&&e.updatePromise&&
|
|
547
555
|
e.updatePromise.reject(v),w["return"]();case 6:if(b.destroyer_.destroyed())return w["return"]();t=new shaka.util.FakeEvent("drmsessionupdate");b.playerInterface_.onEvent(t);e&&(e.updatePromise&&e.updatePromise.resolve(),x=new shaka.util.Timer(function(){e.loaded=!0;b.areAllSessionsLoaded_()&&b.allSessionsLoaded_.resolve()}),x.tickAfter(shaka.media.DrmEngine.SESSION_LOAD_TIMEOUT_));w.jumpToEnd()}})};
|
|
548
|
-
shaka.media.DrmEngine.prototype.unpackPlayReadyRequest_=function(a){var b=shaka.util.StringUtils.fromUTF16(a.body,!0,!0);if(b.includes("PlayReadyKeyMessage")){shaka.log.debug("Unwrapping PlayReady request.");b=(
|
|
549
|
-
a.headers[d.textContent]=e.textContent}b=b.getElementsByTagName("Challenge")[0];goog.asserts.assert(b,"Malformed PlayReady challenge!");goog.asserts.assert("base64encoded"==b.getAttribute("encoding"),"Unexpected PlayReady challenge encoding!");a.body=shaka.util.Uint8ArrayUtils.fromBase64(b.textContent)}else shaka.log.debug("PlayReady request is already unwrapped."),a.headers["Content-Type"]="text/xml; charset=utf-8"};
|
|
556
|
+
shaka.media.DrmEngine.prototype.unpackPlayReadyRequest_=function(a){var b=shaka.util.StringUtils.fromUTF16(a.body,!0,!0);if(b.includes("PlayReadyKeyMessage")){shaka.log.debug("Unwrapping PlayReady request.");b=shaka.util.XmlUtils.parseXmlString(b,"PlayReadyKeyMessage");goog.asserts.assert(b,"Failed to parse PlayReady XML!");var c=b.getElementsByTagName("HttpHeader");c=$jscomp.makeIterator(c);for(var d=c.next();!d.done;d=c.next()){var e=d.value;d=e.getElementsByTagName("name")[0];e=e.getElementsByTagName("value")[0];
|
|
557
|
+
goog.asserts.assert(d&&e,"Malformed PlayReady headers!");a.headers[d.textContent]=e.textContent}b=b.getElementsByTagName("Challenge")[0];goog.asserts.assert(b,"Malformed PlayReady challenge!");goog.asserts.assert("base64encoded"==b.getAttribute("encoding"),"Unexpected PlayReady challenge encoding!");a.body=shaka.util.Uint8ArrayUtils.fromBase64(b.textContent)}else shaka.log.debug("PlayReady request is already unwrapped."),a.headers["Content-Type"]="text/xml; charset=utf-8"};
|
|
550
558
|
shaka.media.DrmEngine.prototype.onKeyStatusesChange_=function(a){var b=this;a=a.target;shaka.log.v2("Key status changed for session",a.sessionId);var c=this.activeSessions_.get(a),d=!1;a.keyStatuses.forEach(function(f,g){if("string"==typeof g){var h=g;g=f;f=h}if(shaka.media.DrmEngine.isPlayReadyKeySystem(b.currentDrmInfo_.keySystem)&&16==g.byteLength&&(shaka.util.Platform.isEdge()||shaka.util.Platform.isPS4())){h=shaka.util.BufferUtils.toDataView(g);var k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,
|
|
551
|
-
!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}"status-pending"!=f&&(c.loaded=!0);c||goog.asserts.assert("usable"!=f,"Usable keys found in closed session");"expired"==f&&(d=!0);h=shaka.util.Uint8ArrayUtils.toHex(g);b.keyStatusByKeyId_.set(h,f)});var e=a.expiration-Date.now();(0>e||d&&1E3>e)&&c&&!c.updatePromise&&(shaka.log.debug("Session has expired",a.sessionId),this.activeSessions_["delete"](a),a.close()["catch"](function(){}));this.areAllSessionsLoaded_()&&(this.allSessionsLoaded_.resolve(),
|
|
559
|
+
!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}"status-pending"!=f&&(c.loaded=!0);c||goog.asserts.assert("usable"!=f,"Usable keys found in closed session");"expired"==f&&(d=!0);h=shaka.util.Uint8ArrayUtils.toHex(g).slice(0,32);b.keyStatusByKeyId_.set(h,f)});var e=a.expiration-Date.now();(0>e||d&&1E3>e)&&c&&!c.updatePromise&&(shaka.log.debug("Session has expired",a.sessionId),this.activeSessions_["delete"](a),a.close()["catch"](function(){}));this.areAllSessionsLoaded_()&&(this.allSessionsLoaded_.resolve(),
|
|
552
560
|
this.keyStatusTimer_.tickAfter(shaka.media.DrmEngine.KEY_STATUS_BATCH_TIME))};shaka.media.DrmEngine.prototype.processKeyStatusChanges_=function(){var a=this.keyStatusByKeyId_,b=this.announcedKeyStatusByKeyId_;b.clear();a.forEach(function(c,d){return b.set(d,c)});a=Array.from(b.values());if(a.length&&a.every(function(c){return"expired"==c}))this.onError_(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.EXPIRED));this.playerInterface_.onKeyStatus(shaka.util.MapUtils.asObject(b))};
|
|
553
561
|
shaka.media.DrmEngine.isBrowserSupported=function(){return!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration};
|
|
554
562
|
shaka.media.DrmEngine.probeSupport=function(){var a,b,c,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){return 1==k.nextAddress?(goog.asserts.assert(shaka.media.DrmEngine.isBrowserSupported(),"Must have basic EME support"),a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.recommendation com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" "),b=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],
|
|
@@ -769,7 +777,7 @@ function(){c()})};shaka.media.SrcEqualsPlayhead.prototype.release=function(){thi
|
|
|
769
777
|
shaka.media.SrcEqualsPlayhead.prototype.getGapsJumped=function(){return 0};shaka.media.SrcEqualsPlayhead.prototype.notifyOfBufferingChange=function(){};
|
|
770
778
|
shaka.media.MediaSourcePlayhead=function(a,b,c,d,e,f){var g=this;this.minSeekRange_=3;this.mediaElement_=a;this.timeline_=b.presentationTimeline;this.minBufferTime_=b.minBufferTime||0;this.config_=c;this.onSeek_=e;this.lastCorrectiveSeek_=null;this.stallDetector_=this.createStallDetector_(a,c,f);this.gapController_=new shaka.media.GapJumpingController(a,b.presentationTimeline,c,this.stallDetector_,f);this.videoWrapper_=new shaka.media.VideoWrapper(a,function(){return g.onSeeking_()},this.getStartTime_(d));
|
|
771
779
|
this.checkWindowTimer_=(new shaka.util.Timer(function(){g.onPollWindow_()})).tickEvery(.25)};shaka.media.MediaSourcePlayhead.prototype.release=function(){this.videoWrapper_&&(this.videoWrapper_.release(),this.videoWrapper_=null);this.gapController_&&(this.gapController_.release(),this.gapController_=null);this.checkWindowTimer_&&(this.checkWindowTimer_.stop(),this.checkWindowTimer_=null);this.mediaElement_=this.videoWrapper_=this.timeline_=this.config_=null;this.onSeek_=function(){}};
|
|
772
|
-
shaka.media.MediaSourcePlayhead.prototype.setStartTime=function(a){this.videoWrapper_.setTime(a)};shaka.media.MediaSourcePlayhead.prototype.getTime=function(){var a=this.videoWrapper_.getTime();return 0<this.mediaElement_.readyState&&!this.mediaElement_.paused?this.clampTime_(a):a};shaka.media.MediaSourcePlayhead.prototype.getStallsDetected=function(){return this.stallDetector_.getStallsDetected()};shaka.media.MediaSourcePlayhead.prototype.getGapsJumped=function(){return this.gapController_.getGapsJumped()};
|
|
780
|
+
shaka.media.MediaSourcePlayhead.prototype.setStartTime=function(a){this.videoWrapper_.setTime(a)};shaka.media.MediaSourcePlayhead.prototype.getTime=function(){var a=this.videoWrapper_.getTime();return 0<this.mediaElement_.readyState&&!this.mediaElement_.paused?this.clampTime_(a):a};shaka.media.MediaSourcePlayhead.prototype.getStallsDetected=function(){return this.stallDetector_?this.stallDetector_.getStallsDetected():0};shaka.media.MediaSourcePlayhead.prototype.getGapsJumped=function(){return this.gapController_.getGapsJumped()};
|
|
773
781
|
shaka.media.MediaSourcePlayhead.prototype.getStartTime_=function(a){null==a?a=Infinity>this.timeline_.getDuration()?this.timeline_.getSeekRangeStart():this.timeline_.getSeekRangeEnd():0>a&&(a=this.timeline_.getSeekRangeEnd()+a);return this.clampSeekToDuration_(this.clampTime_(a))};shaka.media.MediaSourcePlayhead.prototype.notifyOfBufferingChange=function(){this.gapController_.onSegmentAppended()};
|
|
774
782
|
shaka.media.MediaSourcePlayhead.prototype.onPollWindow_=function(){if(0!=this.mediaElement_.readyState&&!this.mediaElement_.paused){var a=this.videoWrapper_.getTime(),b=this.timeline_.getSeekRangeStart(),c=this.timeline_.getSeekRangeEnd();c-b<this.minSeekRange_&&(b=c-this.minSeekRange_);a<b&&(b=this.reposition_(a),shaka.log.info("Jumping forward "+(b-a)+" seconds to catch up with the seek range."),this.mediaElement_.currentTime=b)}};
|
|
775
783
|
shaka.media.MediaSourcePlayhead.prototype.onSeeking_=function(){this.gapController_.onSeeking();var a=this.videoWrapper_.getTime(),b=this.reposition_(a);if(Math.abs(b-a)>shaka.media.GapJumpingController.BROWSER_GAP_TOLERANCE){var c=Date.now()/1E3;if(!this.lastCorrectiveSeek_||this.lastCorrectiveSeek_<c-1){this.lastCorrectiveSeek_=c;this.videoWrapper_.setTime(b);return}}shaka.log.v1("Seek to "+a);this.onSeek_()};
|
|
@@ -1188,7 +1196,7 @@ goog.exportProperty(shaka.Player.prototype,"goToLive",shaka.Player.prototype.goT
|
|
|
1188
1196
|
goog.exportProperty(shaka.Player.prototype,"getAdManager",shaka.Player.prototype.getAdManager);goog.exportProperty(shaka.Player.prototype,"getAssetUri",shaka.Player.prototype.getAssetUri);goog.exportProperty(shaka.Player.prototype,"getNetworkingEngine",shaka.Player.prototype.getNetworkingEngine);goog.exportProperty(shaka.Player.prototype,"getMediaElement",shaka.Player.prototype.getMediaElement);goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.getLoadMode);
|
|
1189
1197
|
goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.prototype.resetConfiguration);goog.exportProperty(shaka.Player.prototype,"getBufferFullness",shaka.Player.prototype.getBufferFullness);goog.exportProperty(shaka.Player.prototype,"getConfiguration",shaka.Player.prototype.getConfiguration);goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.configure);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);
|
|
1190
1198
|
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);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);
|
|
1191
|
-
goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.2.
|
|
1199
|
+
goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.2.3-debug";
|
|
1192
1200
|
goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.restrictedStatuses_=["output-restricted","internal-error"];shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1193
1201
|
shaka.Player.SRC_EQUAL_EXTENSIONS_TO_MIME_TYPES_={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"};
|
|
1194
1202
|
shaka.Player.TEXT_EXTENSIONS_TO_MIME_TYPES_={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];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_++};
|
|
@@ -1210,7 +1218,7 @@ shaka.ads.ClientSideAdManager.prototype.onAdError_=function(a){shaka.log.warning
|
|
|
1210
1218
|
shaka.ads.ClientSideAdManager.prototype.onAdsManagerLoaded_=function(a){var b=this;goog.asserts.assert(null!=this.video_,"Video should not be null!");var c=Date.now()/1E3-this.requestAdsStartTime_;this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.ADS_LOADED,(new Map).set("loadTime",c)));this.imaAdsManager_=a.getAdsManager(this.video_);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.IMA_AD_MANAGER_LOADED,(new Map).set("imaAdManager",this.imaAdsManager_)));c=this.imaAdsManager_.getCuePoints();
|
|
1211
1219
|
if(c.length){a=[];c=$jscomp.makeIterator(c);for(var d=c.next();!d.done;d=c.next())a.push({start:d.value,end:null});this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.CUEPOINTS_CHANGED,(new Map).set("cuepoints",a)))}this.addImaEventListeners_();try{var e=this.isFullScreenEnabled_()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;this.imaAdsManager_.init(this.video_.offsetWidth,this.video_.offsetHeight,e);this.eventManager_.listen(this.video_,"loadeddata",function(){var f=b.isFullScreenEnabled_()?
|
|
1212
1220
|
google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;b.imaAdsManager_.resize(b.video_.offsetWidth,b.video_.offsetHeight,f)});"ResizeObserver"in window?(this.resizeObserver_=new ResizeObserver(function(){var f=b.isFullScreenEnabled_()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;b.imaAdsManager_.resize(b.video_.offsetWidth,b.video_.offsetHeight,f)}),this.resizeObserver_.observe(this.video_)):this.eventManager_.listen(document,"fullscreenchange",function(){var f=b.isFullScreenEnabled_()?
|
|
1213
|
-
google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;b.imaAdsManager_.resize(b.video_.offsetWidth,b.video_.offsetHeight,f)});this.imaAdsManager_.start()}catch(f){this.onAdComplete_(null)}};shaka.ads.ClientSideAdManager.prototype.isFullScreenEnabled_=function(){if(document.fullscreenEnabled)return!!document.fullscreenElement;var a=this.video_;return a.webkitSupportsFullscreen?a.webkitDisplayingFullscreen:!1};
|
|
1221
|
+
google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;b.imaAdsManager_.resize(b.video_.offsetWidth,b.video_.offsetHeight,f)});this.video_.addEventListener("play",function(){b.imaAdsManager_.start()},{once:!0})}catch(f){this.onAdComplete_(null)}};shaka.ads.ClientSideAdManager.prototype.isFullScreenEnabled_=function(){if(document.fullscreenEnabled)return!!document.fullscreenElement;var a=this.video_;return a.webkitSupportsFullscreen?a.webkitDisplayingFullscreen:!1};
|
|
1214
1222
|
shaka.ads.ClientSideAdManager.prototype.addImaEventListeners_=function(){var a=this,b=function(c,d){var e=(new Map).set("originalEvent",c);a.onEvent_(new shaka.util.FakeEvent(d,e))};this.eventManager_.listen(this.imaAdsManager_,google.ima.AdErrorEvent.Type.AD_ERROR,function(c){a.onAdError_(c)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(c){a.onAdStart_(c)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.STARTED,function(c){a.onAdStart_(c)});
|
|
1215
1223
|
this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.FIRST_QUARTILE,function(c){b(c,shaka.ads.AdManager.AD_FIRST_QUARTILE)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.MIDPOINT,function(c){b(c,shaka.ads.AdManager.AD_MIDPOINT)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.THIRD_QUARTILE,function(c){b(c,shaka.ads.AdManager.AD_THIRD_QUARTILE)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.COMPLETE,function(c){b(c,
|
|
1216
1224
|
shaka.ads.AdManager.AD_COMPLETE)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(c){a.onAdComplete_(c)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(c){a.onAdComplete_(c)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.SKIPPED,function(c){b(c,shaka.ads.AdManager.AD_SKIPPED)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.VOLUME_CHANGED,function(c){b(c,
|
|
@@ -1358,15 +1366,7 @@ shaka.cast.CastReceiver.prototype.sendMessage_=function(a,b,c){this.isConnected_
|
|
|
1358
1366
|
shaka.cast.CastReceiver.prototype.sendMediaStatus_=function(a,b){a=void 0===a?0:a;b=void 0===b?null:b;var c={mediaSessionId:0,playbackRate:this.video_.playbackRate,playerState:this.getPlayState_(),currentTime:this.video_.currentTime,supportedMediaCommands:63,volume:{level:this.video_.volume,muted:this.video_.muted}};b&&(c.media=b);this.sendMessage_({requestId:a,type:"MEDIA_STATUS",status:[c]},this.genericBus_)};goog.exportSymbol("shaka.cast.CastReceiver",shaka.cast.CastReceiver);
|
|
1359
1367
|
goog.exportProperty(shaka.cast.CastReceiver.prototype,"destroy",shaka.cast.CastReceiver.prototype.destroy);goog.exportProperty(shaka.cast.CastReceiver.prototype,"setContentArtist",shaka.cast.CastReceiver.prototype.setContentArtist);goog.exportProperty(shaka.cast.CastReceiver.prototype,"setContentImage",shaka.cast.CastReceiver.prototype.setContentImage);goog.exportProperty(shaka.cast.CastReceiver.prototype,"setContentTitle",shaka.cast.CastReceiver.prototype.setContentTitle);
|
|
1360
1368
|
goog.exportProperty(shaka.cast.CastReceiver.prototype,"clearContentMetadata",shaka.cast.CastReceiver.prototype.clearContentMetadata);goog.exportProperty(shaka.cast.CastReceiver.prototype,"setContentMetadata",shaka.cast.CastReceiver.prototype.setContentMetadata);goog.exportProperty(shaka.cast.CastReceiver.prototype,"isIdle",shaka.cast.CastReceiver.prototype.isIdle);goog.exportProperty(shaka.cast.CastReceiver.prototype,"isConnected",shaka.cast.CastReceiver.prototype.isConnected);
|
|
1361
|
-
shaka.cast.CastReceiver.POLL_INTERVAL=.5;shaka.cast.CastReceiver.IDLE_INTERVAL=5;shaka.cast.CastReceiver.PLAY_STATE={IDLE:"IDLE",PLAYING:"PLAYING",BUFFERING:"BUFFERING",PAUSED:"PAUSED"};shaka.
|
|
1362
|
-
shaka.util.XmlUtils.getChildren=function(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})};shaka.util.XmlUtils.findChildrenNS=function(a,b,c){var d=[];a=$jscomp.makeIterator(a.childNodes);for(var e=a.next();!e.done;e=a.next())e=e.value,e instanceof Element&&e.localName==c&&e.namespaceURI==b&&d.push(e);return d};shaka.util.XmlUtils.getAttributeNS=function(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null};
|
|
1363
|
-
shaka.util.XmlUtils.getAttributeNSList=function(a,b,c){b=$jscomp.makeIterator(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,a.hasAttributeNS(d,c))return a.getAttributeNS(d,c);return null};shaka.util.XmlUtils.getContents=function(a){var b=shaka.util.XmlUtils;return Array.from(a.childNodes).every(b.isText)?a.textContent.trim():null};shaka.util.XmlUtils.isText=function(a){return a.nodeType==Node.TEXT_NODE||a.nodeType==Node.CDATA_SECTION_NODE};
|
|
1364
|
-
shaka.util.XmlUtils.parseAttr=function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e};shaka.util.XmlUtils.parseDate=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3};
|
|
1365
|
-
shaka.util.XmlUtils.parseDuration=function(a){if(!a)return null;var b=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$").exec(a);if(!b)return shaka.log.warning("Invalid duration string:",a),null;a=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null};
|
|
1366
|
-
shaka.util.XmlUtils.parseRange=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null};shaka.util.XmlUtils.parseInt=function(a){a=Number(a);return 0===a%1?a:null};shaka.util.XmlUtils.parsePositiveInt=function(a){a=Number(a);return 0===a%1&&0<a?a:null};shaka.util.XmlUtils.parseNonNegativeInt=function(a){a=Number(a);return 0===a%1&&0<=a?a:null};
|
|
1367
|
-
shaka.util.XmlUtils.parseFloat=function(a){a=Number(a);return isNaN(a)?null:a};shaka.util.XmlUtils.evalDivision=function(a){var b;var c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c};
|
|
1368
|
-
shaka.util.XmlUtils.parseXmlString=function(a,b){var c=new DOMParser,d=null;try{d=c.parseFromString(a,"text/xml")}catch(f){return shaka.log.error("XML parsing exception:",f),null}goog.asserts.assert(d,"Parsed XML document cannot be null!");c=d.documentElement;if(!c)return shaka.log.error("XML document was empty!"),null;var e=c.getElementsByTagName("parsererror");return e.length?(shaka.log.error("XML parser error found:",e[0]),null):d.documentElement.tagName!=b?(shaka.log.error('XML tag name does not match expected "'+
|
|
1369
|
-
b+'":',d.documentElement.tagName),null):c};shaka.util.XmlUtils.parseXml=function(a,b){try{var c=shaka.util.StringUtils.fromUTF8(a);return shaka.util.XmlUtils.parseXmlString(c,b)}catch(d){return shaka.log.error("parseXmlString threw!",d),null}};shaka.dash={};shaka.dash.ContentProtection=function(){};
|
|
1369
|
+
shaka.cast.CastReceiver.POLL_INTERVAL=.5;shaka.cast.CastReceiver.IDLE_INTERVAL=5;shaka.cast.CastReceiver.PLAY_STATE={IDLE:"IDLE",PLAYING:"PLAYING",BUFFERING:"BUFFERING",PAUSED:"PAUSED"};shaka.dash={};shaka.dash.ContentProtection=function(){};
|
|
1370
1370
|
shaka.dash.ContentProtection.parseFromAdaptationSet=function(a,b,c){var d=shaka.dash.ContentProtection,e=shaka.util.ManifestParserUtils,f=d.parseElements_(a),g=null;a=[];var h=[],k=new Set(f.map(function(l){return l.keyId}));k["delete"](null);if(1<k.size)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS);b||(h=f.filter(function(l){return l.schemeUri==d.MP4Protection_?(goog.asserts.assert(!l.init||l.init.length,
|
|
1371
1371
|
"Init data must be null or non-empty."),g=l.init||g,!1):!0}),h.length&&(a=d.convertElements_(g,h,c,k),0==a.length&&(a=[e.createDrmInfo("",g)])));if(f.length&&(b||!h.length))for(a=[],b=$jscomp.makeIterator(Object.values(c)),c=b.next();!c.done;c=b.next())c=c.value,"org.w3.clearkey"!=c&&(c=e.createDrmInfo(c,g),a.push(c));if(e=Array.from(k)[0]||null)for(k=$jscomp.makeIterator(a),b=k.next();!b.done;b=k.next())for(b=$jscomp.makeIterator(b.value.initData),c=b.next();!c.done;c=b.next())c.value.keyId=e;return{defaultKeyId:e,
|
|
1372
1372
|
defaultInit:g,drmInfos:a,firstRepresentation:!0}};
|
|
@@ -1506,8 +1506,8 @@ e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}}};shaka.util.PeriodCo
|
|
|
1506
1506
|
shaka.util.PeriodCombiner.findBestMatchInPeriod_=function(a,b){for(var c={audio:shaka.util.PeriodCombiner.areAVStreamsCompatible_,video:shaka.util.PeriodCombiner.areAVStreamsCompatible_,text:shaka.util.PeriodCombiner.areTextStreamsCompatible_,image:shaka.util.PeriodCombiner.areImageStreamsCompatible_}[b.type],d={audio:shaka.util.PeriodCombiner.isAudioStreamBetterMatch_,video:shaka.util.PeriodCombiner.isVideoStreamBetterMatch_,text:shaka.util.PeriodCombiner.isTextStreamBetterMatch_,image:shaka.util.PeriodCombiner.isImageStreamBetterMatch_}[b.type],
|
|
1507
1507
|
e=null,f=$jscomp.makeIterator(a),g=f.next();!g.done;g=f.next())g=g.value,!c(b,g)||e&&!d(b,e,g)||(e=g);return e};shaka.util.PeriodCombiner.areAVStreamsCompatible_=function(a,b){return b.mimeType!=a.mimeType||shaka.util.MimeUtils.getNormalizedCodec(b.codecs)!=shaka.util.MimeUtils.getNormalizedCodec(a.codecs)||a.drmInfos&&!shaka.media.DrmEngine.areDrmCompatible(a.drmInfos,b.drmInfos)?!1:!0};
|
|
1508
1508
|
shaka.util.PeriodCombiner.areTextStreamsCompatible_=function(a,b){return a.language?b.language?0==shaka.util.LanguageUtils.relatedness(a.language,b.language)||b.kind!=a.kind?!1:!0:!0:!1};shaka.util.PeriodCombiner.areImageStreamsCompatible_=function(a,b){return a.tilesLayout?!0:!1};
|
|
1509
|
-
shaka.util.PeriodCombiner.isAudioStreamBetterMatch_=function(a,b,c){var d=shaka.util.LanguageUtils,e=shaka.util.PeriodCombiner.BetterOrWorse,f=e.BETTER;e=e.WORSE;if(a.id==c.id)return!0;var g=d.relatedness(a.language,b.language);d=d.relatedness(a.language,c.language);if(d>g)return!0;if(d<g)return!1;if(
|
|
1510
|
-
|
|
1509
|
+
shaka.util.PeriodCombiner.isAudioStreamBetterMatch_=function(a,b,c){var d=shaka.util.LanguageUtils,e=shaka.util.PeriodCombiner.BetterOrWorse,f=e.BETTER;e=e.WORSE;if(a.id==c.id)return!0;var g=d.relatedness(a.language,b.language);d=d.relatedness(a.language,c.language);if(d>g)return!0;if(d<g)return!1;if(a.roles.length)return f=b.roles.filter(function(h){return a.roles.includes(h)}),e=c.roles.filter(function(h){return a.roles.includes(h)}),e.length>f.length?!0:e.length<f.length?!1:c.roles.length<b.roles.length;
|
|
1510
|
+
if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=shaka.util.PeriodCombiner.compareClosestPreferLower(a.channelsCount,b.channelsCount,c.channelsCount);if(d==f)return!0;if(d==e)return!1;d=shaka.util.PeriodCombiner.compareClosestPreferLower(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==f?!0:d==e?!1:a.bandwidth&&shaka.util.PeriodCombiner.compareClosestPreferMinimalAbsDiff_(a.bandwidth,
|
|
1511
1511
|
b.bandwidth,c.bandwidth)==f?!0:!1};
|
|
1512
1512
|
shaka.util.PeriodCombiner.isVideoStreamBetterMatch_=function(a,b,c){var d=shaka.util.PeriodCombiner.BetterOrWorse,e=d.BETTER;d=d.WORSE;if(a.id==c.id)return!0;var f=shaka.util.PeriodCombiner.compareClosestPreferLower(a.width*a.height,b.width*b.height,c.width*c.height);if(f==e)return!0;if(f==d)return!1;if(a.frameRate){f=shaka.util.PeriodCombiner.compareClosestPreferLower(a.frameRate,b.frameRate,c.frameRate);if(f==e)return!0;if(f==d)return!1}return a.bandwidth&&shaka.util.PeriodCombiner.compareClosestPreferMinimalAbsDiff_(a.bandwidth,b.bandwidth,
|
|
1513
1513
|
c.bandwidth)==e?!0:!1};
|
|
@@ -1680,9 +1680,9 @@ c=b.next();!c.done;c=b.next())for(e=c.value,c=e.syncTime,e=$jscomp.makeIterator(
|
|
|
1680
1680
|
shaka.hls.HlsParser.prototype.variableSubstitution_=function(a,b){var c=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}"),d=c.match(/{\$\w*}/g);if(d){d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=e.slice(2,e.length-1),g=b.get(f);if(g)c=c.replace(e,g);else throw shaka.log.error("A variable has been found that is not declared",f),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_VARIABLE_NOT_FOUND,
|
|
1681
1681
|
f);}}return c};
|
|
1682
1682
|
shaka.hls.HlsParser.prototype.guessMimeType_=function(a,b,c,d){var e=this,f,g,h,k,l,m,n,p,q,r,u,v,t;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){if(1==x.nextAddress){f=shaka.hls.HlsParser;g=shaka.util.ManifestParserUtils.ContentType;h=shaka.net.NetworkingEngine.RequestType.SEGMENT;goog.asserts.assert(c.segments.length,"Playlist should have segments!");k=Math.trunc((c.segments.length-1)/2);l=e.variableSubstitution_(c.segments[k].absoluteUri,d);m=new goog.Uri(l);n=m.getPath().split(".").pop();p=
|
|
1683
|
-
f.EXTENSION_MAP_BY_CONTENT_TYPE_[a];if(q=p[n])return x["return"](q);if(a==g.TEXT){if("vtt"==b||"wvtt"==b)return x["return"]("text/vtt");if(b&&""!==b)return x["return"]("application/mp4")}if(a==g.IMAGE&&(!b||"jpeg"==b))return x["return"]("image/jpeg");r=shaka.net.NetworkingEngine.makeRequest([l],e.config_.retryParameters);r.method="HEAD";return x.yield(e.makeNetworkRequest_(r,h),2)}u=x.yieldResult;v=u.headers["content-type"];if(!v){if(a==g.TEXT)return x["return"]("text/vtt");
|
|
1684
|
-
shaka.hls.HlsParser.prototype.getRequiredTag_=function(a,b){var c=shaka.hls.Utils.getFirstTagWithName(a,b);if(!c)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING,b);return c};
|
|
1685
|
-
shaka.hls.HlsParser.prototype.requestManifest_=function(a){var b=shaka.net.NetworkingEngine.RequestType.MANIFEST;a=shaka.net.NetworkingEngine.makeRequest([a],this.config_.retryParameters);this.playerInterface_.modifyManifestRequest(a,{format:shaka.util.CmcdManager.StreamingFormat.HLS});return this.makeNetworkRequest_(a,b)};
|
|
1683
|
+
f.EXTENSION_MAP_BY_CONTENT_TYPE_[a];if((q=p[n])||(q=f.RAW_FORMATS_TO_MIME_TYPES_[n]))return x["return"](q);if(a==g.TEXT){if("vtt"==b||"wvtt"==b)return x["return"]("text/vtt");if(b&&""!==b)return x["return"]("application/mp4")}if(a==g.IMAGE&&(!b||"jpeg"==b))return x["return"]("image/jpeg");r=shaka.net.NetworkingEngine.makeRequest([l],e.config_.retryParameters);r.method="HEAD";return x.yield(e.makeNetworkRequest_(r,h),2)}u=x.yieldResult;v=u.headers["content-type"];if(!v){if(a==g.TEXT)return x["return"]("text/vtt");
|
|
1684
|
+
t=p.mp4;return x["return"](t)}return x["return"](v.split(";")[0])})};shaka.hls.HlsParser.prototype.getRequiredTag_=function(a,b){var c=shaka.hls.Utils.getFirstTagWithName(a,b);if(!c)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING,b);return c};
|
|
1685
|
+
shaka.hls.HlsParser.prototype.addVideoAttributes_=function(a,b,c,d,e){a&&(a.width=Number(b)||void 0,a.height=Number(c)||void 0,a.frameRate=Number(d)||void 0,a.hdr=e||void 0)};shaka.hls.HlsParser.prototype.requestManifest_=function(a){var b=shaka.net.NetworkingEngine.RequestType.MANIFEST;a=shaka.net.NetworkingEngine.makeRequest([a],this.config_.retryParameters);this.playerInterface_.modifyManifestRequest(a,{format:shaka.util.CmcdManager.StreamingFormat.HLS});return this.makeNetworkRequest_(a,b)};
|
|
1686
1686
|
shaka.hls.HlsParser.prototype.onUpdate_=function(){var a=this,b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress){shaka.log.info("Updating manifest...");goog.asserts.assert(0<a.updatePlaylistDelay_,"We should only call |onUpdate_| when we are suppose to be updating.");if(!a.playerInterface_)return d["return"]();d.setCatchFinallyBlocks(2);return d.yield(a.update(),4)}if(2!=d.nextAddress)return a.isLive_()&&(b=a.updatePlaylistDelay_,a.updatePlaylistTimer_.tickAfter(b)),
|
|
1687
1687
|
d.leaveTryBlock(0);c=d.enterCatchBlock();if(!a.playerInterface_)return d["return"]();goog.asserts.assert(c instanceof shaka.util.Error,"Should only receive a Shaka error");c.severity=shaka.util.Error.Severity.RECOVERABLE;a.playerInterface_.onError(c);a.updatePlaylistTimer_.tickAfter(.1);d.jumpToEnd()})};shaka.hls.HlsParser.prototype.isLive_=function(){return this.presentationType_!=shaka.hls.HlsParser.PresentationType_.VOD};
|
|
1688
1688
|
shaka.hls.HlsParser.prototype.setPresentationType_=function(a){this.presentationType_=a;this.presentationTimeline_&&this.presentationTimeline_.setStatic(!this.isLive_());this.isLive_()||this.updatePlaylistTimer_.stop()};
|
|
@@ -1692,7 +1692,7 @@ shaka.hls.HlsParser.fairplayDrmParser_=function(a,b){if("video/mp2t"==b)throw ne
|
|
|
1692
1692
|
shaka.hls.HlsParser.widevineDrmParser_=function(a){var b=a.getRequiredAttrValue("METHOD"),c=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!c.includes(b))return shaka.log.error("Widevine in HLS is only supported with [",c.join(", "),"], not",b),null;b=a.getRequiredAttrValue("URI");b=shaka.net.DataUriPlugin.parseRaw(b);b=shaka.util.BufferUtils.toUint8(b.data);b=shaka.util.ManifestParserUtils.createDrmInfo("com.widevine.alpha",[{initDataType:"cenc",initData:b}]);if(a=a.getAttributeValue("KEYID"))a=a.toLowerCase(),
|
|
1693
1693
|
goog.asserts.assert(a.startsWith("0x"),"Incorrect KEYID format!"),b.keyIds=new Set([a.substr(2)]);return b};
|
|
1694
1694
|
shaka.hls.HlsParser.playreadyDrmParser_=function(a){var b=a.getRequiredAttrValue("METHOD"),c=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!c.includes(b))return shaka.log.error("PlayReady in HLS is only supported with [",c.join(", "),"], not",b),null;a=a.getRequiredAttrValue("URI");a=shaka.net.DataUriPlugin.parseRaw(a);a=shaka.util.BufferUtils.toUint8(a.data);b=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);c=new Set;a=shaka.util.Pssh.createPssh(a,b,c,0);return shaka.util.ManifestParserUtils.createDrmInfo("com.microsoft.playready",
|
|
1695
|
-
[{initDataType:"cenc",initData:a}])};goog.exportSymbol("shaka.hls.HlsParser",shaka.hls.HlsParser);shaka.hls.HlsParser.
|
|
1695
|
+
[{initDataType:"cenc",initData:a}])};goog.exportSymbol("shaka.hls.HlsParser",shaka.hls.HlsParser);shaka.hls.HlsParser.RAW_FORMATS_TO_MIME_TYPES_={aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"};shaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_={mp4:"audio/mp4",mp4a:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",m4f:"audio/mp4",cmfa:"audio/mp4",ts:"video/mp2t"};
|
|
1696
1696
|
shaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_={mp4:"video/mp4",mp4v:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",m4f:"video/mp4",cmfv:"video/mp4",ts:"video/mp2t"};shaka.hls.HlsParser.TEXT_EXTENSIONS_TO_MIME_TYPES_={mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",m4f:"application/mp4",cmft:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"};
|
|
1697
1697
|
shaka.hls.HlsParser.IMAGE_EXTENSIONS_TO_MIME_TYPES_={jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"};shaka.hls.HlsParser.EXTENSION_MAP_BY_CONTENT_TYPE_={audio:shaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_,video:shaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_,text:shaka.hls.HlsParser.TEXT_EXTENSIONS_TO_MIME_TYPES_,image:shaka.hls.HlsParser.IMAGE_EXTENSIONS_TO_MIME_TYPES_};
|
|
1698
1698
|
shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_={"com.apple.streamingkeydelivery":shaka.hls.HlsParser.fairplayDrmParser_,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":shaka.hls.HlsParser.widevineDrmParser_,"com.microsoft.playready":shaka.hls.HlsParser.playreadyDrmParser_};shaka.hls.HlsParser.PresentationType_={VOD:"VOD",EVENT:"EVENT",LIVE:"LIVE"};
|
|
@@ -1763,8 +1763,9 @@ duration:a.duration,expiration:null==a.expiration?Infinity:a.expiration,original
|
|
|
1763
1763
|
shaka.offline.indexeddb.V2StorageCell.prototype.convertStream_=function(a,b,c){var d=this;return{id:a.id,originalId:a.originalId,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:a.pixelAspectRatio,hdr:void 0,kind:a.kind,language:a.language,label:a.label,width:a.width,height:a.height,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(function(e){return d.convertSegment_(e,a.initSegmentKey,b,c,a.presentationTimeOffset)}),
|
|
1764
1764
|
variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0}};shaka.offline.indexeddb.V2StorageCell.prototype.convertSegment_=function(a,b,c,d,e){return{startTime:c+a.startTime,endTime:c+a.endTime,initSegmentKey:b,appendWindowStart:c,appendWindowEnd:d,timestampOffset:c-e,dataKey:a.dataKey,tilesLayout:""}};shaka.offline.indexeddb.V5StorageCell=function(){shaka.offline.indexeddb.BaseStorageCell.apply(this,arguments)};$jscomp.inherits(shaka.offline.indexeddb.V5StorageCell,shaka.offline.indexeddb.BaseStorageCell);shaka.offline.indexeddb.V5StorageCell.prototype.hasFixedKeySpace=function(){return!1};shaka.offline.indexeddb.V5StorageCell.prototype.addSegments=function(a){return this.add(this.segmentStore_,a)};
|
|
1765
1765
|
shaka.offline.indexeddb.V5StorageCell.prototype.addManifests=function(a){return this.add(this.manifestStore_,a)};shaka.offline.indexeddb.V5StorageCell.prototype.updateManifest=function(a,b){return this.updateManifestImplementation(a,b)};shaka.offline.indexeddb.V5StorageCell.prototype.convertManifest=function(a){null==a.expiration&&(a.expiration=Infinity);return Promise.resolve(a)};shaka.offline.indexeddb.StorageMechanism=function(){this.sessions_=this.v5_=this.v3_=this.v2_=this.v1_=this.db_=null};
|
|
1766
|
-
shaka.offline.indexeddb.StorageMechanism.prototype.init=function(){var a=this,b=shaka.offline.indexeddb.StorageMechanism.DB_NAME,c=shaka.offline.indexeddb.StorageMechanism.VERSION,d=new shaka.util.PublicPromise,e=
|
|
1767
|
-
a.sessions_=shaka.offline.indexeddb.StorageMechanism.createEmeSessionCell_(f)
|
|
1766
|
+
shaka.offline.indexeddb.StorageMechanism.prototype.init=function(){var a=this,b=shaka.offline.indexeddb.StorageMechanism.DB_NAME,c=shaka.offline.indexeddb.StorageMechanism.VERSION,d=new shaka.util.PublicPromise,e=!1,f=new shaka.util.Timer(function(){e=!0;d.reject(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.INDEXED_DB_INIT_TIMED_OUT))});f.tickAfter(2);var g=window.indexedDB.open(b,c);g.onsuccess=function(h){e||(h=g.result,a.db_=h,
|
|
1767
|
+
a.v1_=shaka.offline.indexeddb.StorageMechanism.createV1_(h),a.v2_=shaka.offline.indexeddb.StorageMechanism.createV2_(h),a.v3_=shaka.offline.indexeddb.StorageMechanism.createV3_(h),a.v5_=shaka.offline.indexeddb.StorageMechanism.createV5_(h),a.sessions_=shaka.offline.indexeddb.StorageMechanism.createEmeSessionCell_(h),f.stop(),d.resolve())};g.onupgradeneeded=function(h){a.createStores_(g.result)};g.onerror=function(h){e||(d.reject(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,
|
|
1768
|
+
shaka.util.Error.Code.INDEXED_DB_ERROR,g.error)),f.stop(),h.preventDefault())};return d};
|
|
1768
1769
|
shaka.offline.indexeddb.StorageMechanism.prototype.destroy=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){switch(b.nextAddress){case 1:if(!a.v1_){b.jumpTo(2);break}return b.yield(a.v1_.destroy(),2);case 2:if(!a.v2_){b.jumpTo(4);break}return b.yield(a.v2_.destroy(),4);case 4:if(!a.v3_){b.jumpTo(6);break}return b.yield(a.v3_.destroy(),6);case 6:if(!a.v5_){b.jumpTo(8);break}return b.yield(a.v5_.destroy(),8);case 8:if(!a.sessions_){b.jumpTo(10);break}return b.yield(a.sessions_.destroy(),
|
|
1769
1770
|
10);case 10:a.db_&&a.db_.close(),b.jumpToEnd()}})};shaka.offline.indexeddb.StorageMechanism.prototype.getCells=function(){var a=new Map;this.v1_&&a.set("v1",this.v1_);this.v2_&&a.set("v2",this.v2_);this.v3_&&a.set("v3",this.v3_);this.v5_&&a.set("v5",this.v5_);return a};shaka.offline.indexeddb.StorageMechanism.prototype.getEmeSessionCell=function(){goog.asserts.assert(this.sessions_,"Cannot be destroyed.");return this.sessions_};
|
|
1770
1771
|
shaka.offline.indexeddb.StorageMechanism.prototype.erase=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){switch(b.nextAddress){case 1:if(!a.v1_){b.jumpTo(2);break}return b.yield(a.v1_.destroy(),2);case 2:if(!a.v2_){b.jumpTo(4);break}return b.yield(a.v2_.destroy(),4);case 4:if(!a.v3_){b.jumpTo(6);break}return b.yield(a.v3_.destroy(),6);case 6:if(!a.v5_){b.jumpTo(8);break}return b.yield(a.v5_.destroy(),8);case 8:return a.db_&&a.db_.close(),b.yield(shaka.offline.indexeddb.StorageMechanism.deleteAll_(),
|
|
@@ -1872,8 +1873,8 @@ shaka.polyfill.Aria.addARIAMixinAttribute_=function(a){var b="aria-"+a.toLowerCa
|
|
|
1872
1873
|
shaka.polyfill.Fullscreen.install=function(){if(window.Document){var a=Element.prototype;a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||a.webkitRequestFullscreen;a=Document.prototype;a.exitFullscreen=a.exitFullscreen||a.mozCancelFullScreen||a.msExitFullscreen||a.webkitCancelFullScreen;"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||
|
|
1873
1874
|
document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));a=shaka.polyfill.Fullscreen.proxyEvent_;document.addEventListener("webkitfullscreenchange",a);document.addEventListener("webkitfullscreenerror",a);document.addEventListener("mozfullscreenchange",a);document.addEventListener("mozfullscreenerror",a);document.addEventListener("MSFullscreenChange",
|
|
1874
1875
|
a);document.addEventListener("MSFullscreenError",a)}};shaka.polyfill.Fullscreen.proxyEvent_=function(a){var b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),c=document.createEvent("Event");c.initEvent(b,a.bubbles,a.cancelable);a.target.dispatchEvent(c)};goog.exportProperty(shaka.polyfill,"Fullscreen",shaka.polyfill.Fullscreen);goog.exportProperty(shaka.polyfill.Fullscreen,"install",shaka.polyfill.Fullscreen.install);shaka.polyfill.register(shaka.polyfill.Fullscreen.install);shaka.polyfill.MediaCapabilities=function(){};
|
|
1875
|
-
shaka.polyfill.MediaCapabilities.install=function(){var a=!0;if(shaka.util.Platform.isApple()||shaka.util.Platform.isPS5()||shaka.util.Platform.isPS4()||shaka.util.Platform.isWebOS()||shaka.util.Platform.isTizen()||shaka.util.Platform.isChromecast()
|
|
1876
|
-
|
|
1876
|
+
shaka.polyfill.MediaCapabilities.install=function(){var a=!0;if(shaka.util.Platform.isApple()||shaka.util.Platform.isPS5()||shaka.util.Platform.isPS4()||shaka.util.Platform.isWebOS()||shaka.util.Platform.isTizen()||shaka.util.Platform.isChromecast()||shaka.util.Platform.isEOS())a=!1;a&&navigator.mediaCapabilities?shaka.log.info("MediaCapabilities: Native mediaCapabilities support found."):(shaka.log.info("MediaCapabilities: install"),navigator.mediaCapabilities||(navigator.mediaCapabilities={}),shaka.polyfill.MediaCapabilities.originalMcap=
|
|
1877
|
+
navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=shaka.polyfill.MediaCapabilities.decodingInfo_)};
|
|
1877
1878
|
shaka.polyfill.MediaCapabilities.decodingInfo_=function(a){var b,c,d,e,f,g,h,k,l,m,n,p,q,r,u,v;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){switch(t.nextAddress){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};if(!a)return t["return"](b);if("media-source"==a.type){if(!shaka.util.Platform.supportsMediaSource()||a.video&&(c=a.video.contentType,d=MediaSource.isTypeSupported(c),!d)||a.audio&&(e=a.audio.contentType,f=MediaSource.isTypeSupported(e),
|
|
1878
1879
|
!f))return t["return"](b)}else if("file"==a.type){if(a.video&&(g=a.video.contentType,h=shaka.util.Platform.supportsMediaType(g),!h)||a.audio&&(k=a.audio.contentType,l=shaka.util.Platform.supportsMediaType(k),!l))return t["return"](b)}else return t["return"](b);if(!a.keySystemConfiguration)return b.supported=!0,t["return"](Promise.resolve(b));m=a.keySystemConfiguration;n=[];p=[];m.audio&&(q={robustness:m.audio.robustness||"",contentType:a.audio.contentType},n.push(q));m.video&&(r={robustness:m.video.robustness||
|
|
1879
1880
|
"",contentType:a.video.contentType},p.push(r));u={initDataTypes:[m.initDataType],distinctiveIdentifier:m.distinctiveIdentifier,persistentState:m.persistentState,sessionTypes:m.sessionTypes};n.length&&(u.audioCapabilities=n);p.length&&(u.videoCapabilities=p);t.setCatchFinallyBlocks(3);return t.yield(navigator.requestMediaKeySystemAccess(m.keySystem,[u]),5);case 5:v=t.yieldResult;t.leaveTryBlock(4);break;case 3:t.enterCatchBlock(),shaka.log.info("navigator.requestMediaKeySystemAccess failed.");case 4:v&&
|
|
@@ -1972,11 +1973,10 @@ shaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_=function(){try{return!!shaka.poly
|
|
|
1972
1973
|
shaka.text.LrcTextParser.prototype.parseMedia=function(a,b){var c=shaka.text.LrcTextParser,d=null,e=[],f=shaka.util.StringUtils.fromUTF8(a).split(/\r?\n/);f=$jscomp.makeIterator(f);for(var g=f.next();!g.done;g=f.next()){var h=g.value;h&&!/^\s+$/.test(h)&&((g=c.lyricLine_.exec(h))?(h=c.parseTime_(g[1]),g=new shaka.text.Cue(h,b.segmentEnd?b.segmentEnd:h+2,g[2]),d&&(d.endTime=h,e.push(d)),d=g):shaka.log.warning("LrcTextParser encountered an unknown line.",h))}d&&e.push(d);return e};
|
|
1973
1974
|
shaka.text.LrcTextParser.parseTime_=function(a){var b=shaka.text.LrcTextParser.timeFormat_.exec(a);a=parseInt(b[1],10);b=parseFloat(b[2].replace(",","."));return 60*a+b};goog.exportSymbol("shaka.text.LrcTextParser",shaka.text.LrcTextParser);goog.exportProperty(shaka.text.LrcTextParser.prototype,"parseMedia",shaka.text.LrcTextParser.prototype.parseMedia);goog.exportProperty(shaka.text.LrcTextParser.prototype,"setSequenceMode",shaka.text.LrcTextParser.prototype.setSequenceMode);
|
|
1974
1975
|
goog.exportProperty(shaka.text.LrcTextParser.prototype,"parseInit",shaka.text.LrcTextParser.prototype.parseInit);shaka.text.LrcTextParser.lyricLine_=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/;shaka.text.LrcTextParser.timeFormat_=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;shaka.text.TextEngine.registerParser("application/x-subtitle-lrc",function(){return new shaka.text.LrcTextParser});shaka.text.TtmlTextParser=function(){};shaka.text.TtmlTextParser.prototype.parseInit=function(a){goog.asserts.assert(!1,"TTML does not have init segments")};shaka.text.TtmlTextParser.prototype.setSequenceMode=function(a){};
|
|
1975
|
-
shaka.text.TtmlTextParser.prototype.parseMedia=function(a,b){var c=shaka.text.TtmlTextParser,d=shaka.util.XmlUtils,e=c.parameterNs_,f=c.styleNs_,g=shaka.util.StringUtils.fromUTF8(a),h=[]
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_CUE,"<span> can only be inside <p> in TTML");if(c=c.parseCue_(l,b.periodStart,k,n,p,g,q,f,m,null,!1))c.backgroundColor||(c.backgroundColor="transparent"),h.push(c)}return h};
|
|
1976
|
+
shaka.text.TtmlTextParser.prototype.parseMedia=function(a,b){var c=shaka.text.TtmlTextParser,d=shaka.util.XmlUtils,e=c.parameterNs_,f=c.styleNs_,g=shaka.util.StringUtils.fromUTF8(a),h=[];if(""==g)return h;var k=d.parseXmlString(g,"tt");if(!k)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_XML,"Failed to parse TTML.");g=k.getElementsByTagName("body")[0];if(!g)return[];var l=d.getAttributeNSList(k,e,"frameRate"),m=d.getAttributeNSList(k,
|
|
1977
|
+
e,"subFrameRate"),n=d.getAttributeNSList(k,e,"frameRateMultiplier"),p=d.getAttributeNSList(k,e,"tickRate"),q=d.getAttributeNSList(k,e,"cellResolution"),r=k.getAttribute("xml:space")||"default";e=d.getAttributeNSList(k,f,"extent");if("default"!=r&&"preserve"!=r)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_XML,"Invalid xml:space value: "+r);f="default"==r;l=new c.RateInfo_(l,m,n,p);m=c.getCellResolution_(q);n=(n=k.getElementsByTagName("metadata")[0])?
|
|
1978
|
+
d.getChildren(n):[];p=Array.from(k.getElementsByTagName("style"));k=Array.from(k.getElementsByTagName("region"));q=[];r=$jscomp.makeIterator(k);for(var u=r.next();!u.done;u=r.next())(u=c.parseCueRegion_(u.value,p,e))&&q.push(u);if(d.findChildren(g,"p").length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_CUE,"<p> can only be inside <div> in TTML");e=$jscomp.makeIterator(d.findChildren(g,"div"));for(r=e.next();!r.done;r=
|
|
1979
|
+
e.next())if(d.findChildren(r.value,"span").length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_CUE,"<span> can only be inside <p> in TTML");if(c=c.parseCue_(g,b.periodStart,l,n,p,k,q,f,m,null,!1))c.backgroundColor||(c.backgroundColor="transparent"),h.push(c);return h};
|
|
1980
1980
|
shaka.text.TtmlTextParser.parseCue_=function(a,b,c,d,e,f,g,h,k,l,m){var n=a.parentNode;if(a.nodeType==Node.COMMENT_NODE)return null;if(a.nodeType==Node.TEXT_NODE){if(!m)return null;var p=document.createElement("span");p.textContent=a.textContent}else goog.asserts.assert(a.nodeType==Node.ELEMENT_NODE,"nodeType should be ELEMENT_NODE!"),p=a;goog.asserts.assert(p,"cueElement should be non-null!");for(var q=null,r=$jscomp.makeIterator(shaka.text.TtmlTextParser.smpteNsList_),u=r.next();!u.done&&!(q=shaka.text.TtmlTextParser.getElementsFromCollection_(p,
|
|
1981
1981
|
"backgroundImage",d,"#",u.value)[0]);u=r.next());r=m;if("p"==a.nodeName||q)m=!0;h="default"==(p.getAttribute("xml:space")||(h?"default":"preserve"));u=Array.from(p.childNodes).every(function(y){return y.nodeType==Node.TEXT_NODE});a=[];if(!u)for(var v=$jscomp.makeIterator(p.childNodes),t=v.next();!t.done;t=v.next())(t=shaka.text.TtmlTextParser.parseCue_(t.value,b,c,d,e,f,g,h,k,p,m))&&a.push(t);d=null!=l;v=/\S/.test(p.textContent);var x=p.hasAttribute("begin")||p.hasAttribute("end")||p.hasAttribute("dur");
|
|
1982
1982
|
if(!(x||v||"br"==p.tagName||0!=a.length||d&&!h))return null;t=shaka.text.TtmlTextParser.parseTime_(p,c);v=t.start;for(t=t.end;n&&n.nodeType==Node.ELEMENT_NODE&&"tt"!=n.tagName;)t=shaka.text.TtmlTextParser.resolveTime_(n,c,v,t),v=t.start,t=t.end,n=n.parentNode;null==v&&(v=0);v+=b;t=null==t?Infinity:t+b;if(!x&&0<a.length)for(v=Infinity,t=0,b=$jscomp.makeIterator(a),c=b.next();!c.done;c=b.next())c=c.value,v=Math.min(v,c.startTime),t=Math.max(t,c.endTime);if("br"==p.tagName)return e=new shaka.text.Cue(v,
|
|
@@ -2014,7 +2014,7 @@ shaka.text.Mp4TtmlParser.prototype.parseMedia=function(a,b){var c=this,d=shaka.u
|
|
|
2014
2014
|
goog.exportProperty(shaka.text.Mp4TtmlParser.prototype,"setSequenceMode",shaka.text.Mp4TtmlParser.prototype.setSequenceMode);goog.exportProperty(shaka.text.Mp4TtmlParser.prototype,"parseInit",shaka.text.Mp4TtmlParser.prototype.parseInit);shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml"',function(){return new shaka.text.Mp4TtmlParser});
|
|
2015
2015
|
shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml.im1t"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.TTML.im1t"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.VttTextParser=function(){this.sequenceMode_=!1};shaka.text.VttTextParser.prototype.parseInit=function(a){goog.asserts.assert(!1,"VTT does not have init segments")};shaka.text.VttTextParser.prototype.setSequenceMode=function(a){this.sequenceMode_=a};
|
|
2016
2016
|
shaka.text.VttTextParser.prototype.parseMedia=function(a,b){var c=shaka.text.VttTextParser,d=shaka.util.StringUtils.fromUTF8(a);d=d.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");d=d.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_HEADER);var e=b.vttOffset;if(d[0].includes("X-TIMESTAMP-MAP")&&this.sequenceMode_){var f=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),
|
|
2017
|
-
g=d[0].match(/MPEGTS:(\d+)/m);if(f&&g){e=new shaka.util.TextParser(f[1]);e=shaka.text.VttTextParser.parseTime_(e);if(null==e)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_HEADER);g=Number(g[1]);f=shaka.text.VttTextParser.MPEG_TIMESCALE_;for(var h=shaka.text.VttTextParser.TS_ROLLOVER_/f,k=b.segmentStart;k>=h;)k-=h,g+=shaka.text.VttTextParser.TS_ROLLOVER_;e=b.periodStart+g/f-e}}g=[];f=$jscomp.makeIterator(d[0].split("\n"));
|
|
2017
|
+
g=d[0].match(/MPEGTS:(\d+)/m);if(f&&g){e=new shaka.util.TextParser(f[1]);e=shaka.text.VttTextParser.parseTime_(e);if(null==e)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_HEADER);g=Number(g[1]);f=shaka.text.VttTextParser.MPEG_TIMESCALE_;for(var h=shaka.text.VttTextParser.TS_ROLLOVER_/f,k=b.segmentStart-b.periodStart;k>=h;)k-=h,g+=shaka.text.VttTextParser.TS_ROLLOVER_;e=b.periodStart+g/f-e}}g=[];f=$jscomp.makeIterator(d[0].split("\n"));
|
|
2018
2018
|
for(h=f.next();!h.done;h=f.next())h=h.value,/^Region:/.test(h)&&(h=c.parseRegion_(h),g.push(h));f=new Map;c.addDefaultTextColor_(f);h=[];d=$jscomp.makeIterator(d.slice(1));for(k=d.next();!k.done;k=d.next())k=k.value.split("\n"),c.parseStyle_(k,f),(k=c.parseCue_(k,e,g,f))&&h.push(k);return h};
|
|
2019
2019
|
shaka.text.VttTextParser.addDefaultTextColor_=function(a){for(var b=$jscomp.makeIterator(Object.entries(shaka.text.Cue.defaultTextColor)),c=b.next();!c.done;c=b.next()){var d=$jscomp.makeIterator(c.value);c=d.next().value;d=d.next().value;var e=new shaka.text.Cue(0,0,"");e.color=d;a.set(c,e)}b=$jscomp.makeIterator(Object.entries(shaka.text.Cue.defaultTextBackgroundColor));for(c=b.next();!c.done;c=b.next())d=$jscomp.makeIterator(c.value),c=d.next().value,d=d.next().value,e=new shaka.text.Cue(0,0,""),
|
|
2020
2020
|
e.backgroundColor=d,a.set(c,e)};shaka.text.VttTextParser.parseRegion_=function(a){var b=shaka.text.VttTextParser;a=new shaka.util.TextParser(a);var c=new shaka.text.CueRegion;a.readWord();a.skipWhitespace();for(var d=a.readWord();d;)b.parseRegionSetting_(c,d)||shaka.log.warning("VTT parser encountered an invalid VTTRegion setting: ",d," The setting will be ignored."),a.skipWhitespace(),d=a.readWord();return c};
|