shaka-player 4.11.15 → 4.11.16
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 +2 -2
- package/dist/locales.js +32 -32
- package/dist/shaka-player.compiled.debug.js +40 -39
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +1137 -1137
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +48 -46
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +1316 -1316
- package/dist/shaka-player.ui.map +2 -2
- package/lib/media/drm_engine.js +23 -6
- package/lib/player.js +4 -4
- package/lib/util/functional.js +27 -0
- package/lib/util/stream_utils.js +8 -1
- package/package.json +1 -1
- package/ui/ad_position.js +2 -2
- package/ui/controls.js +5 -3
- package/ui/play_button.js +5 -3
- package/ui/presentation_time.js +1 -1
package/dist/deps.js
CHANGED
|
@@ -72,7 +72,7 @@ goog.addDependency('../../../../lib/media/adaptation_set_criteria.js', ['shaka.m
|
|
|
72
72
|
goog.addDependency('../../../../lib/media/buffering_observer.js', ['shaka.media.BufferingObserver'], [], {'lang': 'es6'});
|
|
73
73
|
goog.addDependency('../../../../lib/media/closed_caption_parser.js', ['shaka.media.ClosedCaptionParser', 'shaka.media.IClosedCaptionParser'], ['shaka.cea.DummyCaptionDecoder', 'shaka.cea.DummyCeaParser', 'shaka.log', 'shaka.util.BufferUtils'], {'lang': 'es6'});
|
|
74
74
|
goog.addDependency('../../../../lib/media/content_workarounds.js', ['shaka.media.ContentWorkarounds'], ['goog.asserts', 'shaka.log', 'shaka.util.BufferUtils', 'shaka.util.Error', 'shaka.util.Lazy', 'shaka.util.Mp4Parser', 'shaka.util.Platform', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es6'});
|
|
75
|
-
goog.addDependency('../../../../lib/media/drm_engine.js', ['shaka.media.DrmEngine'], ['goog.asserts', 'shaka.log', 'shaka.net.NetworkingEngine', 'shaka.util.BufferUtils', 'shaka.util.Destroyer', 'shaka.util.DrmUtils', 'shaka.util.Error', 'shaka.util.EventManager', 'shaka.util.FakeEvent', 'shaka.util.IDestroyable', 'shaka.util.Iterables', 'shaka.util.ManifestParserUtils', 'shaka.util.MapUtils', 'shaka.util.ObjectUtils', 'shaka.util.Platform', 'shaka.util.Pssh', 'shaka.util.PublicPromise', 'shaka.util.StreamUtils', 'shaka.util.StringUtils', 'shaka.util.TXml', 'shaka.util.Timer', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es8'});
|
|
75
|
+
goog.addDependency('../../../../lib/media/drm_engine.js', ['shaka.media.DrmEngine'], ['goog.asserts', 'shaka.log', 'shaka.net.NetworkingEngine', 'shaka.util.BufferUtils', 'shaka.util.Destroyer', 'shaka.util.DrmUtils', 'shaka.util.Error', 'shaka.util.EventManager', 'shaka.util.FakeEvent', 'shaka.util.Functional', 'shaka.util.IDestroyable', 'shaka.util.Iterables', 'shaka.util.ManifestParserUtils', 'shaka.util.MapUtils', 'shaka.util.ObjectUtils', 'shaka.util.Platform', 'shaka.util.Pssh', 'shaka.util.PublicPromise', 'shaka.util.StreamUtils', 'shaka.util.StringUtils', 'shaka.util.TXml', 'shaka.util.Timer', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es8'});
|
|
76
76
|
goog.addDependency('../../../../lib/media/gap_jumping_controller.js', ['shaka.media.GapJumpingController'], ['shaka.log', 'shaka.media.PresentationTimeline', 'shaka.media.StallDetector', 'shaka.media.TimeRangesUtils', 'shaka.util.EventManager', 'shaka.util.FakeEvent', 'shaka.util.IReleasable', 'shaka.util.Platform', 'shaka.util.Timer'], {'lang': 'es6'});
|
|
77
77
|
goog.addDependency('../../../../lib/media/manifest_filterer.js', ['shaka.media.ManifestFilterer'], ['goog.asserts', 'shaka.media.DrmEngine', 'shaka.util.Error', 'shaka.util.StreamUtils'], {'lang': 'es8'});
|
|
78
78
|
goog.addDependency('../../../../lib/media/manifest_parser.js', ['shaka.media.ManifestParser'], ['shaka.Deprecate', 'shaka.log', 'shaka.util.Error', 'shaka.util.Platform'], {'lang': 'es6'});
|
|
@@ -193,7 +193,7 @@ goog.addDependency('../../../../lib/util/exp_golomb.js', ['shaka.util.ExpGolomb'
|
|
|
193
193
|
goog.addDependency('../../../../lib/util/fairplay_utils.js', ['shaka.util.FairPlayUtils'], ['goog.Uri', 'goog.asserts', 'shaka.net.NetworkingEngine', 'shaka.util.BufferUtils', 'shaka.util.Error', 'shaka.util.StringUtils', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es8'});
|
|
194
194
|
goog.addDependency('../../../../lib/util/fake_event.js', ['shaka.util.FakeEvent'], ['goog.asserts'], {'lang': 'es6'});
|
|
195
195
|
goog.addDependency('../../../../lib/util/fake_event_target.js', ['shaka.util.FakeEventTarget'], ['goog.asserts', 'shaka.log', 'shaka.util.FakeEvent', 'shaka.util.IReleasable', 'shaka.util.MultiMap'], {'lang': 'es6'});
|
|
196
|
-
goog.addDependency('../../../../lib/util/functional.js', ['shaka.util.Functional'], [], {'lang': 'es6'});
|
|
196
|
+
goog.addDependency('../../../../lib/util/functional.js', ['shaka.util.Functional'], ['shaka.util.Timer'], {'lang': 'es6'});
|
|
197
197
|
goog.addDependency('../../../../lib/util/i_destroyable.js', ['shaka.util.IDestroyable'], [], {'lang': 'es6'});
|
|
198
198
|
goog.addDependency('../../../../lib/util/i_releasable.js', ['shaka.util.IReleasable'], [], {'lang': 'es6'});
|
|
199
199
|
goog.addDependency('../../../../lib/util/id3_utils.js', ['shaka.util.Id3Utils'], ['shaka.log', 'shaka.util.BufferUtils', 'shaka.util.StringUtils'], {'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
|
-
PLAY: 'PLAY',
|
|
917
|
-
OFF: 'OFF',
|
|
918
|
-
FULL_SCREEN: 'FULL_SCREEN',
|
|
919
|
-
CAST: 'CAST',
|
|
920
|
-
SURROUND: 'SURROUND',
|
|
915
|
+
FAST_FORWARD: 'FAST_FORWARD',
|
|
921
916
|
STATISTICS: 'STATISTICS',
|
|
922
|
-
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
923
|
-
AD_STATISTICS: 'AD_STATISTICS',
|
|
924
917
|
PAUSE: 'PAUSE',
|
|
925
|
-
LANGUAGE: 'LANGUAGE',
|
|
926
|
-
QUALITY: 'QUALITY',
|
|
927
|
-
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
928
|
-
SEEK: 'SEEK',
|
|
929
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
930
|
-
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
931
918
|
RESOLUTION: 'RESOLUTION',
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
919
|
+
AD_TIME: 'AD_TIME',
|
|
920
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
921
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
922
|
+
CAST: 'CAST',
|
|
936
923
|
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
924
|
+
LOOP: 'LOOP',
|
|
925
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
926
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
927
|
+
BACK: 'BACK',
|
|
928
|
+
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
929
|
+
PLAY: 'PLAY',
|
|
930
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
937
931
|
LIVE: 'LIVE',
|
|
932
|
+
SEEK: 'SEEK',
|
|
933
|
+
REPLAY: 'REPLAY',
|
|
934
|
+
SKIP_AD: 'SKIP_AD',
|
|
938
935
|
AIRPLAY: 'AIRPLAY',
|
|
939
|
-
|
|
936
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
937
|
+
QUALITY: 'QUALITY',
|
|
938
|
+
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
939
|
+
CHAPTERS: 'CHAPTERS',
|
|
940
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
940
941
|
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
941
|
-
|
|
942
|
+
AD_STATISTICS: 'AD_STATISTICS',
|
|
942
943
|
AD_DURATION: 'AD_DURATION',
|
|
943
944
|
CAPTIONS: 'CAPTIONS',
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
LOOP: 'LOOP',
|
|
947
|
-
REPLAY: 'REPLAY',
|
|
945
|
+
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
946
|
+
OFF: 'OFF',
|
|
948
947
|
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
948
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
949
949
|
VOLUME: 'VOLUME',
|
|
950
|
-
|
|
951
|
-
|
|
950
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
951
|
+
LANGUAGE: 'LANGUAGE',
|
|
952
952
|
UNMUTE: 'UNMUTE',
|
|
953
|
+
SURROUND: 'SURROUND',
|
|
954
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
955
|
+
ON: 'ON',
|
|
956
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
953
957
|
RECENTER_VR: 'RECENTER_VR',
|
|
954
958
|
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
955
|
-
|
|
956
|
-
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
957
|
-
SKIP_AD: 'SKIP_AD',
|
|
958
|
-
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
959
|
+
MUTE: 'MUTE',
|
|
959
960
|
REWIND: 'REWIND',
|
|
960
|
-
|
|
961
|
-
AD_TIME: 'AD_TIME',
|
|
961
|
+
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
962
962
|
};
|
|
@@ -336,7 +336,8 @@ shaka.text.TextEngine.prototype.applyVideoTimestampOffsetRecursive_=function(a,b
|
|
|
336
336
|
shaka.text.TextEngine.prototype.storeAndAppendClosedCaptions=function(a,b,c,d){var e=b+" "+c,f=new Map;a=$jscomp.makeIterator(a);for(var g=a.next();!g.done;g=a.next()){var h=g.value;g=h.stream;h=h.cue;f.has(g)||f.set(g,new Map);f.get(g).has(e)||f.get(g).set(e,[]);this.applyVideoTimestampOffsetRecursive_(h,d);h.startTime>=this.appendWindowStart_&&h.startTime<this.appendWindowEnd_&&(f.get(g).get(e).push(h),g==this.selectedClosedCaptionId_&&this.displayer_.append([h]))}d=$jscomp.makeIterator(f.keys());
|
|
337
337
|
for(e=d.next();!e.done;e=d.next())for(e=e.value,this.closedCaptionsMap_.has(e)||this.closedCaptionsMap_.set(e,new Map),a=$jscomp.makeIterator(f.get(e).keys()),g=a.next();!g.done;g=a.next())g=g.value,h=f.get(e).get(g),this.closedCaptionsMap_.get(e).set(g,h);this.bufferStart_=null==this.bufferStart_?Math.max(b,this.appendWindowStart_):Math.min(this.bufferStart_,Math.max(b,this.appendWindowStart_));this.bufferEnd_=Math.max(this.bufferEnd_,Math.min(c,this.appendWindowEnd_))};
|
|
338
338
|
shaka.text.TextEngine.prototype.getNumberOfClosedCaptionChannels=function(){return this.closedCaptionsMap_.size};shaka.text.TextEngine.prototype.getNumberOfClosedCaptionsInChannel=function(a){return(a=this.closedCaptionsMap_.get(a))?a.size:0};goog.exportSymbol("shaka.text.TextEngine",shaka.text.TextEngine);goog.exportProperty(shaka.text.TextEngine.prototype,"destroy",shaka.text.TextEngine.prototype.destroy);goog.exportProperty(shaka.text.TextEngine,"findParser",shaka.text.TextEngine.findParser);
|
|
339
|
-
goog.exportProperty(shaka.text.TextEngine,"unregisterParser",shaka.text.TextEngine.unregisterParser);goog.exportProperty(shaka.text.TextEngine,"registerParser",shaka.text.TextEngine.registerParser);shaka.text.TextEngine.parserMap_={};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};
|
|
339
|
+
goog.exportProperty(shaka.text.TextEngine,"unregisterParser",shaka.text.TextEngine.unregisterParser);goog.exportProperty(shaka.text.TextEngine,"registerParser",shaka.text.TextEngine.registerParser);shaka.text.TextEngine.parserMap_={};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};
|
|
340
|
+
shaka.util.Functional.promiseWithTimeout=function(a,b){return Promise.race([b,new Promise(function(c,d){(new shaka.util.Timer(d)).tickAfter(a)})])};shaka.util.LanguageUtils=function(){};shaka.util.LanguageUtils.areLocaleCompatible=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);return a==b};shaka.util.LanguageUtils.areLanguageCompatible=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);a=c.disassembleLocale_(a);b=c.disassembleLocale_(b);return a[0]==b[0]};
|
|
340
341
|
shaka.util.LanguageUtils.isParentOf=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);a=c.disassembleLocale_(a);b=c.disassembleLocale_(b);return a[0]==b[0]&&1==a.length&&2==b.length};shaka.util.LanguageUtils.isSiblingOf=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);a=c.disassembleLocale_(a);b=c.disassembleLocale_(b);return 2==a.length&&2==b.length&&a[0]==b[0]};
|
|
341
342
|
shaka.util.LanguageUtils.normalize=function(a){var b=shaka.util.LanguageUtils;a=$jscomp.makeIterator(a.split("-x-"));var c=a.next().value;c=void 0===c?"":c;a=a.next().value;a=void 0===a?"":a;var d=$jscomp.makeIterator(c.split("-"));c=d.next().value;c=void 0===c?"":c;d=d.next().value;d=void 0===d?"":d;a=a?"x-"+a:"";c=c.toLowerCase();c=b.isoMap_.get(c)||c;b=d.toUpperCase();return""+(b?c+"-"+b:c)+(a?"-"+a:"")};
|
|
342
343
|
shaka.util.LanguageUtils.areSiblings=function(a,b){var c=shaka.util.LanguageUtils,d=c.getBase(a);c=c.getBase(b);return a!=d&&b!=c&&d==c};shaka.util.LanguageUtils.relatedness=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);return b==a?4:c.isParentOf(b,a)?3:c.isSiblingOf(b,a)?2:c.isParentOf(a,b)?1:0};shaka.util.LanguageUtils.getBase=function(a){var b=shaka.util.LanguageUtils,c=a.indexOf("-");a=0<=c?a.substring(0,c):a;a=a.toLowerCase();return a=b.isoMap_.get(a)||a};
|
|
@@ -373,7 +374,7 @@ shaka.util.StreamUtils.getDecodingInfosForVariant_=function(a,b){var c,d,e,f,g,h
|
|
|
373
374
|
h=g.next();for(k={};!h.done;k={cache:void 0,cacheKey:void 0},h=g.next())l=h.value,k.cacheKey=d.alphabeticalKeyOrderStringify_(l),k.cache=d.decodingConfigCache_,k.cache[k.cacheKey]?(shaka.log.v2("Using cached results of mediaCapabilities.decodingInfo","for key",k.cacheKey),e=c(e,k.cache[k.cacheKey])):f.push(d.checkEachDecodingConfigCombination_(l).then(function(n){return function(p){var q=null;p=$jscomp.makeIterator(p||[]);for(var r=p.next();!r.done;r=p.next())q=c(q,r.value);q&&(n.cache[n.cacheKey]=
|
|
374
375
|
q,e=c(e,q))}}(k)));return m.yield(Promise.all(f),2)}e&&a.decodingInfos.push(e);m.jumpToEnd()})};
|
|
375
376
|
shaka.util.StreamUtils.checkEachDecodingConfigCombination_=function(a){var b=[""];a.video&&(b=shaka.util.MimeUtils.getCodecs(a.video.contentType).split(","));var c=[""];a.audio&&(c=shaka.util.MimeUtils.getCodecs(a.audio.contentType).split(","));var d=[];b=$jscomp.makeIterator(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;for(var f=$jscomp.makeIterator(c),g=f.next(),h={};!g.done;h={copy$jscomp$1:void 0},g=f.next()){g=g.value;h.copy$jscomp$1=shaka.util.ObjectUtils.cloneObject(a);if(a.video){var k=
|
|
376
|
-
shaka.util.MimeUtils.getBasicType(h.copy$jscomp$1.video.contentType);h.copy$jscomp$1.video.contentType=shaka.util.MimeUtils.getFullType(k,e)}a.audio&&(k=shaka.util.MimeUtils.getBasicType(h.copy$jscomp$1.audio.contentType),h.copy$jscomp$1.audio.contentType=shaka.util.MimeUtils.getFullType(k,g));d.push(new Promise(function(l){return function(m,n){navigator.mediaCapabilities.decodingInfo(l.copy$jscomp$1).then(function(p){m(p)}).catch(n)}}(h)))}}return Promise.all(d).catch(function(l){shaka.log.info("MediaCapabilities.decodingInfo() failed.",
|
|
377
|
+
shaka.util.MimeUtils.getBasicType(h.copy$jscomp$1.video.contentType);h.copy$jscomp$1.video.contentType=shaka.util.MimeUtils.getFullType(k,e)}a.audio&&(k=shaka.util.MimeUtils.getBasicType(h.copy$jscomp$1.audio.contentType),h.copy$jscomp$1.audio.contentType=shaka.util.MimeUtils.getFullType(k,g));d.push(new Promise(function(l){return function(m,n){shaka.util.Functional.promiseWithTimeout(1,navigator.mediaCapabilities.decodingInfo(l.copy$jscomp$1)).then(function(p){m(p)}).catch(n)}}(h)))}}return Promise.all(d).catch(function(l){shaka.log.info("MediaCapabilities.decodingInfo() failed.",
|
|
377
378
|
JSON.stringify(a),l);return null})};
|
|
378
379
|
shaka.util.StreamUtils.getDecodingInfosForVariants=function(a,b,c,d){var e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D;return $jscomp.asyncExecutePromiseGeneratorProgram(function(y){switch(y.nextAddress){case 1:if(e=a.some(function(A){return A.decodingInfos.length}))return shaka.log.debug("Already got the variants' decodingInfo."),y.return();f=$jscomp.makeIterator(d);g=f.next();h={};case 2:if(g.done){y.jumpTo(4);break}h.preferredKeySystem=g.value;k=!1;l=$jscomp.makeIterator(a);m=l.next();case 5:if(m.done){y.jumpTo(7);
|
|
379
380
|
break}n=m.value;p=shaka.util.StreamUtils.getDecodingConfigs_(n,b,c).filter(function(A){return function(C){C=C[0];return(C.keySystemConfiguration&&C.keySystemConfiguration.keySystem)===A.preferredKeySystem}}(h));q=$jscomp.makeIterator(p);r=q.next();case 8:if(r.done){y.jumpTo(10);break}t=r.value;return y.yield(shaka.util.StreamUtils.getDecodingInfosForVariant_(n,t),9);case 9:r=q.next();y.jumpTo(8);break;case 10:n.decodingInfos.length&&(k=!0);m=l.next();y.jumpTo(5);break;case 7:if(k)return y.return();
|
|
@@ -588,12 +589,12 @@ shaka.media.DrmEngine.prototype.onKeyStatusesChange_=function(a){var b=this;a=a.
|
|
|
588
589
|
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))};
|
|
589
590
|
shaka.media.DrmEngine.probeSupport=function(){var a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H;return $jscomp.asyncExecutePromiseGeneratorProgram(function(E){if(1==E.nextAddress){goog.asserts.assert(shaka.util.DrmUtils.isBrowserSupported(),"Must have basic EME support");a="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.chromecast.playready com.apple.fps.1_0 com.apple.fps".split(" ");
|
|
590
591
|
b=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];c=["150","2000","3000"];d={"com.widevine.alpha":b,"com.widevine.alpha.experiment":b,"com.microsoft.playready.recommendation":c};e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}];f=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];g={videoCapabilities:e,audioCapabilities:f,initDataTypes:["cenc","sinf","skd","keyids"]};h=[null,
|
|
591
|
-
"cenc","cbcs","cbcs-1-9"];k=new Map;l=function(F,M){var J,I,L,K,O,
|
|
592
|
-
O={persistentState:I,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[]},k.has(F)&&k.get(F)?O=k.get(F):k.set(F,O),(
|
|
593
|
-
L=shaka.util.ObjectUtils.cloneObject(g);K=$jscomp.makeIterator(L.videoCapabilities);for(O=K.next();!O.done;O=K.next())
|
|
594
|
-
U),5);case 5:P.leaveTryBlock(0);break;case 2:P.enterCatchBlock(),P.jumpToEnd()}})};n=function(F,M,J,I){var L,K,O;return $jscomp.asyncExecutePromiseGeneratorProgram(function(
|
|
595
|
-
robustness:I}}},
|
|
596
|
-
w,"","")),t.push(n(B,w,"","")));D=$jscomp.makeIterator(a);for(y=D.next();!y.done;y=D.next())for(A=y.value,C=$jscomp.makeIterator(d[A]||[]),G=C.next();!G.done;G=C.next())H=G.value,t.push(m(A,null,H,"")),t.push(m(A,null,"",H)),t.push(n(A,null,H,"")),t.push(n(A,null,"",H));return E.yield(Promise.all(t),2)}return E.return(shaka.util.MapUtils.asObject(k))})};
|
|
592
|
+
"cenc","cbcs","cbcs-1-9"];k=new Map;l=function(F,M){var J,I,L,K,O,R,N,Q;return $jscomp.asyncExecutePromiseGeneratorProgram(function(S){switch(S.nextAddress){case 1:return S.setCatchFinallyBlocks(2),S.yield(M.createMediaKeys(),4);case 4:S.leaveTryBlock(3);break;case 2:return S.enterCatchBlock(),S.return();case 3:I=(J=M.getConfiguration().sessionTypes)?J.includes("persistent-license"):!1,shaka.util.Platform.isTizen3()&&(I=!1),L=M.getConfiguration().videoCapabilities,K=M.getConfiguration().audioCapabilities,
|
|
593
|
+
O={persistentState:I,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[]},k.has(F)&&k.get(F)?O=k.get(F):k.set(F,O),(R=L[0].encryptionScheme)&&!O.encryptionSchemes.includes(R)&&O.encryptionSchemes.push(R),(N=L[0].robustness)&&!O.videoRobustnessLevels.includes(N)&&O.videoRobustnessLevels.push(N),(Q=K[0].robustness)&&!O.audioRobustnessLevels.includes(Q)&&O.audioRobustnessLevels.push(Q),S.jumpToEnd()}})};m=function(F,M,J,I){var L,K,O,R,N,Q,S,T,V,U;return $jscomp.asyncExecutePromiseGeneratorProgram(function(P){switch(P.nextAddress){case 1:P.setCatchFinallyBlocks(2);
|
|
594
|
+
L=shaka.util.ObjectUtils.cloneObject(g);K=$jscomp.makeIterator(L.videoCapabilities);for(O=K.next();!O.done;O=K.next())R=O.value,R.encryptionScheme=M,R.robustness=J;N=$jscomp.makeIterator(L.audioCapabilities);for(Q=N.next();!Q.done;Q=N.next())S=Q.value,S.encryptionScheme=M,S.robustness=I;T=shaka.util.ObjectUtils.cloneObject(L);T.persistentState="required";T.sessionTypes=["persistent-license"];V=[T,L];return P.yield(shaka.util.Functional.promiseWithTimeout(1,navigator.requestMediaKeySystemAccess(F,
|
|
595
|
+
V)),4);case 4:return U=P.yieldResult,P.yield(l(F,U),5);case 5:P.leaveTryBlock(0);break;case 2:P.enterCatchBlock(),P.jumpToEnd()}})};n=function(F,M,J,I){var L,K,O,R;return $jscomp.asyncExecutePromiseGeneratorProgram(function(N){switch(N.nextAddress){case 1:return N.setCatchFinallyBlocks(2),L={type:"media-source",video:{contentType:e[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:f[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:F,video:{encryptionScheme:M,
|
|
596
|
+
robustness:J},audio:{encryptionScheme:M,robustness:I}}},N.yield(shaka.util.Functional.promiseWithTimeout(1,navigator.mediaCapabilities.decodingInfo(L)),4);case 4:return K=N.yieldResult,O=K.keySystemAccess,N.yield(l(F,O),5);case 5:N.leaveTryBlock(0);break;case 2:R=N.enterCatchBlock(),shaka.log.v2("Failed to probe support for",F,R),N.jumpToEnd()}})};p=$jscomp.makeIterator(a);for(q=p.next();!q.done;q=p.next())r=q.value,k.set(r,null);t=[];u=$jscomp.makeIterator(h);for(v=u.next();!v.done;v=u.next())for(w=
|
|
597
|
+
v.value,x=$jscomp.makeIterator(a),z=x.next();!z.done;z=x.next())B=z.value,"org.w3.clearkey"===B&&shaka.util.Platform.isSafari()||(t.push(m(B,w,"","")),t.push(n(B,w,"","")));D=$jscomp.makeIterator(a);for(y=D.next();!y.done;y=D.next())for(A=y.value,C=$jscomp.makeIterator(d[A]||[]),G=C.next();!G.done;G=C.next())H=G.value,t.push(m(A,null,H,"")),t.push(m(A,null,"",H)),t.push(n(A,null,H,"")),t.push(n(A,null,"",H));return E.yield(Promise.all(t),2)}return E.return(shaka.util.MapUtils.asObject(k))})};
|
|
597
598
|
shaka.media.DrmEngine.prototype.onPlay_=function(){for(var a=$jscomp.makeIterator(this.mediaKeyMessageEvents_),b=a.next();!b.done;b=a.next())this.sendLicenseRequest_(b.value);this.initialRequestsSent_=!0;this.mediaKeyMessageEvents_=[]};
|
|
598
599
|
shaka.media.DrmEngine.prototype.closeSession_=function(a){var b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return b=shaka.media.DrmEngine,c=new Promise(function(e,f){(new shaka.util.Timer(f)).tickAfter(b.CLOSE_TIMEOUT_)}),d.setCatchFinallyBlocks(2),d.yield(Promise.race([Promise.all([a.close(),a.closed]),c]),4);if(2!=d.nextAddress)return d.leaveTryBlock(0);d.enterCatchBlock();shaka.log.warning("Timeout waiting for session close");d.jumpToEnd()})};
|
|
599
600
|
shaka.media.DrmEngine.prototype.closeOpenSessions_=function(){var a=this,b;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){b=Array.from(a.activeSessions_.entries());a.activeSessions_.clear();return c.yield(Promise.all(b.map(function(d){d=$jscomp.makeIterator(d);var e=d.next().value,f=d.next().value,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){if(1==h.nextAddress){h.setCatchFinallyBlocks(2);if(!a.initializedForStorage_&&!a.storedPersistentSessions_.has(e.sessionId)&&
|
|
@@ -1278,7 +1279,7 @@ shaka.Player.prototype.unload=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;
|
|
|
1278
1279
|
(c.bufferPoller_.stop(),c.bufferPoller_=null);if(!c.parser_){q.jumpTo(6);break}return q.yield(c.parser_.stop(),7);case 7:c.parser_=null,c.parserFactory_=null;case 6:if(!c.abrManager_){q.jumpTo(8);break}return q.yield(c.abrManager_.stop(),8);case 8:if(!c.streamingEngine_){q.jumpTo(10);break}return q.yield(c.streamingEngine_.destroy(),11);case 11:c.streamingEngine_=null;case 10:c.playRateController_&&(c.playRateController_.release(),c.playRateController_=null);c.playhead_&&(c.playhead_.release(),c.playhead_=
|
|
1279
1280
|
null);if(!shaka.util.Platform.isMediaKeysPolyfilled("webkit")||!c.drmEngine_){q.jumpTo(12);break}return q.yield(c.drmEngine_.destroy(),13);case 13:c.drmEngine_=null;case 12:if(!c.mediaSourceEngine_){q.jumpTo(14);break}return q.yield(c.mediaSourceEngine_.destroy(),15);case 15:c.mediaSourceEngine_=null;case 14:if(c.adManager_&&!b)c.adManager_.onAssetUnload();c.preloadDueAdManager_&&!b&&(c.preloadDueAdManager_.destroy(),c.preloadDueAdManager_=null);b||c.preloadDueAdManagerTimer_.stop();c.cmcdManager_&&
|
|
1280
1281
|
c.cmcdManager_.reset();c.cmsdManager_&&c.cmsdManager_.reset();if(!c.textDisplayer_){q.jumpTo(16);break}return q.yield(c.textDisplayer_.destroy(),17);case 17:c.textDisplayer_=null;case 16:c.video_&&shaka.util.Dom.removeAllChildren(c.video_);c.video_&&c.video_.src&&(c.video_.removeAttribute("src"),c.video_.load());if(!c.drmEngine_){q.jumpTo(18);break}return q.yield(c.drmEngine_.destroy(),19);case 19:c.drmEngine_=null;case 18:c.preloadNextUrl_&&c.assetUri_!=c.preloadNextUrl_.getAssetUri()&&(c.preloadNextUrl_.isDestroyed()||
|
|
1281
|
-
c.preloadNextUrl_.destroy(),c.preloadNextUrl_=null);c.assetUri_=null;c.mimeType_=null;c.bufferObserver_=null;if(c.manifest_){e=$jscomp.makeIterator(c.manifest_.variants);for(f=e.next();!f.done;f=e.next())for(g=f.value,h=$jscomp.makeIterator([g.audio,g.video]),k=h.next();!k.done;k=h.next())(l=k.value)&&l.segmentIndex&&l.segmentIndex.release();m=$jscomp.makeIterator(c.manifest_.textStreams);for(n=m.next();!n.done;n=m.next())p=n.value,p.segmentIndex&&p.segmentIndex.release()}c.config_.streaming.clearDecodingCache&&
|
|
1282
|
+
c.preloadNextUrl_.destroy(),c.preloadNextUrl_=null);c.assetUri_=null;c.mimeType_=null;c.bufferObserver_=null;if(c.manifest_){e=$jscomp.makeIterator(c.manifest_.variants);for(f=e.next();!f.done;f=e.next())for(g=f.value,h=$jscomp.makeIterator([g.audio,g.video]),k=h.next();!k.done;k=h.next())(l=k.value)&&l.segmentIndex&&l.segmentIndex.release();m=$jscomp.makeIterator(c.manifest_.textStreams);for(n=m.next();!n.done;n=m.next())p=n.value,p.segmentIndex&&p.segmentIndex.release()}c.config_&&c.config_.streaming.clearDecodingCache&&
|
|
1282
1283
|
(shaka.util.StreamUtils.clearDecodingConfigCache(),shaka.util.DrmUtils.clearMediaKeySystemAccessMap());c.manifest_=null;c.stats_=new shaka.util.Stats;c.lastTextFactory_=null;c.targetLatencyReached_=null;c.currentTargetLatency_=null;c.rebufferingCount_=-1;c.externalSrcEqualsThumbnailsStreams_=[];c.completionPercent_=-1;c.updateBufferState_();case 3:q.enterFinallyBlock();c.mutex_.release();q.leaveFinallyBlock(4);break;case 4:if(a&&shaka.util.Platform.supportsMediaSource()&&!c.mediaSourceEngine_&&c.video_)return q.yield(c.initializeMediaSourceEngineInner_(),
|
|
1283
1284
|
0);q.jumpTo(0)}})};shaka.Player.prototype.updateStartTime=function(a){this.startTime_=a};
|
|
1284
1285
|
shaka.Player.prototype.load=function(a,b,c){b=void 0===b?null:b;var d=this,e,f,g,h,k,l,m,n,p,q,r,t,u;return $jscomp.asyncExecutePromiseGeneratorProgram(function(v){switch(v.nextAddress){case 1:if(d.loadMode_==shaka.Player.LoadMode.DESTROYED)throw d.createAbortLoadError_();e=null;f="";a instanceof shaka.media.PreloadManager?(e=a,f=e.getAssetUri()||""):f=a||"";return v.yield(d.mutex_.acquire("load"),2);case 2:d.mutex_.release();if(!d.video_)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
@@ -1475,8 +1476,8 @@ shaka.Player.prototype.onTimeUpdate_=function(){var a=this.video_.playbackRate,b
|
|
|
1475
1476
|
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?
|
|
1476
1477
|
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;
|
|
1477
1478
|
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&&
|
|
1478
|
-
(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 ("+
|
|
1479
|
-
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())}};
|
|
1479
|
+
(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)):void 0!=g&&k&&f-c>g?(a!=k&&(shaka.log.debug("Latency ("+
|
|
1480
|
+
f+"s) is greater than live sync maxLatency ("+g+"s). Updating playbackRate to "+k),this.trickPlay(k,!1)),this.targetLatencyReached_=null):void 0!=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())}};
|
|
1480
1481
|
shaka.Player.prototype.onVideoProgress_=function(){var a=this;if(this.video_){var b=function(e,f){return(shaka.util.NumberUtils.isFloatEqual(e,f)||f>e)&&a.completionPercent_<e?(a.completionPercent_=e,!0):!1},c=this.video_.currentTime/this.video_.duration;if(!isNaN(c)){c*=100;var d;b(0,c)?d=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Started):b(25,c)?d=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.FirstQuartile):b(50,c)?d=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Midpoint):
|
|
1481
1482
|
b(75,c)?d=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.ThirdQuartile):b(100,c)&&(d=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Complete));d&&this.dispatchEvent(d)}}};shaka.Player.prototype.onSeek_=function(){this.playheadObservers_&&this.playheadObservers_.notifyOfSeek();this.streamingEngine_&&this.streamingEngine_.seeked();this.bufferObserver_&&this.pollBufferState_()};
|
|
1482
1483
|
shaka.Player.prototype.updateAbrManagerVariants_=function(){try{goog.asserts.assert(this.manifest_,"Manifest should exist by now!"),this.manifestFilterer_.checkRestrictedVariants(this.manifest_)}catch(b){return this.onError_(b),!1}var a=shaka.util.StreamUtils.getPlayableVariants(this.manifest_.variants);a=this.currentAdaptationSetCriteria_.create(a);this.abrManager_.setVariants(Array.from(a.values()));return!0};
|
|
@@ -1533,7 +1534,7 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
|
|
|
1533
1534
|
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);
|
|
1534
1535
|
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);
|
|
1535
1536
|
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);
|
|
1536
|
-
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.
|
|
1537
|
+
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.16-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1537
1538
|
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_++};
|
|
1538
1539
|
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};
|
|
1539
1540
|
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_};
|
|
@@ -1630,10 +1631,10 @@ v=new Set;f.adEventManager_.listenOnce(f.player_,"error",q);f.adEventManager_.li
|
|
|
1630
1631
|
y.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))});D.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&&
|
|
1631
1632
|
(m=(new shaka.util.Timer(function(){u.skip()})).tickAfter(a.playoutLimit),f.player_.configure("playRangeEnd",a.playoutLimit));return D.yield(f.player_.attach(f.video_),6);case 6:return f.preloadManagerInterstitials_.has(a)?D.yield(f.preloadManagerInterstitials_.get(a),10):D.yield(f.player_.load(a.uri),8);case 10:return x=D.yieldResult,f.preloadManagerInterstitials_.delete(a),x?D.yield(f.player_.load(x),8):D.yield(f.player_.load(a.uri),8);case 8:a.playoutLimit&&(m&&m.stop(),m=(new shaka.util.Timer(function(){u.skip()})).tickAfter(a.playoutLimit));
|
|
1632
1633
|
z=(Date.now()-g)/1E3;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.ADS_LOADED,(new Map).set("loadTime",z)));f.usingBaseVideo_&&f.baseVideo_.play();D.leaveTryBlock(0);break;case 4:B=D.enterCatchBlock(),q(B),D.jumpToEnd()}})};
|
|
1633
|
-
shaka.ads.InterstitialAdManager.prototype.getInterstitialsInfo_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,
|
|
1634
|
-
a.startTime)/10:a.startTime;(k=a.endTime)&&Infinity!=a.endTime&&"number"==typeof a.endTime&&(k=null==f?Math.floor(10*a.endTime)/10:a.endTime);l=a.values.find(function(
|
|
1635
|
-
B=z=x=!1;if(D=a.values.find(function(
|
|
1636
|
-
break}E=e.data;if(!E)return N.return(c);N.setCatchFinallyBlocks(4);F=shaka.net.NetworkingEngine;M={type:F.AdvancedRequestType.INTERSTITIAL_ASSET_LIST};return N.yield(b.makeAdRequest_(E,M),6);case 6:J=N.yieldResult;I=shaka.util.StringUtils.fromUTF8(J);L=JSON.parse(I);K=$jscomp.makeIterator(L.ASSETS);for(O=K.next();!O.done;O=K.next())
|
|
1634
|
+
shaka.ads.InterstitialAdManager.prototype.getInterstitialsInfo_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,R;return $jscomp.asyncExecutePromiseGeneratorProgram(function(N){switch(N.nextAddress){case 1:c=[];if(!a)return N.return(c);d=a.values.find(function(Q){return"X-ASSET-URI"==Q.key});e=a.values.find(function(Q){return"X-ASSET-LIST"==Q.key});if(!d&&!e)return N.return(c);f=null;if(g=a.values.find(function(Q){return"ID"==Q.key}))f=g.data;h=null==f?Math.floor(10*
|
|
1635
|
+
a.startTime)/10:a.startTime;(k=a.endTime)&&Infinity!=a.endTime&&"number"==typeof a.endTime&&(k=null==f?Math.floor(10*a.endTime)/10:a.endTime);l=a.values.find(function(Q){return"X-RESTRICT"==Q.key});n=m=!0;l&&l.data&&(p=l.data,m=!p.includes("SKIP"),n=!p.includes("JUMP"));q=null;if(r=a.values.find(function(Q){return"X-RESUME-OFFSET"==Q.key}))t=r.data,q=parseFloat(t),isNaN(q)&&(q=null);u=null;if(v=a.values.find(function(Q){return"X-PLAYOUT-LIMIT"==Q.key}))w=v.data,u=parseFloat(w),isNaN(u)&&(u=null);
|
|
1636
|
+
B=z=x=!1;if(D=a.values.find(function(Q){return"CUE"==Q.key}))y=D.data,x=y.includes("ONCE"),z=y.includes("PRE"),B=y.includes("POST");A=!1;(C=a.values.find(function(Q){return"X-TIMELINE-OCCUPIES"==Q.key}))?(G=C.data,A=G.includes("RANGE")):!r&&b.basePlayer_.isLive()&&(A=!z&&!B);if(d){H=d.data;if(!H)return N.return(c);c.push({id:f,startTime:h,endTime:k,uri:H,isSkippable:m,skipOffset:m?0:null,canJump:n,resumeOffset:q,playoutLimit:u,once:x,pre:z,post:B,timelineRange:A});N.jumpTo(2);break}if(!e){N.jumpTo(2);
|
|
1637
|
+
break}E=e.data;if(!E)return N.return(c);N.setCatchFinallyBlocks(4);F=shaka.net.NetworkingEngine;M={type:F.AdvancedRequestType.INTERSTITIAL_ASSET_LIST};return N.yield(b.makeAdRequest_(E,M),6);case 6:J=N.yieldResult;I=shaka.util.StringUtils.fromUTF8(J);L=JSON.parse(I);K=$jscomp.makeIterator(L.ASSETS);for(O=K.next();!O.done;O=K.next())R=O.value,R.URI&&c.push({id:f,startTime:h,endTime:k,uri:R.URI,isSkippable:m,skipOffset:m?0:null,canJump:n,resumeOffset:q,playoutLimit:u,once:x,pre:z,post:B,timelineRange:A});
|
|
1637
1638
|
N.leaveTryBlock(2);break;case 4:N.enterCatchBlock();case 2:return N.return(c)}})};
|
|
1638
1639
|
shaka.ads.InterstitialAdManager.prototype.cuepointsChanged_=function(){for(var a=[],b=$jscomp.makeIterator(this.interstitials_),c=b.next(),d={};!c.done;d={shakaCuePoint$jscomp$1:void 0},c=b.next())c=c.value,d.shakaCuePoint$jscomp$1={start:c.startTime,end:null},c.pre?(d.shakaCuePoint$jscomp$1.start=0,d.shakaCuePoint$jscomp$1.end=null):c.post?(d.shakaCuePoint$jscomp$1.start=-1,d.shakaCuePoint$jscomp$1.end=null):c.timelineRange&&(d.shakaCuePoint$jscomp$1.end=c.endTime),a.find(function(e){return function(f){return e.shakaCuePoint$jscomp$1.start==
|
|
1639
1640
|
f.start&&e.shakaCuePoint$jscomp$1.end==f.end}}(d))||a.push(d.shakaCuePoint$jscomp$1);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.CUEPOINTS_CHANGED,(new Map).set("cuepoints",a)))};
|
|
@@ -2042,9 +2043,9 @@ a.representation),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.
|
|
|
2042
2043
|
shaka.dash.SegmentTemplate.generateSegmentIndexFromIndexTemplate_=function(a,b,c,d){var e=shaka.dash.MpdUtils,f=shaka.util.ManifestParserUtils;goog.asserts.assert(d.indexTemplate,"must be using index template");e=e.fillUriTemplate(d.indexTemplate,a.representation.id,null,null,a.bandwidth||null,null);f=f.resolveUris(a.representation.getBaseUris(),[e]);return shaka.dash.SegmentBase.generateSegmentIndexFromUris(a,b,c,f,0,null,d.scaledPresentationTimeOffset)};
|
|
2043
2044
|
shaka.dash.SegmentTemplate.generateSegmentIndexFromDuration_=function(a,b,c,d,e,f,g,h){goog.asserts.assert(b.mediaTemplate,"There should be a media template with duration");var k=shaka.dash.MpdUtils,l=shaka.util.ManifestParserUtils,m=a.presentationTimeline,n=a.periodInfo.start,p=a.period.id,q=a.periodInfo.duration,r=function(){var J=null!=p&&e[p]||q;return J?n+J:Infinity},t=b.segmentDuration;goog.asserts.assert(null!=t,"Segment duration must not be null!");var u=b.startNumber,v=b.timescale,w=b.mediaTemplate,
|
|
2044
2045
|
x=a.bandwidth||null,z=a.representation.id,B=a.representation.getBaseUris,D=a.urlParams,y=n-b.scaledPresentationTimeOffset,A=function(){var J=[Math.max(m.getSegmentAvailabilityStart(),n),Math.min(m.getSegmentAvailabilityEnd(),r())];goog.asserts.assert(J.every(isFinite),"Available presentation times must be finite!");goog.asserts.assert(J.every(function(I){return 0<=I}),"Available presentation times must be positive!");goog.asserts.assert(null!=t,"Segment duration must not be null!");J=J.map(function(I){return I-
|
|
2045
|
-
n});J=[Math.ceil(J[0]/t),Math.ceil(J[1]/t)-1];a.representation.availabilityTimeOffset&&J[1]++;return J.map(function(I){return I+u})},C=A();c=a.dynamic?Math.max(C[0],C[1]-c+1):C[0];g=g||C[1];C=[];var G=function(J){goog.asserts.assert(null!=t,"Segment duration must not be null!");var I=(J-u)*t,L=I+b.scaledPresentationTimeOffset,K=I+n;I=K+t;var O=Math.min(I,r());goog.asserts.assert(K<O,"Generated a segment outside of the period!");var
|
|
2046
|
-
T++){var V=K+
|
|
2047
|
-
|
|
2046
|
+
n});J=[Math.ceil(J[0]/t),Math.ceil(J[1]/t)-1];a.representation.availabilityTimeOffset&&J[1]++;return J.map(function(I){return I+u})},C=A();c=a.dynamic?Math.max(C[0],C[1]-c+1):C[0];g=g||C[1];C=[];var G=function(J){goog.asserts.assert(null!=t,"Segment duration must not be null!");var I=(J-u)*t,L=I+b.scaledPresentationTimeOffset,K=I+n;I=K+t;var O=Math.min(I,r());goog.asserts.assert(K<O,"Generated a segment outside of the period!");var R=[],N=b.numChunks;if(N)for(var Q=(O-K)/N,S={},T=0;T<N;S={subNumber$jscomp$1:void 0},
|
|
2047
|
+
T++){var V=K+Q*T,U=V+Q;S.subNumber$jscomp$1=T+1;S=function(P){return function(){var W=L*v;"BigInt"in window&&W>Number.MAX_SAFE_INTEGER&&(W=BigInt(L)*BigInt(v));W=k.fillUriTemplate(w,z,J,P.subNumber$jscomp$1,x,W);return l.resolveUris(B(),[W],D())}}(S);V=new shaka.media.SegmentReference(V,U,S,0,null,d,y,n,r(),[],"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,f);V.codecs=a.representation.codecs;V.mimeType=a.representation.mimeType;0==h?0<T&&V.markAsNonIndependent():0!=T%h&&V.markAsNonIndependent();
|
|
2048
|
+
R.push(V)}K=new shaka.media.SegmentReference(K,O,function(){if(N)return[];var P=L*v;"BigInt"in window&&P>Number.MAX_SAFE_INTEGER&&(P=BigInt(L)*BigInt(v));P=k.fillUriTemplate(w,z,J,null,x,P);return l.resolveUris(B(),[P],D())},0,null,d,y,n,r(),R,"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,f,0<R.length);K.codecs=a.representation.codecs;K.mimeType=a.representation.mimeType;K.bandwidth=a.bandwidth;K.trueEndTime=I;return K},H=c;for(;H<=g;++H){var E=G(H);C.push(E)}var F=new shaka.media.SegmentIndex(C);
|
|
2048
2049
|
C=m.getSegmentAvailabilityEnd()<r();H=m.isLive();if(C||H){var M=Math.max(c,g+1);c=t;a.representation.availabilityTimeOffset&&(c=.1);F.updateEvery(c,function(){var J=m.getSegmentAvailabilityStart();F.evict(J);var I=$jscomp.makeIterator(A());I.next();I=I.next().value;for(var L=[];M<=I;){var K=G(M);L.push(K);M++}return J>r()&&!L.length?null:L})}return Promise.resolve(F)};
|
|
2049
2050
|
shaka.dash.SegmentTemplate.createInitSegment_=function(a,b){var c=shaka.dash.MpdUtils,d=shaka.util.ManifestParserUtils,e=shaka.dash.SegmentTemplate,f=a.representation.initialization;f||(f=c.inheritAttribute(a,e.fromInheritance_,"initialization"));if(!f)return null;f=shaka.util.StringUtils.htmlUnescape(f);var g=a.representation.id,h=a.bandwidth||null,k=a.representation.getBaseUris,l=a.urlParams;e=shaka.dash.SegmentBase.createQualityInfo(a);b=new shaka.media.InitSegmentReference(function(){goog.asserts.assert(f,
|
|
2050
2051
|
"Should have returned earler");var m=c.fillUriTemplate(f,g,null,null,h,null);return d.resolveUris(k(),[m],l())},0,null,e,null,null,b);b.codecs=a.representation.codecs;b.mimeType=a.representation.mimeType;return b};
|
|
@@ -2148,14 +2149,14 @@ p);return q.return(p)})};
|
|
|
2148
2149
|
shaka.dash.DashParser.prototype.parseManifest_=function(a,b,c){var d=this,e,f,g,h,k,l,m,n,p,q,r;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){if(1==t.nextAddress){e=a;f=d.config_.dash.manifestPreprocessor;g=shaka.util.PlayerConfiguration.defaultManifestPreprocessor;if(f!=g){shaka.Deprecate.deprecateFeature(5,"manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");h=shaka.util.XmlUtils.parseXml(e,c);if(!h)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2149
2150
|
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_INVALID_XML,b);f(h);e=shaka.util.XmlUtils.toArrayBuffer(h)}k=shaka.util.TXml.parseXml(e,c);if(!k)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_INVALID_XML,b);l=d.config_.dash.manifestPreprocessorTXml;m=shaka.util.PlayerConfiguration.defaultManifestPreprocessorTXml;l!=m&&l(k);if("Patch"===c)return t.return(d.processPatchManifest_(k));if(n=d.config_.dash.disableXlinkProcessing)return t.return(d.processManifest_(k,
|
|
2150
2151
|
b));p=d.config_.dash.xlinkFailGracefully;q=shaka.dash.MpdUtils.processXlinks(k,d.config_.retryParameters,p,b,d.playerInterface_.networkingEngine);d.operationManager_.manage(q);return t.yield(q.promise,2)}r=t.yieldResult;return t.return(d.processManifest_(r,b))})};
|
|
2151
|
-
shaka.dash.DashParser.prototype.processManifest_=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,
|
|
2152
|
+
shaka.dash.DashParser.prototype.processManifest_=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,R,N,Q,S,T,V,U,P,W,X,Y,ba,ca,Z,da,ha,fa,ia,ea,na,ja,ka,la,ma;return $jscomp.asyncExecutePromiseGeneratorProgram(function(aa){switch(aa.nextAddress){case 1:d=shaka.util.TXml;goog.asserts.assert(c.config_,"Must call configure() before processManifest_()!");c.contentSteeringManager_&&c.contentSteeringManager_.clearPreviousLocations();e=[b];f=[];g=new Map;h=d.findChildren(a,
|
|
2152
2153
|
"Location");k=$jscomp.makeIterator(h);for(l=k.next();!l.done;l=k.next())if(m=l.value,n=m.attributes.serviceLocation,p=d.getContents(m))q=shaka.util.ManifestParserUtils.resolveUris(e,[p])[0],n&&(c.contentSteeringManager_?c.contentSteeringManager_.addLocation("Location",n,q):g.set(n,q)),f.push(q);c.contentSteeringManager_?(r=c.contentSteeringManager_.getLocations("Location",!0),0<r.length&&(e=c.manifestUris_=r)):f.length&&(e=c.manifestUris_=f);c.manifestPatchContext_.mpdId=a.attributes.id||"";c.manifestPatchContext_.publishTime=
|
|
2153
2154
|
d.parseAttr(a,"publishTime",d.parseDate)||0;c.patchLocationNodes_=d.findChildren(a,"PatchLocation");t=Promise.resolve();if((u=d.findChild(a,"ContentSteering"))&&c.playerInterface_){v=u.attributes.defaultServiceLocation;if(c.contentSteeringManager_)c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(v);else if(c.contentSteeringManager_=new shaka.util.ContentSteeringManager(c.playerInterface_),c.contentSteeringManager_.configure(c.config_),c.contentSteeringManager_.setManifestType(shaka.media.ManifestParser.DASH),
|
|
2154
2155
|
c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(v),w=d.getContents(u))(x=d.parseAttr(u,"queryBeforeStart",d.parseBoolean,!1))?t=c.contentSteeringManager_.requestInfo(w):c.contentSteeringManager_.requestInfo(w);z=$jscomp.makeIterator(g.keys());for(B=z.next();!B.done;B=z.next())D=B.value,y=g.get(D),c.contentSteeringManager_.addLocation("Location",D,y)}A=d.findChildren(a,"BaseURL");C=!1;if(c.contentSteeringManager_)for(G=$jscomp.makeIterator(A),H=G.next();!H.done;H=
|
|
2155
2156
|
G.next())E=H.value,F=E.attributes.serviceLocation,M=d.getContents(E),F&&M&&(c.contentSteeringManager_.addLocation("BaseURL",F,M),C=!0);c.lastCalculatedBaseUris_=null;C&&c.contentSteeringManager_||(J=A.map(d.getContents),c.lastCalculatedBaseUris_=shaka.util.ManifestParserUtils.resolveUris(e,J));I=function(){return c.contentSteeringManager_&&C?c.contentSteeringManager_.getLocations("BaseURL"):c.lastCalculatedBaseUris_?c.lastCalculatedBaseUris_:[]};c.manifestPatchContext_.getBaseUris=I;L=0;A&&A.length&&
|
|
2156
|
-
(L=d.parseAttr(A[0],"availabilityTimeOffset",d.parseFloat)||0);c.manifestPatchContext_.availabilityTimeOffset=L;K=c.config_.dash.ignoreMinBufferTime;O=0;K||(O=d.parseAttr(a,"minBufferTime",d.parseDuration)||0);c.updatePeriod_=d.parseAttr(a,"minimumUpdatePeriod",d.parseDuration,-1);
|
|
2157
|
+
(L=d.parseAttr(A[0],"availabilityTimeOffset",d.parseFloat)||0);c.manifestPatchContext_.availabilityTimeOffset=L;K=c.config_.dash.ignoreMinBufferTime;O=0;K||(O=d.parseAttr(a,"minBufferTime",d.parseDuration)||0);c.updatePeriod_=d.parseAttr(a,"minimumUpdatePeriod",d.parseDuration,-1);R=d.parseAttr(a,"availabilityStartTime",d.parseDate);N=d.parseAttr(a,"timeShiftBufferDepth",d.parseDuration);Q=c.config_.dash.ignoreSuggestedPresentationDelay;S=null;Q||(S=d.parseAttr(a,"suggestedPresentationDelay",d.parseDuration));
|
|
2157
2158
|
T=c.config_.dash.ignoreMaxSegmentDuration;V=null;T||(V=d.parseAttr(a,"maxSegmentDuration",d.parseDuration));U=a.attributes.type||"static";c.manifest_&&c.manifest_.presentationTimeline&&(c.isTransitionFromDynamicToStatic_=c.manifest_.presentationTimeline.isLive()&&"static"==U);c.manifestPatchContext_.type=U;c.cleanStreamMap_();if(c.manifest_)for(P=c.manifest_.presentationTimeline,W=$jscomp.makeIterator(Object.values(c.streamMap_)),X=W.next();!X.done;X=W.next())Y=X.value,Y.segmentIndex&&Y.segmentIndex.evict(P.getSegmentAvailabilityStart());
|
|
2158
|
-
else ba=c.config_.defaultPresentationDelay||1.5*O,ca=null!=S?S:ba,P=new shaka.media.PresentationTimeline(
|
|
2159
|
+
else ba=c.config_.defaultPresentationDelay||1.5*O,ca=null!=S?S:ba,P=new shaka.media.PresentationTimeline(R,ca,c.config_.dash.autoCorrectDrift);P.setStatic("static"==U);(Z=P.isLive())&&!isNaN(c.config_.availabilityWindowOverride)&&(N=c.config_.availabilityWindowOverride);null==N&&(N=Infinity);P.setSegmentAvailabilityDuration(N);da=a.attributes.profiles||"";c.manifestPatchContext_.profiles=da.split(",");ha={dynamic:"static"!=U,presentationTimeline:P,period:null,periodInfo:null,adaptationSet:null,representation:null,
|
|
2159
2160
|
bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:L,mediaPresentationDuration:null,profiles:da.split(","),roles:null,urlParams:function(){return""}};c.gapCount_=0;fa=c.parsePeriods_(ha,I,a,!1);ia=fa.duration;ea=fa.periods;("static"!=U||c.isTransitionFromDynamicToStatic_)&&fa.durationDerivedFromPeriods||P.setDuration(ia||Infinity);c.isLowLatency_&&!c.lowLatencyMode_&&(na=c.playerInterface_.isAutoLowLatencyMode())&&(c.playerInterface_.enableLowLatencyMode(),c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());
|
|
2160
2161
|
c.lowLatencyMode_&&P.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_);P.notifyMaxSegmentDuration(V||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&P.assertIsValid();return aa.yield(t,2);case 2:c.lowLatencyMode_&&(O=0,ja=null!=S?S:c.config_.defaultPresentationDelay,P.setDelay(ja));if(!c.manifest_)return aa.yield(c.periodCombiner_.combinePeriods(ea,ha.dynamic),6);c.manifest_.periodCount=ea.length;c.manifest_.gapCount=c.gapCount_;return aa.yield(c.postPeriodProcessing_(ea,!1),4);case 6:c.manifest_=
|
|
2161
2162
|
{presentationTimeline:P,variants:c.periodCombiner_.getVariants(),textStreams:c.periodCombiner_.getTextStreams(),imageStreams:c.periodCombiner_.getImageStreams(),offlineSessionIds:[],minBufferTime:O||0,sequenceMode:c.config_.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:shaka.media.ManifestParser.DASH,serviceDescription:c.parseServiceDescription_(a),nextUrl:c.parseMpdChaining_(a),periodCount:ea.length,gapCount:c.gapCount_,isLowLatency:c.isLowLatency_,startTime:null};if(!P.usingPresentationStartTime()){aa.jumpTo(7);
|
|
@@ -2204,8 +2205,8 @@ shaka.dash.DashParser.prototype.getURLParametersFunction_=function(a){var b=this
|
|
|
2204
2205
|
if(g.length)return f+"="+g[0]}return e}).join("&")}}return null};
|
|
2205
2206
|
shaka.dash.DashParser.prototype.parseRepresentation_=function(a,b,c,d,e,f,g,h,k,l,m){var n=this,p=shaka.util.TXml,q=shaka.util.ManifestParserUtils.ContentType;a.representation=this.createFrame_(k,a.adaptationSet,null);var r=a.representation.id;this.minTotalAvailabilityTimeOffset_=Math.min(this.minTotalAvailabilityTimeOffset_,a.representation.availabilityTimeOffset);this.isLowLatency_=0<this.minTotalAvailabilityTimeOffset_;if(!this.verifyRepresentation_(a.representation))return shaka.log.warning("Skipping Representation",a.representation),
|
|
2206
2207
|
null;var t=a.periodInfo.start;a.bandwidth=p.parseAttr(k,"bandwidth",p.parsePositiveInt)||0;a.roles=g;var u=p.findChildren(k,"SupplementalProperty"),v=p.findChildren(k,"EssentialProperty"),w=null,x=v.find(function(K){return"urn:mpeg:dash:urlparam:2014"==K.attributes.schemeIdUri});x?w=this.getURLParametersFunction_(x):(x=u.find(function(K){return"urn:mpeg:dash:urlparam:2014"==K.attributes.schemeIdUri}))&&(w=this.getURLParametersFunction_(x));w&&(a.urlParams=w);x=a.representation.contentType;w=x==q.TEXT||
|
|
2207
|
-
x==q.APPLICATION;q=x==q.IMAGE;try{var z=void 0;if(b.aes128Info){var B=a.representation.getBaseUris,D=a.urlParams,y=shaka.util.ManifestParserUtils.resolveUris(B(),[b.aes128Info.keyUri],D()),A=shaka.net.NetworkingEngine.RequestType.KEY,C=shaka.net.NetworkingEngine.makeRequest(y,this.config_.retryParameters);z={bitsKey:128,blockCipherMode:"CBC",iv:b.aes128Info.iv,firstMediaSequenceNumber:0,fetchKey:function(){var K,O,
|
|
2208
|
-
A),2);if(3!=N.nextAddress){K=N.yieldResult;if(!K.data||16!=K.data.byteLength)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.AES_128_INVALID_KEY_LENGTH);O={name:"AES-CBC"};
|
|
2208
|
+
x==q.APPLICATION;q=x==q.IMAGE;try{var z=void 0;if(b.aes128Info){var B=a.representation.getBaseUris,D=a.urlParams,y=shaka.util.ManifestParserUtils.resolveUris(B(),[b.aes128Info.keyUri],D()),A=shaka.net.NetworkingEngine.RequestType.KEY,C=shaka.net.NetworkingEngine.makeRequest(y,this.config_.retryParameters);z={bitsKey:128,blockCipherMode:"CBC",iv:b.aes128Info.iv,firstMediaSequenceNumber:0,fetchKey:function(){var K,O,R;return $jscomp.asyncExecutePromiseGeneratorProgram(function(N){if(1==N.nextAddress)return N.yield(n.makeNetworkRequest_(C,
|
|
2209
|
+
A),2);if(3!=N.nextAddress){K=N.yieldResult;if(!K.data||16!=K.data.byteLength)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.AES_128_INVALID_KEY_LENGTH);O={name:"AES-CBC"};R=z;return N.yield(window.crypto.subtle.importKey("raw",K.data,O,!0,["decrypt"]),3)}R.cryptoKey=N.yieldResult;z.fetchKey=void 0;N.jumpToEnd()})}}}a.representation.aesKey=z;B=function(K,O,R,N){return n.requestSegment_(K,O,R,N)};if(a.representation.segmentBase)var G=
|
|
2209
2210
|
shaka.dash.SegmentBase.createStreamInfo(a,B,z);else if(a.representation.segmentList)G=shaka.dash.SegmentList.createStreamInfo(a,this.streamMap_,z);else if(a.representation.segmentTemplate)G=shaka.dash.SegmentTemplate.createStreamInfo(a,B,this.streamMap_,!!this.manifest_,this.config_.dash.initialSegmentLimit,this.periodDurations_,z,m,!1);else{goog.asserts.assert(w,"Must have Segment* with non-text streams.");var H=a.periodInfo.duration||0,E=a.representation.getBaseUris,F=a.representation.mimeType,
|
|
2210
2211
|
M=a.representation.codecs;G={generateSegmentIndex:function(){var K=shaka.media.SegmentIndex.forSingleSegment(t,H,E());K.forEachTopLevelReference(function(O){O.mimeType=F;O.codecs=M});return Promise.resolve(K)}}}}catch(K){if((w||q)&&K.code==shaka.util.Error.Code.DASH_NO_SEGMENT_INFO)return null;throw K;}k=p.findChildren(k,"ContentProtection");k=shaka.dash.ContentProtection.parseFromRepresentation(k,b,this.config_.dash.ignoreDrmInfo,this.config_.dash.keySystemsByURI);k=new Set(k?[k]:[]);m=!1;u.some(function(K){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==
|
|
2211
2212
|
K.attributes.schemeIdUri&&"JOC"==K.attributes.value})&&(m=!0);u=!1;w&&(u=g.includes("forced_subtitle")||g.includes("forced-subtitle"));var J;if(q&&((v=v.find(function(K){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(K.attributes.schemeIdUri)}))&&(J=v.attributes.value),!J))return null;var I;w=a.representation.codecs;a.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(w.includes("hvc1.2.4.L153.B0")||w.includes("hev1.2.4.L153.B0"))&&
|
|
@@ -2268,11 +2269,11 @@ this.aesKeyInfoMap_.clear();this.aesKeyMap_.clear();this.identityKeyMap_.clear()
|
|
|
2268
2269
|
shaka.hls.HlsParser.prototype.update=function(){var a=this,b,c,d,e,f,g,h,k,l,m,n,p;return $jscomp.asyncExecutePromiseGeneratorProgram(function(q){if(1==q.nextAddress){if(!a.isLive_())return q.return();b=[];c=Array.from(a.uriToStreamInfosMap_.values());a.lastTargetDuration_=Infinity;a.manifest_.gapCount=0;d=c.filter(function(r){return r.stream.segmentIndex});e=$jscomp.makeIterator(d);for(f=e.next();!f.done;f=e.next())g=f.value,b.push(a.updateStream_(g));return q.yield(Promise.all(b),2)}a.notifySegmentsForStreams_(d.map(function(r){return r.stream}));
|
|
2269
2270
|
h=d.some(function(r){return 0==r.hasEndList});d.length&&!h&&(k=shaka.hls.HlsParser.PresentationType_,a.setPresentationType_(k.VOD),l=d.map(function(r){return r.maxTimestamp}),a.presentationTimeline_.setDuration(Math.min.apply(Math,$jscomp.arrayFromIterable(l))),a.playerInterface_.updateDuration());h&&a.determineDuration_();m=$jscomp.makeIterator(d);for(n=m.next();!n.done;n=m.next())p=n.value,p.stream.segmentIndex&&!p.stream.segmentIndex.earliestReference()&&a.playerInterface_.disableStream(p.stream);
|
|
2270
2271
|
q.jumpToEnd()})};shaka.hls.HlsParser.prototype.getMediaSequenceToStartTimeFor_=function(a){return this.isLive_()?this.mediaSequenceToStartTimeByType_.get(a.type):a.mediaSequenceToStartTime};
|
|
2271
|
-
shaka.hls.HlsParser.prototype.updateStream_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,
|
|
2272
|
+
shaka.hls.HlsParser.prototype.updateStream_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,R;return $jscomp.asyncExecutePromiseGeneratorProgram(function(N){switch(N.nextAddress){case 1:c=[];d=$jscomp.makeIterator(a.getUris());for(e=d.next();!e.done;e=d.next())f=e.value,g=new goog.Uri(f),h=g.getQueryData(),a.canBlockReload&&(0<=a.nextMediaSequence&&h.add("_HLS_msn",String(a.nextMediaSequence)),0<=a.nextPart&&h.add("_HLS_part",String(a.nextPart))),a.canSkipSegments&&
|
|
2272
2273
|
h.add("_HLS_skip","YES"),h.getCount()&&g.setQueryData(h),c.push(g.toString());N.setCatchFinallyBlocks(2);return N.yield(b.requestManifest_(c,!0).promise,4);case 4:k=N.yieldResult;N.leaveTryBlock(3);break;case 2:throw l=N.enterCatchBlock(),b.playerInterface_&&b.playerInterface_.disableStream(a.stream),l;case 3:if(!a.stream.segmentIndex)return N.return();m=b.manifestTextParser_.parsePlaylist(k.data);if(m.type!=shaka.hls.PlaylistType.MEDIA)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2273
|
-
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);n=k.uri;n==k.originalUri||a.getUris().includes(n)||a.redirectUris.push(n);p=shaka.hls.Utils.filterTagsByName(m.tags,"EXT-X-DEFINE");q=b.parseMediaVariables_(p,n);r=a.stream;t=b.getMediaSequenceToStartTimeFor_(a);return N.yield(b.parseDrmInfo_(m,r.mimeType,a.getUris,q),5);case 5:u=N.yieldResult;v=u.keyIds;w=u.drmInfos;x=function(
|
|
2274
|
+
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);n=k.uri;n==k.originalUri||a.getUris().includes(n)||a.redirectUris.push(n);p=shaka.hls.Utils.filterTagsByName(m.tags,"EXT-X-DEFINE");q=b.parseMediaVariables_(p,n);r=a.stream;t=b.getMediaSequenceToStartTimeFor_(a);return N.yield(b.parseDrmInfo_(m,r.mimeType,a.getUris,q),5);case 5:u=N.yieldResult;v=u.keyIds;w=u.drmInfos;x=function(Q,S){return Q.size===S.size&&[].concat($jscomp.arrayFromIterable(Q)).every(function(T){return S.has(T)})};
|
|
2274
2275
|
x(r.keyIds,v)||(r.keyIds=v,r.drmInfos=w,b.playerInterface_.newDrmInfo(r));z=b.createSegments_(m,t,q,a.getUris,a.type);B=z.segments;if(D=z.bandwidth)r.bandwidth=D;y=shaka.media.QualityObserver.createQualityInfo(r);A=$jscomp.makeIterator(B);for(C=A.next();!C.done;C=A.next())G=C.value,G.initSegmentReference&&(G.initSegmentReference.mediaQuality=y);r.segmentIndex.mergeAndEvict(B,b.presentationTimeline_.getSegmentAvailabilityStart());B.length&&(H=shaka.hls.Utils.getFirstTagWithNameAsNumber(m.tags,"EXT-X-MEDIA-SEQUENCE",
|
|
2275
|
-
0),F=(E=shaka.hls.Utils.getFirstTagWithName(m.tags,"EXT-X-SKIP"))?Number(E.getAttributeValue("SKIPPED-SEGMENTS")):0,M=b.getNextMediaSequenceAndPart_(H,B),J=M.nextMediaSequence,I=M.nextPart,a.nextMediaSequence=J+F,a.nextPart=I,L=t.get(H),r.segmentIndex.evict(L));if(K=r.segmentIndex.earliestReference())a.minTimestamp=K.startTime,O=B[B.length-1],goog.asserts.assert(O,"Should have segments!"),a.maxTimestamp=O.endTime;if(
|
|
2276
|
+
0),F=(E=shaka.hls.Utils.getFirstTagWithName(m.tags,"EXT-X-SKIP"))?Number(E.getAttributeValue("SKIPPED-SEGMENTS")):0,M=b.getNextMediaSequenceAndPart_(H,B),J=M.nextMediaSequence,I=M.nextPart,a.nextMediaSequence=J+F,a.nextPart=I,L=t.get(H),r.segmentIndex.evict(L));if(K=r.segmentIndex.earliestReference())a.minTimestamp=K.startTime,O=B[B.length-1],goog.asserts.assert(O,"Should have segments!"),a.maxTimestamp=O.endTime;if(R=shaka.hls.Utils.getFirstTagWithName(m.tags,"EXT-X-ENDLIST"))a.hasEndList=!0;b.determineLastTargetDuration_(m);
|
|
2276
2277
|
b.processDateRangeTags_(m.tags,r.type,q,a.getUris);N.jumpToEnd()}})};shaka.hls.HlsParser.prototype.onExpirationUpdated=function(a,b){};shaka.hls.HlsParser.prototype.onInitialVariantChosen=function(a){};shaka.hls.HlsParser.prototype.banLocation=function(a){this.contentSteeringManager_&&this.contentSteeringManager_.banLocation(a)};shaka.hls.HlsParser.prototype.setMediaElement=function(a){this.mediaElement_=a};
|
|
2277
2278
|
shaka.hls.HlsParser.prototype.syncStreamsWithSequenceNumber_=function(a,b){b=void 0===b?!1:b;for(var c=-1==this.minSequenceNumber_,d=$jscomp.makeIterator(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.stream.segmentIndex;goog.asserts.assert(f,"Only loaded streams should be synced");var g=this.getMediaSequenceToStartTimeFor_(e);if(f=f.earliestReference()){goog.DEBUG&&g.values().next().value!=f.startTime&&shaka.log.warning("Sequence number map is not ordered as expected!");g=$jscomp.makeIterator(g);
|
|
2278
2279
|
for(var h=g.next();!h.done;h=g.next()){h=$jscomp.makeIterator(h.value);var k=h.next().value;if(h.next().value==f.startTime){c&&(this.minSequenceNumber_=Math.max(this.minSequenceNumber_,k));e.firstSequenceNumber=k;break}}}}if(!(0>this.minSequenceNumber_))for(shaka.log.debug("Syncing HLS streams against base sequence number:",this.minSequenceNumber_),a=$jscomp.makeIterator(a),c=a.next();!c.done;c=a.next())if(c=c.value,this.ignoreManifestProgramDateTimeFor_(c.type)||b)if(d=c.stream.segmentIndex)if(e=
|
|
@@ -2280,14 +2281,14 @@ this.minSequenceNumber_-c.firstSequenceNumber,0<e&&(d.dropFirstReferences(e),d=d
|
|
|
2280
2281
|
shaka.hls.HlsParser.prototype.syncStreamsWithProgramDateTime_=function(a){if(Infinity==this.lowestSyncTime_){a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value.stream.segmentIndex,goog.asserts.assert(b,"Only loaded streams should be synced"),b=b.earliestReference(),null!=b&&null!=b.syncTime&&(this.lowestSyncTime_=Math.min(this.lowestSyncTime_,b.syncTime))}a=this.lowestSyncTime_;if(Infinity!=a){shaka.log.debug("Syncing HLS streams against base time:",a);b=$jscomp.makeIterator(this.uriToStreamInfosMap_.values());
|
|
2281
2282
|
for(var c=b.next();!c.done;c=b.next())if(c=c.value,!this.ignoreManifestProgramDateTimeFor_(c.type)){var d=c.stream.segmentIndex;if(null!=d){var e=d.earliestReference();if(e)if(null==e.syncTime)shaka.log.alwaysError("Missing EXT-X-PROGRAM-DATE-TIME for stream",c.getUris(),"Expect AV sync issues!");else for(this.offsetStreamInfo_(c,e.syncTime-a-e.startTime),c=$jscomp.makeIterator(d),d=c.next();!d.done;d=c.next())d.value.syncAgainst(a)}}}};
|
|
2282
2283
|
shaka.hls.HlsParser.prototype.offsetStreamInfo_=function(a,b){a.minTimestamp+=b;a.maxTimestamp+=b;goog.asserts.assert(0<=a.maxTimestamp,"Negative maxTimestamp after adjustment!");for(var c=this.getMediaSequenceToStartTimeFor_(a),d=$jscomp.makeIterator(c),e=d.next();!e.done;e=d.next()){var f=$jscomp.makeIterator(e.value);e=f.next().value;f=f.next().value;c.set(e,f+b)}shaka.log.debug("Offset",b,"applied to",a.getUris())};
|
|
2283
|
-
shaka.hls.HlsParser.prototype.parseManifest_=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,
|
|
2284
|
+
shaka.hls.HlsParser.prototype.parseManifest_=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,R;return $jscomp.asyncExecutePromiseGeneratorProgram(function(N){switch(N.nextAddress){case 1:d=shaka.hls.Utils;e=shaka.util.ManifestParserUtils.ContentType;goog.asserts.assert(c.masterPlaylistUri_,"Master playlist URI must be set before calling parseManifest_!");f=c.manifestTextParser_.parsePlaylist(a);g=d.filterTagsByName(f.tags,"EXT-X-DEFINE");h=[];k=[];l=[];goog.asserts.assert(null==
|
|
2284
2285
|
c.presentationTimeline_,"Presentation timeline created early!");c.presentationTimeline_=new shaka.media.PresentationTimeline(null,0);c.presentationTimeline_.setStatic(!0);m=function(){return[b]};n=null;p=new Map;if(f.type==shaka.hls.PlaylistType.MEDIA)return c.needsClosedCaptionsDetection_=!1,B=shaka.hls.Utils.filterTagsByName(f.tags,"EXT-X-DEFINE"),p=c.parseMediaVariables_(B,c.masterPlaylistUri_),n=e.VIDEO,D="",y=new Map,N.yield(c.convertParsedPlaylistIntoStreamInfo_(c.globalId_++,p,f,m,b,"",n,D,
|
|
2285
2286
|
!0,"Media Playlist",null,y,null,!1,null,!1),7);c.parseMasterVariables_(g);q=d.filterTagsByName(f.tags,"EXT-X-MEDIA");r=d.filterTagsByName(f.tags,"EXT-X-STREAM-INF");t=d.filterTagsByName(f.tags,"EXT-X-IMAGE-STREAM-INF");u=d.filterTagsByName(f.tags,"EXT-X-I-FRAME-STREAM-INF");v=d.filterTagsByName(f.tags,"EXT-X-SESSION-KEY");w=d.filterTagsByName(f.tags,"EXT-X-SESSION-DATA");x=d.filterTagsByName(f.tags,"EXT-X-CONTENT-STEERING");c.processSessionData_(w);return N.yield(c.processContentSteering_(x),4);case 4:return c.parseCodecs_(r),
|
|
2286
|
-
c.parseClosedCaptions_(q),z=c.parseIFrames_(u),N.yield(c.createVariantsForTags_(r,v,q,m,c.globalVariables_,z),5);case 5:return h=N.yieldResult,k=c.parseTexts_(q),N.yield(c.parseImages_(t,u),6);case 6:l=N.yieldResult;N.jumpTo(3);break;case 7:A=N.yieldResult,c.uriToStreamInfosMap_.set(b,A),A.stream&&(C=shaka.media.QualityObserver.createQualityInfo(A.stream),A.stream.segmentIndex.forEachTopLevelReference(function(
|
|
2287
|
+
c.parseClosedCaptions_(q),z=c.parseIFrames_(u),N.yield(c.createVariantsForTags_(r,v,q,m,c.globalVariables_,z),5);case 5:return h=N.yieldResult,k=c.parseTexts_(q),N.yield(c.parseImages_(t,u),6);case 6:l=N.yieldResult;N.jumpTo(3);break;case 7:A=N.yieldResult,c.uriToStreamInfosMap_.set(b,A),A.stream&&(C=shaka.media.QualityObserver.createQualityInfo(A.stream),A.stream.segmentIndex.forEachTopLevelReference(function(Q){Q.initSegmentReference&&(Q.initSegmentReference.mediaQuality=C)})),n=A.stream.type,h.push({id:0,
|
|
2287
2288
|
language:c.getLanguage_(D),disabledUntilTime:0,primary:!0,audio:"audio"==n?A.stream:null,video:"video"==n?A.stream:null,bandwidth:A.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!c.playerInterface_)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.OPERATION_ABORTED);c.determineStartTime_(f);f.type==shaka.hls.PlaylistType.MEDIA&&(c.isLive_()&&(c.changePresentationTimelineToLive_(f),G=
|
|
2288
2289
|
c.getUpdatePlaylistDelay_(),c.updatePlaylistTimer_.tickAfter(G)),H=Array.from(c.uriToStreamInfosMap_.values()),c.finalizeStreams_(H),c.determineDuration_(),goog.asserts.assert(n,"mediaPlaylistType should be non-null"),c.processDateRangeTags_(f.tags,n,p,m));c.manifest_={presentationTimeline:c.presentationTimeline_,variants:h,textStreams:k,imageStreams:l,offlineSessionIds:[],minBufferTime:0,sequenceMode:c.config_.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:c.config_.hls.ignoreManifestTimestampsInSegmentsMode,
|
|
2289
2290
|
type:shaka.media.ManifestParser.HLS,serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:c.startTime_};if(c.codecInfoInManifest_||!c.config_.hls.disableCodecGuessing){N.jumpTo(8);break}E=[];F=$jscomp.makeIterator(c.manifest_.variants);for(M=F.next();!M.done;M=F.next())J=M.value,J.audio&&""===J.audio.codecs&&E.push(J.audio.createSegmentIndex()),J.video&&""===J.video.codecs&&E.push(J.video.createSegmentIndex());return N.yield(Promise.all(E),8);case 8:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_);
|
|
2290
|
-
if(1==h.length){I=[];L=h[0];K=$jscomp.makeIterator([L.video,L.audio]);for(O=K.next();!O.done;O=K.next())(
|
|
2291
|
+
if(1==h.length){I=[];L=h[0];K=$jscomp.makeIterator([L.video,L.audio]);for(O=K.next();!O.done;O=K.next())(R=O.value)&&!R.segmentIndex&&I.push(R.createSegmentIndex());if(0<I.length)return N.yield(Promise.all(I),0)}N.jumpTo(0)}})};
|
|
2291
2292
|
shaka.hls.HlsParser.prototype.getBasicInfoFromSegments_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H;return $jscomp.asyncExecutePromiseGeneratorProgram(function(E){switch(E.nextAddress){case 1:c=shaka.hls.HlsParser;d=shaka.media.SegmentUtils.getBasicInfoFromMimeType(b.config_.hls.mediaPlaylistFullMimeType);if(!a.length)return E.return(d);e=b.getAvailableSegment_(a);f=e.segment;g=e.segmentIndex;h=f.getUris();k=h[0];l=new goog.Uri(k);m=l.getPath().split(".").pop();if(n=
|
|
2292
2293
|
c.RAW_FORMATS_TO_MIME_TYPES_[m])return E.return(shaka.media.SegmentUtils.getBasicInfoFromMimeType(n));p=shaka.net.NetworkingEngine.RequestType.SEGMENT;r=q=null;t=f.initSegmentReference;if(!t){E.jumpTo(2);break}u=shaka.util.Networking.createSegmentRequest(t.getUris(),t.getStartByte(),t.getEndByte(),b.config_.retryParameters);v=shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT;return E.yield(b.makeNetworkRequest_(u,p,{type:v}).promise,3);case 3:w=E.yieldResult;q=w.data;if(!t.aesKey){E.jumpTo(4);
|
|
2293
2294
|
break}return E.yield(shaka.media.SegmentUtils.aesDecrypt(q,t.aesKey,0),5);case 5:q=E.yieldResult;case 4:(r=w.headers["content-type"])&&(r=r.split(";")[0].toLowerCase());case 2:return x=shaka.util.Networking.createSegmentRequest(f.getUris(),f.getStartByte(),f.getEndByte(),b.config_.retryParameters),z=shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT,E.yield(b.makeNetworkRequest_(x,p,{type:z}).promise,6);case 6:B=E.yieldResult;D=B.data;if(!f.aesKey){E.jumpTo(7);break}return E.yield(shaka.media.SegmentUtils.aesDecrypt(D,
|
|
@@ -2309,10 +2310,10 @@ shaka.hls.HlsParser.prototype.parseImages_=function(a,b){var c=this,d,e;return $
|
|
|
2309
2310
|
throw l;})}).concat(b.map(function(g){if(c.config_.disableThumbnails)return null;try{var h=c.createStreamInfoFromIframeTag_(g);return h.stream.type!==shaka.util.ManifestParserUtils.ContentType.IMAGE?null:h.stream}catch(k){if(c.config_.hls.ignoreImageStreamFailures)return null;throw k;}})),f.yield(Promise.all(d),2);e=f.yieldResult;return f.return(e.filter(function(g){return g}))})};
|
|
2310
2311
|
shaka.hls.HlsParser.prototype.createStreamInfosFromMediaTags_=function(a,b){a=a.filter(function(g){var h=g.getAttributeValue("URI")||"";return"SUBTITLES"!=g.getAttributeValue("TYPE")&&""!=h});var c={};a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=d.getTagKey(!this.contentSteeringManager_);c[e]?c[e].push(d):c[e]=[d]}for(var f in c)this.createStreamInfoFromMediaTags_(c[f],b)};
|
|
2311
2312
|
shaka.hls.HlsParser.prototype.parseIFrames_=function(a){var b=this;return a.map(function(c){c=b.createStreamInfoFromIframeTag_(c);return c.stream.type!==shaka.util.ManifestParserUtils.ContentType.VIDEO?null:c.stream}).filter(function(c){return c})};
|
|
2312
|
-
shaka.hls.HlsParser.prototype.createVariantsForTags_=function(a,b,c,d,e,f){var g=this,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,
|
|
2313
|
+
shaka.hls.HlsParser.prototype.createVariantsForTags_=function(a,b,c,d,e,f){var g=this,h,k,l,m,n,p,q,r,t,u,v,w,x,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,R,N,Q,S,T,V,U;return $jscomp.asyncExecutePromiseGeneratorProgram(function(P){switch(P.nextAddress){case 1:h=[];k=new Set;if(!(0<b.length)){P.jumpTo(2);break}l=$jscomp.makeIterator(b);m=l.next();case 3:if(m.done){P.jumpTo(2);break}n=m.value;p=n.getRequiredAttrValue("METHOD");q=n.getAttributeValue("KEYFORMAT")||"identity";r=null;if("NONE"==p){P.jumpTo(4);break}if(g.isAesMethod_(p)){t=
|
|
2313
2314
|
shaka.hls.Utils.constructSegmentUris(d(),n.getRequiredAttrValue("URI"),e);u=t.sort().join("");g.aesKeyMap_.has(u)||(v=shaka.net.NetworkingEngine.RequestType.KEY,w=shaka.net.NetworkingEngine.makeRequest(t,g.config_.retryParameters),x=g.makeNetworkRequest_(w,v).promise,g.aesKeyMap_.set(u,x));P.jumpTo(4);break}if("identity"!=q){r=(z=shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_[q])?z(n,""):null;P.jumpTo(6);break}return P.yield(g.identityDrmParser_(n,"",d,null,e),9);case 9:r=P.yieldResult;case 6:if(r){if(r.keyIds)for(B=
|
|
2314
2315
|
$jscomp.makeIterator(r.keyIds),D=B.next();!D.done;D=B.next())y=D.value,k.add(y);h.push(r)}else shaka.log.warning("Unsupported HLS KEYFORMAT",q);case 4:m=l.next();P.jumpTo(3);break;case 2:A={};C=$jscomp.makeIterator(a);for(G=C.next();!G.done;G=C.next())H=G.value,E=H.getTagKey(!g.contentSteeringManager_),A[E]?A[E].push(H):A[E]=[H];F=[];for(M in A)J=A[M],I=J[0],L=I.getAttributeValue("FRAME-RATE"),K=Number(I.getAttributeValue("AVERAGE-BANDWIDTH"))||Number(I.getRequiredAttrValue("BANDWIDTH")),O=I.getAttributeValue("RESOLUTION"),
|
|
2315
|
-
|
|
2316
|
+
R=$jscomp.makeIterator(O?O.split("x"):[null,null]),N=R.next().value,Q=R.next().value,S=I.getAttributeValue("VIDEO-RANGE"),(T=I.getAttributeValue("REQ-VIDEO-LAYOUT"))&&T.includes(",")&&(V=T.split(",").filter(function(W){return"CH-STEREO"==W||"CH-MONO"==W}),T=V[0]),T=T||"CH-MONO",U=g.createStreamInfosForVariantTags_(J,c,O,L),goog.asserts.assert(U.audio.length||U.video.length,"We should have created a stream!"),F.push.apply(F,$jscomp.arrayFromIterable(g.createVariants_(U.audio,U.video,K,N,Q,L,S,T,h,
|
|
2316
2317
|
k,f)));return P.return(F.filter(function(W){return null!=W}))}})};
|
|
2317
2318
|
shaka.hls.HlsParser.prototype.createStreamInfosForVariantTags_=function(a,b,c,d){d=shaka.util.ManifestParserUtils.ContentType;c={audio:[],video:[]};for(var e=new Map,f=[],g=!1,h=!1,k=$jscomp.makeIterator(a),l=k.next();!l.done;l=k.next()){l=l.value;var m=l.getAttributeValue("AUDIO"),n=l.getAttributeValue("VIDEO");goog.asserts.assert(null==m||null==n,"Unexpected: both video and audio described by media tags!");var p=m||n;if(p){f.includes(p)||f.push(p);var q=l.getAttributeValue("PATHWAY-ID");q&&e.set(p,
|
|
2318
2319
|
q);m?g=!0:n&&(h=!0);shaka.log.debug("Guessing stream type for",l.toString())}}f.length&&b.length&&(k=b.filter(function(t){return f.includes(t.getRequiredAttrValue("GROUP-ID"))}),this.createStreamInfosFromMediaTags_(k,e));k=(e=f.sort().join(","))&&this.groupIdToStreamInfosMap_.has(e)?this.groupIdToStreamInfosMap_.get(e):[];g?c.audio.push.apply(c.audio,$jscomp.arrayFromIterable(k)):h&&c.video.push.apply(c.video,$jscomp.arrayFromIterable(k));h=!1;var r=a.map(function(t){return t.getRequiredAttrValue("URI")});
|
|
@@ -2340,12 +2341,12 @@ a.getAttributeValue("CHARACTERISTICS");b=this.createStreamInfo_(this.globalId_++
|
|
|
2340
2341
|
shaka.hls.HlsParser.prototype.createStreamInfoFromVariantTags_=function(a,b,c,d,e,f,g,h,k){k=this.globalId_++;for(var l=[],m=$jscomp.makeIterator(a),n=m.next();!n.done;n=m.next()){var p=n.value;goog.asserts.assert("EXT-X-STREAM-INF"==p.name,"Should only be called on variant tags!");n=p.getRequiredAttrValue("URI");p=p.getAttributeValue("PATHWAY-ID");this.contentSteeringManager_&&p&&this.contentSteeringManager_.addLocation(k,p,n);l.push(n)}m=l.sort().join(",");if(this.uriToStreamInfosMap_.has(m))return this.uriToStreamInfosMap_.get(m);
|
|
2341
2342
|
a=this.getClosedCaptions_(a[0],c);b=shaka.util.ManifestParserUtils.guessCodecs(c,b);c=this.createStreamInfo_(k,l,b,c,d,!1,e,f,a,g,!1,h,!1);this.uriToStreamInfosMap_.set(m,c);return c};
|
|
2342
2343
|
shaka.hls.HlsParser.prototype.createStreamInfo_=function(a,b,c,d,e,f,g,h,k,l,m,n,p){var q=this,r=this.makeStreamObject_(a,c,d,e,f,g,h,k,l,m,n,p),t=[],u=function(){return q.contentSteeringManager_&&1<b.length?q.contentSteeringManager_.getLocations(a):t.concat(shaka.hls.Utils.constructUris([q.masterPlaylistUri_],b,q.globalVariables_))},v={stream:r,type:d,redirectUris:t,getUris:u,minTimestamp:0,maxTimestamp:0,mediaSequenceToStartTime:new Map,canSkipSegments:!1,canBlockReload:!1,hasEndList:!1,firstSequenceNumber:-1,
|
|
2343
|
-
nextMediaSequence:-1,nextPart:-1,loadedOnce:!1},w=function(B){var D,y,A,C,G,H,E,F,M,J,I,L,K,O,
|
|
2344
|
+
nextMediaSequence:-1,nextPart:-1,loadedOnce:!1},w=function(B){var D,y,A,C,G,H,E,F,M,J,I,L,K,O,R,N,Q,S,T,V,U,P,W;return $jscomp.asyncExecutePromiseGeneratorProgram(function(X){switch(X.nextAddress){case 1:return D=shaka.util.ManifestParserUtils.ContentType,X.setCatchFinallyBlocks(2),y=v.getUris(),X.yield(B.promise,4);case 4:A=X.yieldResult;if(B.aborted)return X.return();C=A.uri;C==A.originalUri||y.includes(C)||t.push(C);G=q.manifestTextParser_.parsePlaylist(A.data);if(G.type!=shaka.hls.PlaylistType.MEDIA)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2344
2345
|
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);H=shaka.hls.Utils.filterTagsByName(G.tags,"EXT-X-DEFINE");E=q.parseMediaVariables_(H,C);F=!1;(!q.codecInfoInManifest_&&q.config_.hls.disableCodecGuessing||q.needsClosedCaptionsDetection_&&d==D.VIDEO&&!q.config_.hls.disableClosedCaptionsDetection)&&0<G.segments.length&&(q.needsClosedCaptionsDetection_=!1,F=!0);M=!q.codecInfoInManifest_&&q.config_.hls.disableCodecGuessing;J=q.isLive_();return X.yield(q.convertParsedPlaylistIntoStreamInfo_(a,
|
|
2345
2346
|
E,G,u,C,c,d,e,f,g,h,k,l,m,n,p,void 0,F,M),5);case 5:I=X.yieldResult;if(B.aborted)return X.return();L=I.stream;q.determineStartTime_(G);q.isLive_()&&!J&&q.changePresentationTimelineToLive_(G);v.minTimestamp=I.minTimestamp;v.maxTimestamp=I.maxTimestamp;v.canSkipSegments=I.canSkipSegments;v.canBlockReload=I.canBlockReload;v.hasEndList=I.hasEndList;v.mediaSequenceToStartTime=I.mediaSequenceToStartTime;v.nextMediaSequence=I.nextMediaSequence;v.nextPart=I.nextPart;v.loadedOnce=!0;r.segmentIndex=L.segmentIndex;
|
|
2346
2347
|
r.encrypted=L.encrypted;r.drmInfos=L.drmInfos;r.keyIds=L.keyIds;r.mimeType=L.mimeType;r.bandwidth=r.bandwidth||L.bandwidth;r.codecs=r.codecs||L.codecs;r.closedCaptions=r.closedCaptions||L.closedCaptions;r.width=r.width||L.width;r.height=r.height||L.height;r.hdr=r.hdr||L.hdr;r.colorGamut=r.colorGamut||L.colorGamut;r.frameRate=r.frameRate||L.frameRate;"und"==r.language&&"und"!=L.language&&(r.language=L.language);r.language=r.language||L.language;r.channelsCount=r.channelsCount||L.channelsCount;r.audioSamplingRate=
|
|
2347
|
-
r.audioSamplingRate||L.audioSamplingRate;q.setFullTypeForStream_(r);r.drmInfos.length&&q.playerInterface_.newDrmInfo(r);K=!1;if(!k&&r.closedCaptions||k&&r.closedCaptions&&k.size!=r.closedCaptions.size)K=!0;q.manifest_&&K&&q.playerInterface_.makeTextStreamsForClosedCaptions(q.manifest_);if(d==D.VIDEO||d==D.AUDIO)for(O=$jscomp.makeIterator(q.uriToStreamInfosMap_.values()),
|
|
2348
|
-
d==D.TEXT&&(
|
|
2348
|
+
r.audioSamplingRate||L.audioSamplingRate;q.setFullTypeForStream_(r);r.drmInfos.length&&q.playerInterface_.newDrmInfo(r);K=!1;if(!k&&r.closedCaptions||k&&r.closedCaptions&&k.size!=r.closedCaptions.size)K=!0;q.manifest_&&K&&q.playerInterface_.makeTextStreamsForClosedCaptions(q.manifest_);if(d==D.VIDEO||d==D.AUDIO)for(O=$jscomp.makeIterator(q.uriToStreamInfosMap_.values()),R=O.next();!R.done;R=O.next())N=R.value,N.loadedOnce||N.type!=d||(N.stream.mimeType=L.mimeType,q.setFullTypeForStream_(N.stream));
|
|
2349
|
+
d==D.TEXT&&(Q=L.segmentIndex.earliestReference())&&Q.initSegmentReference&&(r.mimeType="application/mp4",q.setFullTypeForStream_(r));S=shaka.media.QualityObserver.createQualityInfo(r);r.segmentIndex.forEachTopLevelReference(function(Y){Y.initSegmentReference&&(Y.initSegmentReference.mediaQuality=S)});q.hasEnoughInfoToFinalizeStreams_()&&(q.streamsFinalized_?q.finalizeStreams_([v]):(q.streamsFinalized_=!0,T=Array.from(q.uriToStreamInfosMap_.values()),V=T.filter(function(Y){return Y.stream.segmentIndex}),
|
|
2349
2350
|
q.finalizeStreams_(V),q.determineDuration_(),U=q.getUpdatePlaylistDelay_(),0<U&&q.updatePlaylistTimer_.tickAfter(U)));q.processDateRangeTags_(G.tags,r.type,E,u);q.manifest_&&(q.manifest_.startTime=q.startTime_);X.leaveTryBlock(0);break;case 2:P=X.enterCatchBlock();r.closeSegmentIndex();if(P.code===shaka.util.Error.Code.OPERATION_ABORTED)return X.return();W=q.playerInterface_.disableStream(r);if(!W)throw P;X.jumpToEnd()}})},x=null,z;r.createSegmentIndex=function(){if(x)return x;z=q.requestManifest_(v.getUris(),
|
|
2350
2351
|
!0);return x=new Promise(function(B){B(w(z))})};r.closeSegmentIndex=function(){x&&!r.segmentIndex&&z.abort();r.segmentIndex&&(r.segmentIndex.release(),r.segmentIndex=null);x=null};return v};shaka.hls.HlsParser.prototype.getMinDuration_=function(){for(var a=Infinity,b=$jscomp.makeIterator(this.uriToStreamInfosMap_.values()),c=b.next();!c.done;c=b.next())c=c.value,c.stream.segmentIndex&&"text"!=c.stream.type&&(a=Math.min(a,c.maxTimestamp));return a};
|
|
2351
2352
|
shaka.hls.HlsParser.prototype.getLiveDuration_=function(){for(var a=Infinity,b=Infinity,c=$jscomp.makeIterator(this.uriToStreamInfosMap_.values()),d=c.next();!d.done;d=c.next())d=d.value,d.stream.segmentIndex&&"text"!=d.stream.type&&(a=Math.min(a,d.maxTimestamp),b=Math.min(b,d.minTimestamp));return a-b};
|
|
@@ -2353,11 +2354,11 @@ shaka.hls.HlsParser.prototype.notifySegmentsForStreams_=function(a){var b=[];a=$
|
|
|
2353
2354
|
shaka.hls.HlsParser.prototype.finalizeStreams_=function(a){if(!this.isLive_())for(var b=this.getMinDuration_(),c=$jscomp.makeIterator(a),d=c.next();!d.done;d=c.next())d.value.stream.segmentIndex.fit(0,b);this.notifySegmentsForStreams_(a.map(function(e){return e.stream}));b=this.isLive_()&&!this.usesProgramDateTime_;this.config_.hls.ignoreManifestProgramDateTime||b?this.syncStreamsWithSequenceNumber_(a,b):(this.syncStreamsWithProgramDateTime_(a),0<this.config_.hls.ignoreManifestProgramDateTimeForTypes.length&&
|
|
2354
2355
|
this.syncStreamsWithSequenceNumber_(a))};shaka.hls.HlsParser.prototype.ignoreManifestProgramDateTimeFor_=function(a){return this.config_.hls.ignoreManifestProgramDateTime?!0:this.config_.hls.ignoreManifestProgramDateTimeForTypes.includes(a)};
|
|
2355
2356
|
shaka.hls.HlsParser.prototype.hasEnoughInfoToFinalizeStreams_=function(){if(!this.manifest_)return!1;for(var a=[],b=[],c=$jscomp.makeIterator(this.manifest_.variants),d=c.next();!d.done;d=c.next())d=d.value,d.video&&a.push(d.video),d.audio&&b.push(d.audio);return 0<a.length&&!a.some(function(e){return e.segmentIndex})||0<b.length&&!b.some(function(e){return e.segmentIndex})?!1:!0};
|
|
2356
|
-
shaka.hls.HlsParser.prototype.convertParsedPlaylistIntoStreamInfo_=function(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w){v=void 0===v?!0:v;w=void 0===w?!0:w;var x=this,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,
|
|
2357
|
+
shaka.hls.HlsParser.prototype.convertParsedPlaylistIntoStreamInfo_=function(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,w){v=void 0===v?!0:v;w=void 0===w?!0:w;var x=this,z,B,D,y,A,C,G,H,E,F,M,J,I,L,K,O,R,N,Q,S,T,V,U,P,W,X,Y,ba,ca;return $jscomp.asyncExecutePromiseGeneratorProgram(function(Z){switch(Z.nextAddress){case 1:z=c.segments||[];B=z.every(function(da){return shaka.hls.Utils.getFirstTagWithName(da.tags,"EXT-X-GAP")?!0:!1});if(!z.length||B)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2357
2358
|
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_EMPTY_MEDIA_PLAYLIST);x.determinePresentationType_(c);x.isLive_()&&x.determineLastTargetDuration_(c);D=x.isLive_()?x.mediaSequenceToStartTimeByType_.get(g):new Map;y=x.createSegments_(c,D,b,d,g);A=y.segments;C=y.bandwidth;M=F=E=H=G=null;if(!(0<A.length&&v)){Z.jumpTo(2);break}return Z.yield(x.getBasicInfoFromSegments_(A),3);case 3:J=Z.yieldResult,g=J.type,h=J.language,m=J.channelCount,r=J.sampleRate,x.config_.disableText||(n=J.closedCaptions),
|
|
2358
|
-
H=J.height,G=J.width,E=J.videoRange,F=J.colorGamut,M=J.frameRate,w&&(u=J.mimeType,f=J.codecs);case 2:if(u){Z.jumpTo(4);break}return Z.yield(x.guessMimeType_(g,f,A),5);case 5:u=Z.yieldResult;case 4:return Z.yield(x.parseDrmInfo_(c,u,d,b),6);case 6:I=Z.yieldResult;L=I.drmInfos;K=I.keyIds;O=I.encrypted;
|
|
2359
|
-
f,g,h,k,l,m,n,p,q,r,t);N.encrypted=O;N.drmInfos=L;N.keyIds=K;N.mimeType=u;C&&(N.bandwidth=C);x.setFullTypeForStream_(N);g==shaka.util.ManifestParserUtils.ContentType.VIDEO&&(G||H||E||F)&&x.addVideoAttributes_(N,G,H,M,E,null,F);x.isLive_()&&x.determineLastTargetDuration_(c);
|
|
2360
|
-
!1;X=shaka.hls.Utils.getFirstTagWithNameAsNumber(c.tags,"EXT-X-MEDIA-SEQUENCE",0);Y=x.getNextMediaSequenceAndPart_(X,A);ba=Y.nextMediaSequence;ca=Y.nextPart;return Z.return({stream:N,type:g,redirectUris:[],getUris:d,minTimestamp:
|
|
2359
|
+
H=J.height,G=J.width,E=J.videoRange,F=J.colorGamut,M=J.frameRate,w&&(u=J.mimeType,f=J.codecs);case 2:if(u){Z.jumpTo(4);break}return Z.yield(x.guessMimeType_(g,f,A),5);case 5:u=Z.yieldResult;case 4:return Z.yield(x.parseDrmInfo_(c,u,d,b),6);case 6:I=Z.yieldResult;L=I.drmInfos;K=I.keyIds;O=I.encrypted;R=I.aesEncrypted;if(O&&!L.length&&!R)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED);N=x.makeStreamObject_(a,
|
|
2360
|
+
f,g,h,k,l,m,n,p,q,r,t);N.encrypted=O;N.drmInfos=L;N.keyIds=K;N.mimeType=u;C&&(N.bandwidth=C);x.setFullTypeForStream_(N);g==shaka.util.ManifestParserUtils.ContentType.VIDEO&&(G||H||E||F)&&x.addVideoAttributes_(N,G,H,M,E,null,F);x.isLive_()&&x.determineLastTargetDuration_(c);Q=A[0].startTime;S=A[A.length-1];T=S.endTime;V=new shaka.media.SegmentIndex(A);N.segmentIndex=V;P=(U=shaka.hls.Utils.getFirstTagWithName(c.tags,"EXT-X-SERVER-CONTROL"))?null!=U.getAttribute("CAN-SKIP-UNTIL"):!1;W=U?null!=U.getAttribute("CAN-BLOCK-RELOAD"):
|
|
2361
|
+
!1;X=shaka.hls.Utils.getFirstTagWithNameAsNumber(c.tags,"EXT-X-MEDIA-SEQUENCE",0);Y=x.getNextMediaSequenceAndPart_(X,A);ba=Y.nextMediaSequence;ca=Y.nextPart;return Z.return({stream:N,type:g,redirectUris:[],getUris:d,minTimestamp:Q,maxTimestamp:T,canSkipSegments:P,canBlockReload:W,hasEndList:!1,firstSequenceNumber:-1,nextMediaSequence:ba,nextPart:ca,mediaSequenceToStartTime:D,loadedOnce:!1})}})};
|
|
2361
2362
|
shaka.hls.HlsParser.prototype.getNextMediaSequenceAndPart_=function(a,b){a=a+b.length-1;var c=-1;if(!b.length)return a++,{nextMediaSequence:a,nextPart:c};b=b[b.length-1];var d=b.partialReferences;if(!b.partialReferences.length)return a++,b.hasByterangeOptimization()&&(c=0),{nextMediaSequence:a,nextPart:c};c=d.length-1;d[d.length-1].isPreload()||(a++,c=0);return{nextMediaSequence:a,nextPart:c}};
|
|
2362
2363
|
shaka.hls.HlsParser.prototype.makeStreamObject_=function(a,b,c,d,e,f,g,h,k,l,m,n){a=this.guessMimeTypeBeforeLoading_(c,b)||this.guessMimeTypeFallback_(c);var p=[];if(k){k=$jscomp.makeIterator(k.split(","));for(var q=k.next();!q.done;q=k.next())p.push(q.value)}k=void 0;q=null;c==shaka.util.ManifestParserUtils.ContentType.TEXT?k=p.includes("public.accessibility.transcribes-spoken-dialog")&&p.includes("public.accessibility.describes-music-and-sound")?shaka.util.ManifestParserUtils.TextStreamKind.CLOSED_CAPTION:
|
|
2363
2364
|
shaka.util.ManifestParserUtils.TextStreamKind.SUBTITLE:p.includes("public.accessibility.describes-video")&&(q=shaka.media.ManifestParser.AccessibilityPurpose.VISUALLY_IMPAIRED);p.length||k!==shaka.util.ManifestParserUtils.TextStreamKind.SUBTITLE||p.push(shaka.util.ManifestParserUtils.TextStreamKind.SUBTITLE);b={id:this.globalId_++,originalId:f,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:a,codecs:b,kind:c==shaka.util.ManifestParserUtils.ContentType.TEXT?
|