shaka-player 4.9.24 → 4.9.25
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 +33 -33
- package/dist/shaka-player.compiled.debug.js +52 -50
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +1132 -1131
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +57 -55
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +1306 -1305
- package/dist/shaka-player.ui.map +3 -3
- package/lib/dash/dash_parser.js +83 -48
- package/lib/media/streaming_engine.js +55 -6
- package/lib/player.js +16 -2
- package/lib/util/periods.js +16 -9
- package/lib/util/tXml.js +58 -7
- package/package.json +1 -1
package/dist/deps.js
CHANGED
|
@@ -48,7 +48,7 @@ goog.addDependency('../../../../lib/cea/ts_cea_parser.js', ['shaka.cea.TsCeaPars
|
|
|
48
48
|
goog.addDependency('../../../../lib/config/auto_show_text.js', ['shaka.config.AutoShowText'], [], {'lang': 'es5'});
|
|
49
49
|
goog.addDependency('../../../../lib/config/codec_switching_strategy.js', ['shaka.config.CodecSwitchingStrategy'], [], {'lang': 'es5'});
|
|
50
50
|
goog.addDependency('../../../../lib/dash/content_protection.js', ['shaka.dash.ContentProtection'], ['goog.asserts', 'shaka.log', 'shaka.util.BufferUtils', 'shaka.util.Error', 'shaka.util.ManifestParserUtils', 'shaka.util.Pssh', 'shaka.util.StringUtils', 'shaka.util.TXml', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es6'});
|
|
51
|
-
goog.addDependency('../../../../lib/dash/dash_parser.js', ['shaka.dash.DashParser'], ['goog.asserts', 'shaka.Deprecate', 'shaka.abr.Ewma', 'shaka.dash.ContentProtection', 'shaka.dash.MpdUtils', 'shaka.dash.SegmentBase', 'shaka.dash.SegmentList', 'shaka.dash.SegmentTemplate', 'shaka.log', 'shaka.media.Capabilities', 'shaka.media.ManifestParser', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentIndex', 'shaka.media.SegmentUtils', 'shaka.net.NetworkingEngine', 'shaka.text.TextEngine', 'shaka.util.ContentSteeringManager', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Networking', 'shaka.util.OperationManager', 'shaka.util.PeriodCombiner', 'shaka.util.PlayerConfiguration', 'shaka.util.StringUtils', 'shaka.util.TXml', 'shaka.util.Timer', 'shaka.util.XmlUtils'], {'lang': 'es8'});
|
|
51
|
+
goog.addDependency('../../../../lib/dash/dash_parser.js', ['shaka.dash.DashParser'], ['goog.asserts', 'shaka.Deprecate', 'shaka.abr.Ewma', 'shaka.dash.ContentProtection', 'shaka.dash.MpdUtils', 'shaka.dash.SegmentBase', 'shaka.dash.SegmentList', 'shaka.dash.SegmentTemplate', 'shaka.log', 'shaka.media.Capabilities', 'shaka.media.ManifestParser', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentIndex', 'shaka.media.SegmentUtils', 'shaka.net.NetworkingEngine', 'shaka.text.TextEngine', 'shaka.util.ContentSteeringManager', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Networking', 'shaka.util.ObjectUtils', 'shaka.util.OperationManager', 'shaka.util.PeriodCombiner', 'shaka.util.PlayerConfiguration', 'shaka.util.StringUtils', 'shaka.util.TXml', 'shaka.util.Timer', 'shaka.util.XmlUtils'], {'lang': 'es8'});
|
|
52
52
|
goog.addDependency('../../../../lib/dash/mpd_utils.js', ['shaka.dash.MpdUtils'], ['goog.asserts', 'shaka.log', 'shaka.net.NetworkingEngine', 'shaka.util.AbortableOperation', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.ManifestParserUtils', 'shaka.util.TXml'], {'lang': 'es6'});
|
|
53
53
|
goog.addDependency('../../../../lib/dash/segment_base.js', ['shaka.dash.SegmentBase'], ['goog.asserts', 'shaka.dash.MpdUtils', 'shaka.log', 'shaka.media.InitSegmentReference', 'shaka.media.Mp4SegmentIndexParser', 'shaka.media.SegmentIndex', 'shaka.media.WebmSegmentIndexParser', 'shaka.util.Error', 'shaka.util.ManifestParserUtils', 'shaka.util.ObjectUtils', 'shaka.util.StringUtils', 'shaka.util.TXml'], {'lang': 'es8'});
|
|
54
54
|
goog.addDependency('../../../../lib/dash/segment_list.js', ['shaka.dash.SegmentList'], ['goog.asserts', 'shaka.dash.MpdUtils', 'shaka.dash.SegmentBase', 'shaka.log', 'shaka.media.InitSegmentReference', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.ManifestParserUtils', 'shaka.util.StringUtils', 'shaka.util.TXml'], {'lang': 'es6'});
|
|
@@ -220,7 +220,7 @@ goog.addDependency('../../../../lib/util/stats.js', ['shaka.util.Stats'], ['shak
|
|
|
220
220
|
goog.addDependency('../../../../lib/util/stream_utils.js', ['shaka.util.StreamUtils'], ['goog.asserts', 'shaka.log', 'shaka.media.Capabilities', 'shaka.text.TextEngine', 'shaka.util.Functional', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.MultiMap', 'shaka.util.ObjectUtils', 'shaka.util.Platform'], {'lang': 'es8'});
|
|
221
221
|
goog.addDependency('../../../../lib/util/string_utils.js', ['shaka.util.StringUtils'], ['goog.asserts', 'shaka.log', 'shaka.util.BufferUtils', 'shaka.util.Error', 'shaka.util.Lazy', 'shaka.util.Platform'], {'lang': 'es6'});
|
|
222
222
|
goog.addDependency('../../../../lib/util/switch_history.js', ['shaka.util.SwitchHistory'], [], {'lang': 'es6'});
|
|
223
|
-
goog.addDependency('../../../../lib/util/tXml.js', ['shaka.util.TXml'], ['shaka.log', 'shaka.util.StringUtils'], {'lang': 'es6'});
|
|
223
|
+
goog.addDependency('../../../../lib/util/tXml.js', ['shaka.util.TXml'], ['shaka.log', 'shaka.util.ObjectUtils', 'shaka.util.StringUtils'], {'lang': 'es6'});
|
|
224
224
|
goog.addDependency('../../../../lib/util/text_parser.js', ['shaka.util.TextParser'], ['goog.asserts'], {'lang': 'es6'});
|
|
225
225
|
goog.addDependency('../../../../lib/util/timer.js', ['shaka.util.Timer'], ['shaka.util.DelayedTick'], {'lang': 'es6'});
|
|
226
226
|
goog.addDependency('../../../../lib/util/ts_parser.js', ['shaka.util.TsParser'], ['shaka.Deprecate', 'shaka.log', 'shaka.util.ExpGolomb', 'shaka.util.Id3Utils', 'shaka.util.StringUtils', 'shaka.util.Uint8ArrayUtils'], {'lang': 'es6'});
|
package/dist/locales.js
CHANGED
|
@@ -762,48 +762,48 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
762
762
|
*/
|
|
763
763
|
shaka.ui.Locales.Ids = {
|
|
764
764
|
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
765
|
-
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
766
|
-
REPLAY: 'REPLAY',
|
|
767
765
|
SEEK: 'SEEK',
|
|
768
|
-
|
|
769
|
-
RECENTER_VR: 'RECENTER_VR',
|
|
770
|
-
CAST: 'CAST',
|
|
771
|
-
VOLUME: 'VOLUME',
|
|
772
|
-
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
773
|
-
PLAY: 'PLAY',
|
|
774
|
-
FAST_FORWARD: 'FAST_FORWARD',
|
|
766
|
+
LOOP: 'LOOP',
|
|
775
767
|
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
776
|
-
|
|
768
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
769
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
777
770
|
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
778
771
|
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
772
|
+
REPLAY: 'REPLAY',
|
|
779
773
|
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
AIRPLAY: 'AIRPLAY',
|
|
786
|
-
SKIP_AD: 'SKIP_AD',
|
|
787
|
-
OFF: 'OFF',
|
|
788
|
-
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
789
|
-
PAUSE: 'PAUSE',
|
|
774
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
775
|
+
CAST: 'CAST',
|
|
776
|
+
LANGUAGE: 'LANGUAGE',
|
|
777
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
778
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
790
779
|
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
780
|
+
PAUSE: 'PAUSE',
|
|
791
781
|
RESOLUTION: 'RESOLUTION',
|
|
782
|
+
QUALITY: 'QUALITY',
|
|
783
|
+
ON: 'ON',
|
|
792
784
|
MUTE: 'MUTE',
|
|
793
|
-
|
|
794
|
-
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
795
|
-
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
796
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
797
|
-
REWIND: 'REWIND',
|
|
798
|
-
AD_STATISTICS: 'AD_STATISTICS',
|
|
799
|
-
LANGUAGE: 'LANGUAGE',
|
|
800
|
-
AD_TIME: 'AD_TIME',
|
|
785
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
801
786
|
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
787
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
788
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
789
|
+
PLAY: 'PLAY',
|
|
805
790
|
CAPTIONS: 'CAPTIONS',
|
|
806
|
-
|
|
791
|
+
REWIND: 'REWIND',
|
|
792
|
+
SURROUND: 'SURROUND',
|
|
807
793
|
LIVE: 'LIVE',
|
|
808
|
-
|
|
794
|
+
RECENTER_VR: 'RECENTER_VR',
|
|
795
|
+
OFF: 'OFF',
|
|
796
|
+
STATISTICS: 'STATISTICS',
|
|
797
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
798
|
+
SKIP_AD: 'SKIP_AD',
|
|
799
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
800
|
+
BACK: 'BACK',
|
|
801
|
+
AD_TIME: 'AD_TIME',
|
|
802
|
+
AD_STATISTICS: 'AD_STATISTICS',
|
|
803
|
+
AD_DURATION: 'AD_DURATION',
|
|
804
|
+
FAST_FORWARD: 'FAST_FORWARD',
|
|
805
|
+
VOLUME: 'VOLUME',
|
|
806
|
+
UNMUTE: 'UNMUTE',
|
|
807
|
+
AIRPLAY: 'AIRPLAY',
|
|
808
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
809
809
|
};
|
|
@@ -483,7 +483,7 @@ shaka.util.Pssh.normaliseInitData=function(a){if(!a)return a;var b=new shaka.uti
|
|
|
483
483
|
SPDX-License-Identifier: MIT
|
|
484
484
|
*/
|
|
485
485
|
shaka.util.TXml=function(){};shaka.util.TXml.parseXml=function(a,b){a=shaka.util.StringUtils.fromBytesAutoDetect(a);return shaka.util.TXml.parseXmlString(a,b)};shaka.util.TXml.parseXmlString=function(a,b){a=shaka.util.TXml.parse(a);if(!b&&a.length)return a[0];if(a=a.find(function(c){return c.tagName===b}))return a;shaka.log.error("parseXml root element not found!");return null};
|
|
486
|
-
shaka.util.TXml.getKnownNameSpace=function(a){return shaka.util.TXml.
|
|
486
|
+
shaka.util.TXml.getKnownNameSpace=function(a){return shaka.util.TXml.uriToNameSpace_.has(a)?shaka.util.TXml.uriToNameSpace_.get(a):""};shaka.util.TXml.getKnownSchema=function(a){return shaka.util.TXml.nameSpaceToUri_.has(a)?shaka.util.TXml.nameSpaceToUri_.get(a):""};shaka.util.TXml.setKnownNameSpace=function(a,b){shaka.util.TXml.uriToNameSpace_.set(a,b);shaka.util.TXml.nameSpaceToUri_.set(b,a)};
|
|
487
487
|
shaka.util.TXml.parse=function(a){function b(e,f){f=void 0===f?!1:f;for(var g=[];a[d];)if(60==a.charCodeAt(d)){if(47===a.charCodeAt(d+1)){f=d+2;d=a.indexOf(">",d);f=a.substring(f,d);var h=f.indexOf(e);if(-1==h){var k=e.indexOf(".");0<k&&(e=e.substring(0,k),h=f.indexOf(e))}if(-1==h)throw g=a.substring(0,d).split("\n"),Error("Unexpected close tag\nLine: "+(g.length-1)+"\nColumn: "+(g[g.length-1].length+1)+"\nChar: "+a[d]);d+1&&(d+=1);break}else if(33===a.charCodeAt(d+1)){if(45==a.charCodeAt(d+2)){for(;-1!==
|
|
488
488
|
d&&(62!==a.charCodeAt(d)||45!=a.charCodeAt(d-1)||45!=a.charCodeAt(d-2)||-1==d);)d=a.indexOf(">",d+1);-1===d&&(d=a.length)}else if(91===a.charCodeAt(d+2)&&91===a.charCodeAt(d+8)&&"cdata"===a.substr(d+3,5).toLowerCase()){h=a.indexOf("]]\x3e",d);-1==h?(g.push(a.substr(d+9)),d=a.length):(g.push(a.substring(d+9,h)),d=h+3);continue}d++;continue}a:{k=f;d++;var l=c(),m={};for(h=[];62!==a.charCodeAt(d)&&a[d];){var n=a.charCodeAt(d);if(64<n&&91>n||96<n&&123>n){n=c();for(var p=a.charCodeAt(d);p&&39!==p&&34!==
|
|
489
489
|
p&&!(64<p&&91>p||96<p&&123>p)&&62!==p;)d++,p=a.charCodeAt(d);var q=d+1;d=a.indexOf(a[d],q);q=a.slice(q,d);if(39===p||34===p){if(-1===d){k={tagName:l,attributes:m,children:h,parent:null};for(l=0;l<h.length;l++)"string"!==typeof h[l]&&(h[l].parent=k);h=k;break a}}else q=null,d--;n.startsWith("xmlns:")&&(p=n.split(":"),shaka.util.TXml.setKnownNameSpace(q,p[1]));"tt"===l&&"xml:space"===n&&"preserve"===q&&(k=!0);m[n]=q}d++}47!==a.charCodeAt(d-1)?(d++,h=b(l,k)):d++;k={tagName:l,attributes:m,children:h,
|
|
@@ -501,7 +501,8 @@ shaka.util.TXml.parseXpath=function(a){var b=[];a=shaka.util.StringUtils.htmlUne
|
|
|
501
501
|
"")):null,position:h?Number(h[1])-1:null,attribute:c.split("/@")[1]||null})}else c.startsWith("@")&&b.length&&(b[b.length-1].attribute=c.slice(1))}return b};
|
|
502
502
|
shaka.util.TXml.modifyNodes=function(a,b){var c=shaka.util.TXml,d=c.parseXpath(b.attributes.sel||"");if(d.length){var e=d[d.length-1],f=b.attributes.pos||null;d=e.position;null==d&&(null!==e.t&&(d=c.nodePositionByAttribute_(a,"t",e.t)),null!==e.n&&(d=c.nodePositionByAttribute_(a,"n",e.n)));null===d?d="prepend"===f?0:a.length:"prepend"===f?--d:"after"===f&&++d;f=b.tagName;(e=e.attribute)&&a[d]?c.modifyNodeAttribute(a[d],f,e,c.getContents(b)||""):("remove"!==f&&"replace"!==f||a.splice(d,1),"add"!==
|
|
503
503
|
f&&"replace"!==f||a.splice.apply(a,[d,0].concat($jscomp.arrayFromIterable(b.children))))}};shaka.util.TXml.nodePositionByAttribute_=function(a,b,c){var d=0;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next()){if(Number(e.value.attributes[b])===c)return d;d++}return null};shaka.util.TXml.modifyNodeAttribute=function(a,b,c,d){if("remove"===b)delete a.attributes[c];else if("add"===b||"replace"===b)a.attributes[c]=d};
|
|
504
|
-
shaka.util.TXml.txmlNodeToDomElement=function(a){var b=shaka.util.TXml,c=document.createElementNS(
|
|
504
|
+
shaka.util.TXml.txmlNodeToDomElement=function(a){var b=shaka.util.TXml,c="",d=a.tagName.split(":");0<d.length&&(c=b.getKnownSchema(d[0]));c=document.createElementNS(c,a.tagName);for(var e in a.attributes)c.setAttribute(e,a.attributes[e]);a=$jscomp.makeIterator(a.children);for(e=a.next();!e.done;e=a.next())e=e.value,e="string"==typeof e?new Text(e):b.txmlNodeToDomElement(e),c.appendChild(e);return c};
|
|
505
|
+
shaka.util.TXml.cloneNode=function(a){if(!a)return null;var b={tagName:a.tagName,attributes:shaka.util.ObjectUtils.shallowCloneObject(a.attributes),children:[],parent:null};a=$jscomp.makeIterator(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,"string"===typeof c?b.children.push(c):(c=shaka.util.TXml.cloneNode(c),c.parent=b,b.children.push(c));return b};shaka.util.TXml.uriToNameSpace_=new Map;shaka.util.TXml.nameSpaceToUri_=new Map;shaka.media.DrmEngine=function(a){var b=this;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.storedPersistentSessions_=new Map;this.allSessionsLoaded_=new shaka.util.PublicPromise;this.config_=null;this.onError_=function(c){c.severity==shaka.util.Error.Severity.CRITICAL&&b.allSessionsLoaded_.reject(c);
|
|
505
506
|
a.onError(c)};this.keyStatusByKeyId_=new Map;this.announcedKeyStatusByKeyId_=new Map;this.keyStatusTimer_=new shaka.util.Timer(function(){return b.processKeyStatusChanges_()});this.usePersistentLicenses_=!1;this.mediaKeyMessageEvents_=[];this.initialRequestsSent_=!1;this.expirationTimer_=new shaka.util.Timer(function(){b.pollExpiration_()});this.allSessionsLoaded_.catch(function(){});this.destroyer_=new shaka.util.Destroyer(function(){return b.destroyNow_()});this.srcEquals_=!1;this.manifestInitData_=
|
|
506
507
|
this.mediaKeysAttached_=null};shaka.media.DrmEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
|
|
507
508
|
shaka.media.DrmEngine.prototype.destroyNow_=function(){var a=this,b;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){switch(c.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,c.yield(a.closeOpenSessions_(),2);case 2:if(!a.video_){c.jumpTo(3);break}shaka.util.Platform.isMediaKeysPolyfilled("webkit")||goog.asserts.assert(!a.video_.src,
|
|
@@ -931,8 +932,8 @@ shaka.media.QualityObserver.prototype.addMediaQualityChange=function(a,b){var c=
|
|
|
931
932
|
shaka.media.QualityObserver.mediaQualitiesAreTheSame_=function(a,b){return a===b?!0:a&&b?a.bandwidth==b.bandwidth&&a.audioSamplingRate==b.audioSamplingRate&&a.codecs==b.codecs&&a.contentType==b.contentType&&a.frameRate==b.frameRate&&a.height==b.height&&a.mimeType==b.mimeType&&a.channelsCount==b.channelsCount&&a.pixelAspectRatio==b.pixelAspectRatio&&a.width==b.width:!1};
|
|
932
933
|
shaka.media.QualityObserver.prototype.poll=function(a,b){b=$jscomp.makeIterator(this.contentTypeStates_.values());for(var c=b.next();!c.done;c=b.next()){c=c.value;var d=shaka.media.QualityObserver.getMediaQualityAtPosition_(a,c);d&&!shaka.media.QualityObserver.mediaQualitiesAreTheSame_(c.currentQuality,d)&&this.positionIsBuffered_(a,d.contentType)&&(c.currentQuality=d,shaka.log.debug("Media quality changed at position "+a+" "+JSON.stringify(d)),c=new shaka.util.FakeEvent("qualitychange",new Map([["quality",
|
|
933
934
|
d],["position",a]])),this.dispatchEvent(c))}};shaka.media.QualityObserver.prototype.positionIsBuffered_=function(a,b){if((b=this.getBufferedInfo_()[b])&&0<b.length){var c=b[b.length-1].end;if(a>=b[0].start&&a<c)return!0}return!1};
|
|
934
|
-
shaka.media.QualityObserver.prototype.purgeQualityChangePositions_=function(a){var b=this.getBufferedInfo_()[a.contentType];if(b&&0<b.length){var c=b[0].start,d=b[b.length-1].end,e=a.qualityChangePositions;a.qualityChangePositions=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else a.qualityChangePositions=[]};shaka.util.Networking=function(){};shaka.util.Networking.createSegmentRequest=function(a,b,c,d,e){a=shaka.net.NetworkingEngine.makeRequest(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};shaka.media.StreamingEngine=function(a,b){var c=this;this.playerInterface_=b;this.manifest_=a;this.config_=null;this.bufferingGoalScale_=1;this.currentTextStream_=this.currentVariant_=null;this.textStreamSequenceId_=0;this.parsedPrftEventRaised_=!1;this.mediaStates_=new Map;this.startupComplete_=!1;this.failureCallbackBackoff_=null;this.fatalError_=!1;this.destroyer_=new shaka.util.Destroyer(function(){return c.doDestroy_()});this.lastMediaSourceReset_=Date.now()/
|
|
935
|
-
this.spatialVideoInfo_={projection:null,hfov:null};this.playRangeStart_=0;this.playRangeEnd_=Infinity};shaka.media.StreamingEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
|
|
935
|
+
shaka.media.QualityObserver.prototype.purgeQualityChangePositions_=function(a){var b=this.getBufferedInfo_()[a.contentType];if(b&&0<b.length){var c=b[0].start,d=b[b.length-1].end,e=a.qualityChangePositions;a.qualityChangePositions=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else a.qualityChangePositions=[]};shaka.util.Networking=function(){};shaka.util.Networking.createSegmentRequest=function(a,b,c,d,e){a=shaka.net.NetworkingEngine.makeRequest(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};shaka.media.StreamingEngine=function(a,b){var c=this;this.playerInterface_=b;this.manifest_=a;this.config_=null;this.deferredCloseSegmentIndex_=new Map;this.bufferingGoalScale_=1;this.currentTextStream_=this.currentVariant_=null;this.textStreamSequenceId_=0;this.parsedPrftEventRaised_=!1;this.mediaStates_=new Map;this.startupComplete_=!1;this.failureCallbackBackoff_=null;this.fatalError_=!1;this.destroyer_=new shaka.util.Destroyer(function(){return c.doDestroy_()});this.lastMediaSourceReset_=Date.now()/
|
|
936
|
+
1E3;this.audioPrefetchMap_=new Map;this.spatialVideoInfo_={projection:null,hfov:null};this.playRangeStart_=0;this.playRangeEnd_=Infinity};shaka.media.StreamingEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
|
|
936
937
|
shaka.media.StreamingEngine.prototype.doDestroy_=function(){var a=this,b,c,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress){b=[];c=$jscomp.makeIterator(a.mediaStates_.values());for(d=c.next();!d.done;d=c.next())e=d.value,a.cancelUpdate_(e),b.push(a.abortOperations_(e)),e.segmentPrefetch&&(e.segmentPrefetch.clearAll(),e.segmentPrefetch=null);f=$jscomp.makeIterator(a.audioPrefetchMap_.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.clearAll();return k.yield(Promise.all(b),
|
|
937
938
|
2)}a.mediaStates_.clear();a.audioPrefetchMap_.clear();a.playerInterface_=null;a.manifest_=null;a.config_=null;k.jumpToEnd()})};
|
|
938
939
|
shaka.media.StreamingEngine.prototype.configure=function(a){this.config_=a;this.failureCallbackBackoff_=new shaka.net.Backoff({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);var b=shaka.util.ManifestParserUtils.ContentType;if(a.disableAudioPrefetch){var c=this.mediaStates_.get(b.AUDIO);c&&c.segmentPrefetch&&(c.segmentPrefetch.clearAll(),
|
|
@@ -947,11 +948,11 @@ shaka.media.StreamingEngine.prototype.unloadTextStream=function(){var a=shaka.ut
|
|
|
947
948
|
shaka.media.StreamingEngine.prototype.setTrickPlay=function(a){var b=shaka.util.ManifestParserUtils.ContentType;this.updateSegmentIteratorReverse_();if(b=this.mediaStates_.get(b.VIDEO)){var c=b.stream;if(c)if(shaka.log.debug("setTrickPlay",a),a)(a=c.trickModeVideo)&&!b.restoreStreamAfterTrickPlay&&(shaka.log.debug("Engaging trick mode stream",a),this.switchInternal_(a,!1,0,!1),b.restoreStreamAfterTrickPlay=c);else if(a=b.restoreStreamAfterTrickPlay)shaka.log.debug("Restoring non-trick-mode stream",
|
|
948
949
|
a),b.restoreStreamAfterTrickPlay=null,this.switchInternal_(a,!0,0,!1)}};shaka.media.StreamingEngine.prototype.switchVariant=function(a,b,c,d,e){b=void 0===b?!1:b;c=void 0===c?0:c;d=void 0===d?!1:d;e=void 0===e?!1:e;this.currentVariant_=a;this.startupComplete_&&(a.video&&this.switchInternal_(a.video,b,c,d,e),a.audio&&this.switchInternal_(a.audio,b,c,d,e))};
|
|
949
950
|
shaka.media.StreamingEngine.prototype.switchTextStream=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress){b.currentTextStream_=a;if(!b.startupComplete_)return d.return();c=shaka.util.ManifestParserUtils.ContentType;goog.asserts.assert(a&&a.type==c.TEXT,"Wrong stream type passed to switchTextStream!");return a.segmentIndex?d.jumpTo(2):d.yield(a.createSegmentIndex(),2)}b.switchInternal_(a,!0,0,!1);d.jumpToEnd()})};
|
|
950
|
-
shaka.media.StreamingEngine.prototype.reloadTextStream=function(){var a=this.mediaStates_.get(shaka.util.ManifestParserUtils.ContentType.TEXT);a&&this.switchInternal_(a.stream,!0,0,!0)};
|
|
951
|
+
shaka.media.StreamingEngine.prototype.reloadTextStream=function(){var a=this.mediaStates_.get(shaka.util.ManifestParserUtils.ContentType.TEXT);a&&this.switchInternal_(a.stream,!0,0,!0)};shaka.media.StreamingEngine.prototype.handleDeferredCloseSegmentIndexes_=function(a){for(var b=$jscomp.makeIterator(this.deferredCloseSegmentIndex_.entries()),c=b.next();!c.done;c=b.next()){var d=$jscomp.makeIterator(c.value);c=d.next().value;d=d.next().value;c.includes(a.type)&&(d(),this.deferredCloseSegmentIndex_.delete(c))}};
|
|
951
952
|
shaka.media.StreamingEngine.prototype.switchInternal_=function(a,b,c,d,e){var f=this,g=shaka.util.ManifestParserUtils.ContentType,h=this.mediaStates_.get(a.type);h||a.type!=g.TEXT?(goog.asserts.assert(h,"switch: expected mediaState to exist"),h&&(h.restoreStreamAfterTrickPlay&&(shaka.log.debug("switch during trick play mode",a),a.trickModeVideo?(h.restoreStreamAfterTrickPlay=a,a=a.trickModeVideo,shaka.log.debug("switch found trick play stream",a)):(h.restoreStreamAfterTrickPlay=null,shaka.log.debug("switch found no special trick play stream"))),
|
|
952
|
-
h.stream!=a||d?(this.audioPrefetchMap_.has(a)?h.segmentPrefetch=this.audioPrefetchMap_.get(a):h.segmentPrefetch&&h.segmentPrefetch.switchStream(a),a.type==g.TEXT&&(d=shaka.util.MimeUtils.getFullType(a.mimeType,a.codecs),this.playerInterface_.mediaSourceEngine.reinitText(d,this.manifest_.sequenceMode,a.external))
|
|
953
|
-
shaka.log.debug("switch: switching to Stream "+a),b?h.clearingBuffer?h.waitingToFlushBuffer=!0:h.performingUpdate?(h.waitingToClearBuffer=!0,h.clearBufferSafeMargin=c,h.waitingToFlushBuffer=!0):(this.cancelUpdate_(h),this.clearBuffer_(h,!0,c).catch(function(k){f.playerInterface_&&(goog.asserts.assert(k instanceof shaka.util.Error,"Wrong error type!"),
|
|
954
|
-
(goog.asserts.assert(k instanceof shaka.util.Error,"Wrong error type!"),f.playerInterface_.onError(k))})):(b=shaka.media.StreamingEngine.logPrefix_(h),shaka.log.debug("switch: Stream "+b+" already active")))):this.loadNewTextStream_(a)};
|
|
953
|
+
h.stream!=a||d?(this.audioPrefetchMap_.has(a)?h.segmentPrefetch=this.audioPrefetchMap_.get(a):h.segmentPrefetch&&h.segmentPrefetch.switchStream(a),a.type==g.TEXT&&(d=shaka.util.MimeUtils.getFullType(a.mimeType,a.codecs),this.playerInterface_.mediaSourceEngine.reinitText(d,this.manifest_.sequenceMode,a.external)),!this.audioPrefetchMap_.has(h.stream)&&h.stream.closeSegmentIndex&&(h.performingUpdate?(d=shaka.media.StreamingEngine.logPrefix_(h),this.deferredCloseSegmentIndex_.has(d)||this.deferredCloseSegmentIndex_.set(d,
|
|
954
|
+
h.stream.closeSegmentIndex)):h.stream.closeSegmentIndex()),h.stream=a,h.segmentIterator=null,h.adaptation=!!e,a=shaka.media.StreamingEngine.logPrefix_(h),shaka.log.debug("switch: switching to Stream "+a),b?h.clearingBuffer?h.waitingToFlushBuffer=!0:h.performingUpdate?(h.waitingToClearBuffer=!0,h.clearBufferSafeMargin=c,h.waitingToFlushBuffer=!0):(this.cancelUpdate_(h),this.clearBuffer_(h,!0,c).catch(function(k){f.playerInterface_&&(goog.asserts.assert(k instanceof shaka.util.Error,"Wrong error type!"),
|
|
955
|
+
f.playerInterface_.onError(k))})):h.performingUpdate||h.updateTimer||this.scheduleUpdate_(h,0),this.makeAbortDecision_(h).catch(function(k){f.playerInterface_&&(goog.asserts.assert(k instanceof shaka.util.Error,"Wrong error type!"),f.playerInterface_.onError(k))})):(b=shaka.media.StreamingEngine.logPrefix_(h),shaka.log.debug("switch: Stream "+b+" already active")))):this.loadNewTextStream_(a)};
|
|
955
956
|
shaka.media.StreamingEngine.prototype.makeAbortDecision_=function(a){var b=this,c,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress){if(!a.operation)return e.return();c=a.stream;d=a.operation;return c.segmentIndex?e.jumpTo(2):e.yield(c.createSegmentIndex(),2)}if(a.operation!=d||a.stream!=c)return e.return();goog.asserts.assert(a.stream.segmentIndex,"Segment index should exist by now!");b.shouldAbortCurrentRequest_(a)&&(shaka.log.info("Aborting current segment request."),
|
|
956
957
|
a.operation.abort());e.jumpToEnd()})};
|
|
957
958
|
shaka.media.StreamingEngine.prototype.shouldAbortCurrentRequest_=function(a){goog.asserts.assert(a.operation,"Abort logic requires an ongoing operation!");goog.asserts.assert(a.stream&&a.stream.segmentIndex,"Abort logic requires a segment index");var b=this.playerInterface_.getPresentationTime(),c=this.playerInterface_.mediaSourceEngine.bufferEnd(a.type),d=this.getTimeNeeded_(a,b);d=a.stream.segmentIndex.find(d);var e=null==d?null:a.stream.segmentIndex.get(d);d=e?e.getSize():null;e&&!d&&(d=(e.getEndTime()-
|
|
@@ -971,17 +972,17 @@ shaka.media.StreamingEngine.prototype.updatePrefetchMapForAudio_=function(){for(
|
|
|
971
972
|
k)}}(f)))){var g=this.mediaStates_.get(f.variant$jscomp$56.audio.type);e!==(g&&g.segmentPrefetch)&&e.clearAll();this.audioPrefetchMap_.delete(f.variant$jscomp$56.audio)}}else 0>=a||!b.some(function(h){return function(k){return c.areLanguageCompatible(h.variant$jscomp$56.audio.language,k)}}(f))||!(e=this.createSegmentPrefetch_(f.variant$jscomp$56.audio))||(f.variant$jscomp$56.audio.segmentIndex||f.variant$jscomp$56.audio.createSegmentIndex(),this.audioPrefetchMap_.set(f.variant$jscomp$56.audio,e))};
|
|
972
973
|
shaka.media.StreamingEngine.prototype.updateDuration=function(){var a=this.manifest_.presentationTimeline.getDuration();Infinity>a?this.playerInterface_.mediaSourceEngine.setDuration(a):this.playerInterface_.mediaSourceEngine.setDuration(this.config_.infiniteLiveStreamDuration?Infinity:Math.pow(2,32))};
|
|
973
974
|
shaka.media.StreamingEngine.prototype.onUpdate_=function(a){var b=this,c,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){switch(k.nextAddress){case 1:b.destroyer_.ensureNotDestroyed();c=shaka.media.StreamingEngine.logPrefix_(a);goog.asserts.assert(!a.performingUpdate&&null!=a.updateTimer,c+" unexpected call to onUpdate_()");if(a.performingUpdate||null==a.updateTimer)return k.return();goog.asserts.assert(!a.clearingBuffer,c+" onUpdate_() should not be called when clearing the buffer");
|
|
974
|
-
if(a.clearingBuffer)return k.return();a.updateTimer=null;if(!a.waitingToClearBuffer){k.jumpTo(2);break}shaka.log.debug(c,"skipping update and clearing the buffer");return k.yield(b.clearBuffer_(a,a.waitingToFlushBuffer,a.clearBufferSafeMargin),3);case 3:return k.return();case 2:if(a.stream.segmentIndex){k.jumpTo(4);break}d=a.stream;return k.yield(a.stream.createSegmentIndex(),5);case 5:if(d!=a.stream)return d.closeSegmentIndex&&(goog.asserts.assert(!a.stream.segmentIndex,
|
|
975
|
-
d.closeSegmentIndex()),a.performingUpdate||a.updateTimer||b.scheduleUpdate_(a,0),k.return();case 4:k.setCatchFinallyBlocks(6);e=b.update_(a);null!=e&&(b.scheduleUpdate_(a,e),a.hasError=!1);k.leaveTryBlock(7);break;case 6:return f=k.enterCatchBlock(),k.yield(b.handleStreamingError_(a,f),8);case 8:return k.return();case 7:g=Array.from(b.mediaStates_.values());if(!b.startupComplete_||!g.every(function(l){return l.endOfStream})){k.jumpTo(0);break}shaka.log.v1(c,
|
|
976
|
-
10);case 10:b.destroyer_.ensureNotDestroyed(),h=b.playerInterface_.mediaSourceEngine.getDuration(),0!=h&&h<b.manifest_.presentationTimeline.getDuration()&&b.manifest_.presentationTimeline.setDuration(h),k.jumpToEnd()}})};
|
|
975
|
+
if(a.clearingBuffer)return k.return();a.updateTimer=null;if(!a.waitingToClearBuffer){k.jumpTo(2);break}shaka.log.debug(c,"skipping update and clearing the buffer");return k.yield(b.clearBuffer_(a,a.waitingToFlushBuffer,a.clearBufferSafeMargin),3);case 3:return k.return();case 2:b.handleDeferredCloseSegmentIndexes_(a);if(a.stream.segmentIndex){k.jumpTo(4);break}d=a.stream;return k.yield(a.stream.createSegmentIndex(),5);case 5:if(d!=a.stream)return d.closeSegmentIndex&&(goog.asserts.assert(!a.stream.segmentIndex,
|
|
976
|
+
"mediastate.stream should not have segmentIndex yet."),d.closeSegmentIndex()),a.performingUpdate||a.updateTimer||b.scheduleUpdate_(a,0),k.return();case 4:k.setCatchFinallyBlocks(6);e=b.update_(a);null!=e&&(b.scheduleUpdate_(a,e),a.hasError=!1);k.leaveTryBlock(7);break;case 6:return f=k.enterCatchBlock(),k.yield(b.handleStreamingError_(a,f),8);case 8:return k.return();case 7:g=Array.from(b.mediaStates_.values());if(!b.startupComplete_||!g.every(function(l){return l.endOfStream})){k.jumpTo(0);break}shaka.log.v1(c,
|
|
977
|
+
"calling endOfStream()...");return k.yield(b.playerInterface_.mediaSourceEngine.endOfStream(),10);case 10:b.destroyer_.ensureNotDestroyed(),h=b.playerInterface_.mediaSourceEngine.getDuration(),0!=h&&h<b.manifest_.presentationTimeline.getDuration()&&b.manifest_.presentationTimeline.setDuration(h),k.jumpToEnd()}})};
|
|
977
978
|
shaka.media.StreamingEngine.prototype.update_=function(a){goog.asserts.assert(this.manifest_,"manifest_ should not be null");goog.asserts.assert(this.config_,"config_ should not be null");var b=shaka.util.ManifestParserUtils.ContentType;if(shaka.media.StreamingEngine.isEmbeddedText_(a))return this.playerInterface_.mediaSourceEngine.setSelectedClosedCaptionId(a.stream.originalId||""),null;a.type==b.TEXT&&this.playerInterface_.mediaSourceEngine.clearSelectedClosedCaptionId();if(!this.playerInterface_.mediaSourceEngine.isStreamingAllowed()&&
|
|
978
979
|
a.type!=b.TEXT)return this.config_.updateIntervalSeconds/2;var c=shaka.media.StreamingEngine.logPrefix_(a),d=this.playerInterface_.getPresentationTime();if(a.type===b.AUDIO)for(var e=$jscomp.makeIterator(this.audioPrefetchMap_.keys()),f=e.next();!f.done;f=e.next())f=this.audioPrefetchMap_.get(f.value),f.evict(d,!0),f.prefetchSegmentsByTime(d);e=this.getTimeNeeded_(a,d);shaka.log.v2(c,"timeNeeded="+e);var g=this.playerInterface_.mediaSourceEngine.bufferedAheadOf(a.type,d);shaka.log.v2(c,"update_:",
|
|
979
980
|
"presentationTime="+d,"bufferedAhead="+g);var h=Math.max(1,Math.max(this.manifest_.minBufferTime||0,this.config_.rebufferingGoal,this.config_.bufferingGoal)*this.bufferingGoalScale_),k=this.manifest_.presentationTimeline.getDuration()-e;f=this.playerInterface_.mediaSourceEngine.bufferEnd(a.type);if(1E-6>k&&f)return shaka.log.debug(c,"buffered to end of presentation"),a.endOfStream=!0,a.type==b.VIDEO&&(a=this.mediaStates_.get(b.TEXT))&&shaka.media.StreamingEngine.isEmbeddedText_(a)&&(a.endOfStream=
|
|
980
981
|
!0),null;a.endOfStream=!1;if(g>=h)return shaka.log.v2(c,"buffering goal met"),this.config_.updateIntervalSeconds/2;g=!a.segmentIterator;b=this.getSegmentReferenceNeeded_(a,d,f);if(!b)return this.config_.updateIntervalSeconds;f=!1;g&&a.adaptation&&(f=!0,a.adaptation=!1);g=Infinity;h=Array.from(this.mediaStates_.values());h=$jscomp.makeIterator(h);for(k=h.next();!k.done;k=h.next())k=k.value,shaka.media.StreamingEngine.isEmbeddedText_(k)||k.segmentIterator&&!k.segmentIterator.current()||(k=this.getTimeNeeded_(k,
|
|
981
982
|
d),g=Math.min(g,k));h=this.manifest_.presentationTimeline.getMaxSegmentDuration()*shaka.media.StreamingEngine.MAX_RUN_AHEAD_SEGMENTS_;if(e>=g+h)return shaka.log.v2(c,"waiting for other streams to buffer"),this.config_.updateIntervalSeconds;a.segmentPrefetch&&a.segmentIterator&&!this.audioPrefetchMap_.has(a.stream)&&(a.segmentPrefetch.evict(b.startTime),a.segmentPrefetch.prefetchSegmentsByTime(b.startTime));this.fetchAndAppend_(a,d,b,f).catch(function(){});return null};
|
|
982
983
|
shaka.media.StreamingEngine.prototype.getTimeNeeded_=function(a,b){return a.lastSegmentReference?a.lastSegmentReference.endTime:b};
|
|
983
|
-
shaka.media.StreamingEngine.prototype.getSegmentReferenceNeeded_=function(a,b,c){var d=shaka.media.StreamingEngine.logPrefix_(a);goog.asserts.assert(a.stream.segmentIndex,"segment index should have been generated already");
|
|
984
|
-
|
|
984
|
+
shaka.media.StreamingEngine.prototype.getSegmentReferenceNeeded_=function(a,b,c){var d=shaka.media.StreamingEngine.logPrefix_(a);goog.asserts.assert(a.stream.segmentIndex,"segment index should have been generated already");if(a.segmentIterator)return a.segmentIterator.current();if(a.lastSegmentReference||c)return b=a.lastSegmentReference?a.lastSegmentReference.endTime:c,goog.asserts.assert(null!=b,"Should have a time to search"),shaka.log.v1(d,"looking up segment from new stream endTime:",b),c=0>
|
|
985
|
+
this.playerInterface_.getPlaybackRate(),a.segmentIterator=a.stream.segmentIndex.getIteratorForTime(b,!1,c),a=a.segmentIterator&&a.segmentIterator.next().value,null==a&&shaka.log.warning(d,"cannot find segment","endTime:",b),a;c=this.manifest_.sequenceMode?0:this.config_.inaccurateManifestTolerance;var e=Math.max(b-c,0);shaka.log.v1(d,"looking up segment","lookupTime:",e,"presentationTime:",b);var f=0>this.playerInterface_.getPlaybackRate(),g=null;c&&(a.segmentIterator=a.stream.segmentIndex.getIteratorForTime(e,
|
|
985
986
|
!1,f),g=a.segmentIterator&&a.segmentIterator.next().value);g||(a.segmentIterator=a.stream.segmentIndex.getIteratorForTime(b,!1,f),g=a.segmentIterator&&a.segmentIterator.next().value);null==g&&shaka.log.warning(d,"cannot find segment","lookupTime:",e,"presentationTime:",b);return g};
|
|
986
987
|
shaka.media.StreamingEngine.prototype.fetchAndAppend_=function(a,b,c,d){var e=this,f,g,h,k,l,m,n,p,q,r,t,v,w,y,x,u,z,F,B;return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){switch(A.nextAddress){case 1:f=shaka.util.ManifestParserUtils.ContentType;g=shaka.media.StreamingEngine;h=g.logPrefix_(a);shaka.log.v1(h,"fetchAndAppend_:","presentationTime="+b,"reference.startTime="+c.startTime,"reference.endTime="+c.endTime);k=a.stream;l=a.segmentIterator;a.performingUpdate=!0;A.setCatchFinallyBlocks(2);
|
|
987
988
|
if(c.getStatus()==shaka.media.SegmentReference.Status.MISSING)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.SEGMENT_MISSING);return A.yield(e.initSourceBuffer_(a,c,d),4);case 4:e.destroyer_.ensureNotDestroyed();if(e.fatalError_)return A.return();shaka.log.v2(h,"fetching segment");m="video/mp4"==k.mimeType||"audio/mp4"==k.mimeType;n=window.ReadableStream;if(e.config_.lowLatencyMode&&n&&m&&(e.manifest_.type!=shaka.media.ManifestParser.HLS||
|
|
@@ -1026,8 +1027,8 @@ a.segmentPrefetch&&!d.audioPrefetchMap_.has(a.stream)&&a.segmentPrefetch.clearAl
|
|
|
1026
1027
|
shaka.media.StreamingEngine.prototype.scheduleUpdate_=function(a,b){var c=this,d=shaka.media.StreamingEngine.logPrefix_(a),e=a.type;e!=shaka.util.ManifestParserUtils.ContentType.TEXT||this.mediaStates_.has(e)?(shaka.log.v2(d,"updating in "+b+" seconds"),goog.asserts.assert(null==a.updateTimer,d+" did not expect update to be scheduled"),a.updateTimer=(new shaka.util.DelayedTick(function(){var f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){if(1==g.nextAddress)return g.setCatchFinallyBlocks(2),
|
|
1027
1028
|
g.yield(c.onUpdate_(a),4);if(2!=g.nextAddress)return g.leaveTryBlock(0);f=g.enterCatchBlock();if(c.playerInterface_)c.playerInterface_.onError(f);g.jumpToEnd()})})).tickAfter(b)):shaka.log.v1(d,"Text stream is unloaded. No update is needed.")};shaka.media.StreamingEngine.prototype.cancelUpdate_=function(a){null!=a.updateTimer&&(a.updateTimer.stop(),a.updateTimer=null)};
|
|
1028
1029
|
shaka.media.StreamingEngine.prototype.abortOperations_=function(a){return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){return a.operation?b.yield(a.operation.abort(),0):b.jumpTo(0)})};
|
|
1029
|
-
shaka.media.StreamingEngine.prototype.handleStreamingError_=function(a,b){var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress)return e.yield(c.failureCallbackBackoff_.attempt(),2);c.destroyer_.ensureNotDestroyed();b.category===shaka.util.Error.Category.NETWORK
|
|
1030
|
-
b.handled||c.config_.failureCallback(b);e.jumpToEnd()})};shaka.media.StreamingEngine.prototype.getDisabledTime_=function(a){return 0===this.config_.maxDisabledTime&&a.code==shaka.util.Error.Code.SEGMENT_MISSING?1:this.config_.maxDisabledTime};
|
|
1030
|
+
shaka.media.StreamingEngine.prototype.handleStreamingError_=function(a,b){var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress)return e.yield(c.failureCallbackBackoff_.attempt(),2);c.destroyer_.ensureNotDestroyed();if(b.category===shaka.util.Error.Category.NETWORK){if(a.restoreStreamAfterTrickPlay)return c.setTrickPlay(!1),e.return();d=c.getDisabledTime_(b);b.handled=c.playerInterface_.disableStream(a.stream,d);b.handled&&(b.severity=shaka.util.Error.Severity.RECOVERABLE)}if(!b.handled||
|
|
1031
|
+
b.code!=shaka.util.Error.Code.SEGMENT_MISSING)c.playerInterface_.onError(b);b.handled||c.config_.failureCallback(b);e.jumpToEnd()})};shaka.media.StreamingEngine.prototype.getDisabledTime_=function(a){return 0===this.config_.maxDisabledTime&&a.code==shaka.util.Error.Code.SEGMENT_MISSING?1:this.config_.maxDisabledTime};
|
|
1031
1032
|
shaka.media.StreamingEngine.prototype.resetMediaSource=function(){var a=this,b,c,d,e,f,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){if(1==h.nextAddress){b=Date.now()/1E3;c=a.config_.minTimeBetweenRecoveries;if(!a.config_.allowMediaSourceRecoveries||b-a.lastMediaSourceReset_<c)return h.return(!1);a.lastMediaSourceReset_=b;d=shaka.util.ManifestParserUtils.ContentType;if(e=a.mediaStates_.get(d.AUDIO))e.lastInitSegmentReference=null,a.forceClearBuffer_(e),a.abortOperations_(e).catch(function(){});
|
|
1032
1033
|
if(f=a.mediaStates_.get(d.VIDEO))f.lastInitSegmentReference=null,a.forceClearBuffer_(f),a.abortOperations_(f).catch(function(){});g=new Map;a.currentVariant_.audio&&g.set(d.AUDIO,a.currentVariant_.audio);a.currentVariant_.video&&g.set(d.VIDEO,a.currentVariant_.video);return h.yield(a.playerInterface_.mediaSourceEngine.reset(g),2)}return h.return(!0)})};
|
|
1033
1034
|
shaka.media.StreamingEngine.prototype.updateSpatialVideoInfo_=function(a){if(this.spatialVideoInfo_.projection!=a.projection||this.spatialVideoInfo_.hfov!=a.hfov){var b=shaka.util.FakeEvent.EventName;if(null!=a.projection||null!=a.hfov){b=b.SpatialVideoInfoEvent;var c=(new Map).set("detail",a);b=new shaka.util.FakeEvent(b,c)}else b=new shaka.util.FakeEvent(b.NoSpatialVideoInfoEvent);b.cancelable=!0;this.playerInterface_.onEvent(b);this.spatialVideoInfo_=a}};
|
|
@@ -1356,7 +1357,7 @@ shaka.Player.prototype.getBufferedInfo=function(){if(this.loadMode_==shaka.Playe
|
|
|
1356
1357
|
shaka.Player.prototype.getStats=function(){if(this.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&this.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)return shaka.util.Stats.getEmptyBlob();this.updateStateHistory_();goog.asserts.assert(this.video_,"If we have stats, we should have video_");var a=this.video_,b=a.currentTime/a.duration;isNaN(b)||this.isLive()||this.stats_.setCompletionPercent(Math.round(100*b));this.playhead_&&(this.stats_.setGapsJumped(this.playhead_.getGapsJumped()),this.stats_.setStallsDetected(this.playhead_.getStallsDetected()));
|
|
1357
1358
|
a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),this.stats_.setDroppedFrames(Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.stats_.setCorruptedFrames(Number(b.corruptedVideoFrames)));b=this.drmEngine_?this.drmEngine_.getLicenseTime():NaN;this.stats_.setLicenseTime(b);if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE){b=this.streamingEngine_.getCurrentVariant();var c=this.streamingEngine_.getCurrentTextStream();if(b){var d=this.playRateController_?this.playRateController_.getRealRate():
|
|
1358
1359
|
1,e=d*b.bandwidth;c&&c.bandwidth&&(e+=d*c.bandwidth);this.stats_.setCurrentStreamBandwidth(e)}b&&b.video&&this.stats_.setResolution(b.video.width||NaN,b.video.height||NaN);this.isLive()&&(b=this.getPresentationStartTimeAsDate().valueOf()+1E3*a.currentTime,b=(Date.now()-b)/1E3,this.stats_.setLiveLatency(b));this.manifest_&&this.manifest_.presentationTimeline&&(b=this.manifest_.presentationTimeline.getMaxSegmentDuration(),this.stats_.setMaxSegmentDuration(b));b=this.abrManager_.getBandwidthEstimate();
|
|
1359
|
-
this.stats_.setBandwidthEstimate(b)}this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&this.stats_.setResolution(a.videoWidth||NaN,a.videoHeight||NaN);return this.stats_.getBlob()};
|
|
1360
|
+
this.stats_.setBandwidthEstimate(b)}this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&(this.stats_.addBytesDownloaded(NaN),this.stats_.setResolution(a.videoWidth||NaN,a.videoHeight||NaN));return this.stats_.getBlob()};
|
|
1360
1361
|
shaka.Player.prototype.addTextTrackAsync=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,p,q,r,t,v,w,y,x,u;return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){switch(z.nextAddress){case 1:if(h.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&h.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)throw shaka.log.error("Must call load() and wait for it to resolve before adding text tracks."),new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.CONTENT_NOT_LOADED);
|
|
1361
1362
|
"subtitles"!=c&&"captions"!=c&&shaka.log.alwaysWarn("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");if(d){z.jumpTo(2);break}return z.yield(h.getTextMimetype_(a),3);case 3:d=z.yieldResult;case 2:k=[];h.adManager_&&(k=h.adManager_.getCuePoints());if(h.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS){z.jumpTo(4);break}g&&(c="forced");return z.yield(h.addSrcTrackElement_(a,b,c,d,f||"",k),5);case 5:l=shaka.util.LanguageUtils;m=l.normalize(b);n=h.getTextTracks();if(p=
|
|
1362
1363
|
n.find(function(F){return l.normalize(F.language)==m&&F.label==(f||"")&&F.kind==c}))return h.onTracksChanged_(),z.return(p);shaka.log.error("Cannot add this text when loaded with src=");throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS);case 4:q=shaka.util.ManifestParserUtils.ContentType;r=h.video_.duration;h.manifest_&&(r=h.manifest_.presentationTimeline.getDuration());if(Infinity==r)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,
|
|
@@ -1417,8 +1418,8 @@ shaka.Player.prototype.onAdaptation_=function(a,b){a=(new Map).set("oldTrack",a)
|
|
|
1417
1418
|
shaka.Player.prototype.onVariantChanged_=function(a,b){a=(new Map).set("oldTrack",a).set("newTrack",b);this.lcevcDec_&&this.lcevcDec_.updateVariant(b,this.getManifestType());b=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.VariantChanged,a);this.delayDispatchEvent_(b)};shaka.Player.prototype.onTextChanged_=function(){var a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.TextChanged);this.delayDispatchEvent_(a)};
|
|
1418
1419
|
shaka.Player.prototype.onTextTrackVisibility_=function(){var a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.TextTrackVisibility);this.delayDispatchEvent_(a)};shaka.Player.prototype.onAbrStatusChanged_=function(){this.config_.abr.enabled||this.restoreDisabledVariants_();var a=(new Map).set("newStatus",this.config_.abr.enabled);this.delayDispatchEvent_(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.AbrStatusChanged,a))};
|
|
1419
1420
|
shaka.Player.prototype.restoreDisabledVariants_=function(a){a=void 0===a?!0:a;if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE){goog.asserts.assert(this.manifest_,"Should have manifest!");shaka.log.v2("Restoring all disabled streams...");this.checkVariantsTimer_.stop();for(var b=$jscomp.makeIterator(this.manifest_.variants),c=b.next();!c.done;c=b.next())c.value.disabledUntilTime=0;a&&this.updateAbrManagerVariants_()}};
|
|
1420
|
-
shaka.Player.prototype.disableStream=function(a,b){if(!this.config_.abr.enabled||this.loadMode_===shaka.Player.LoadMode.DESTROYED||!navigator.onLine||0==b)return!1;if(this.manifest_.variants.some(function(
|
|
1421
|
-
a.type+":"+a.id+" for "+b+" seconds..."))}goog.asserts.assert(c,"Must have disabled stream");this.checkVariantsTimer_.tickEvery(1);b=this.getBufferedInfo().video.reduce(function(
|
|
1421
|
+
shaka.Player.prototype.disableStream=function(a,b){if(!this.config_.abr.enabled||this.loadMode_===shaka.Player.LoadMode.DESTROYED||!navigator.onLine||0==b)return!1;if(this.manifest_.variants.some(function(h){return(h=h[a.type])&&h.id!==a.id?shaka.util.StreamUtils.isAudio(a)?a.language===h.language:!0:!1})){for(var c=!1,d=!1,e=$jscomp.makeIterator(this.manifest_.variants),f=e.next();!f.done;f=e.next()){f=f.value;var g=f[a.type];g&&(g.id===a.id?(f.disabledUntilTime=Date.now()/1E3+b,c=!0,shaka.log.v2("Disabled stream "+
|
|
1422
|
+
a.type+":"+a.id+" for "+b+" seconds...")):g.trickModeVideo&&g.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;goog.asserts.assert(c,"Must have disabled stream");this.checkVariantsTimer_.tickEvery(1);b=this.getBufferedInfo().video.reduce(function(h,k){return h+k.end-k.start},0);this.chooseVariantAndSwitch_(!1,b,!0,!1);return!0}shaka.log.warning("No alternate stream found for active "+a.type+" stream. Will ignore request to disable stream...");return!1};
|
|
1422
1423
|
shaka.Player.prototype.onError_=function(a){var b=this,c,d,e,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){switch(g.nextAddress){case 1:goog.asserts.assert(a instanceof shaka.util.Error,"Wrong error type!");if(b.loadMode_==shaka.Player.LoadMode.DESTROYED)return g.return();c=!0;if(!(b.fullyLoaded_&&b.manifest_&&b.streamingEngine_)||a.code!=shaka.util.Error.Code.VIDEO_ERROR&&a.code!=shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED&&a.code!=shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW&&
|
|
1423
1424
|
a.code!=shaka.util.Error.Code.TRANSMUXING_FAILED){g.jumpTo(2);break}g.setCatchFinallyBlocks(3);return g.yield(b.streamingEngine_.resetMediaSource(),5);case 5:d=g.yieldResult;c=!d;g.leaveTryBlock(2);break;case 3:g.enterCatchBlock(),c=!0;case 2:if(!c)return g.return();a.severity===shaka.util.Error.Severity.CRITICAL&&b.restoreDisabledVariants_(!1);e=shaka.util.FakeEvent.EventName.Error;f=shaka.Player.makeEvent_(e,(new Map).set("detail",a));b.dispatchEvent(f);f.defaultPrevented&&(a.handled=!0);g.jumpToEnd()}})};
|
|
1424
1425
|
shaka.Player.prototype.onRegionEvent_=function(a,b,c){c=void 0===c?this:c;b={schemeIdUri:b.schemeIdUri,value:b.value,startTime:b.startTime,endTime:b.endTime,id:b.id,eventElement:b.eventElement,eventNode:b.eventNode};b=(new Map).set("detail",b);c.dispatchEvent(shaka.Player.makeEvent_(a,b))};
|
|
@@ -1450,7 +1451,7 @@ goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.pro
|
|
|
1450
1451
|
goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);
|
|
1451
1452
|
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,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);
|
|
1452
1453
|
goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);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);
|
|
1453
|
-
shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.
|
|
1454
|
+
shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.25-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.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_++};
|
|
1454
1455
|
shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_}};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.getDuration=function(){return this.ad_.getDuration()};
|
|
1455
1456
|
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_};shaka.ads.ClientSideAd.prototype.isSkippable=function(){return 0<=this.ad_.getSkipTimeOffset()};
|
|
1456
1457
|
shaka.ads.ClientSideAd.prototype.getTimeUntilSkippable=function(){var a=this.ad_.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};shaka.ads.ClientSideAd.prototype.canSkipNow=function(){return this.manager_.getAdSkippableState()};shaka.ads.ClientSideAd.prototype.skip=function(){return this.manager_.skip()};shaka.ads.ClientSideAd.prototype.setPaused=function(a){this.isPaused_=a};shaka.ads.ClientSideAd.prototype.pause=function(){return this.manager_.pause()};
|
|
@@ -1816,8 +1817,8 @@ shaka.dash.MpdUtils.inheritAttribute=function(a,b,c){b=shaka.dash.MpdUtils.getNo
|
|
|
1816
1817
|
shaka.dash.MpdUtils.handleXlinkInElement_=function(a,b,c,d,e,f){for(var g=shaka.util.TXml,h=shaka.util.Error,k=shaka.util.ManifestParserUtils,l=shaka.dash.MpdUtils.XlinkNamespaceUri_,m=g.getAttributeNS(a,l,"href"),n=g.getAttributeNS(a,l,"actuate")||"onRequest",p=$jscomp.makeIterator(Object.keys(a.attributes)),q=p.next();!q.done;q=p.next()){q=q.value;var r=q.split(":"),t=shaka.util.TXml.getKnownNameSpace(l);r[0]==t&&delete a.attributes[q]}if(5<=f)return shaka.util.AbortableOperation.failed(new h(h.Severity.CRITICAL,
|
|
1817
1818
|
h.Category.MANIFEST,h.Code.DASH_XLINK_DEPTH_LIMIT));if("onLoad"!=n)return shaka.util.AbortableOperation.failed(new h(h.Severity.CRITICAL,h.Category.MANIFEST,h.Code.DASH_UNSUPPORTED_XLINK_ACTUATE));var v=k.resolveUris([d],[m]);d=shaka.net.NetworkingEngine.RequestType.MANIFEST;k=shaka.net.NetworkingEngine.makeRequest(v,b);d=e.request(d,k);goog.asserts.assert(d instanceof shaka.util.AbortableOperation,"Unexpected implementation of IAbortableOperation!");return d.chain(function(w){w=g.parseXml(w.data,
|
|
1818
1819
|
a.tagName);if(!w)return shaka.util.AbortableOperation.failed(new h(h.Severity.CRITICAL,h.Category.MANIFEST,h.Code.DASH_INVALID_XML,m));for(a.children=[];w.children.length;){var y=w.children.shift();g.isNode(y)&&(y.parent=a);a.children.push(y)}y=$jscomp.makeIterator(Object.keys(w.attributes));for(var x=y.next();!x.done;x=y.next())x=x.value,a.attributes[x]=w.attributes[x];return shaka.dash.MpdUtils.processXlinks(a,b,c,v[0],e,f+1)})};
|
|
1819
|
-
shaka.dash.MpdUtils.processXlinks=function(a,b,c,d,e,f){f=void 0===f?0:f;var g=shaka.dash.MpdUtils,h=shaka.util.TXml,k=g.XlinkNamespaceUri_;if(h.getAttributeNS(a,k,"href"))return h=g.handleXlinkInElement_(a,b,c,d,e,f),c&&(h=h.chain(void 0,function(q){return g.processXlinks(a,b,c,d,e,f)})),h;for(var l=[],m=$jscomp.makeIterator(shaka.util.TXml.getChildNodes(a)),n=m.next(),p={};!n.done;p={child$jscomp$
|
|
1820
|
-
k,"href")?a.children=a.children.filter(function(q){return function(r){return r!==q.child$jscomp$
|
|
1820
|
+
shaka.dash.MpdUtils.processXlinks=function(a,b,c,d,e,f){f=void 0===f?0:f;var g=shaka.dash.MpdUtils,h=shaka.util.TXml,k=g.XlinkNamespaceUri_;if(h.getAttributeNS(a,k,"href"))return h=g.handleXlinkInElement_(a,b,c,d,e,f),c&&(h=h.chain(void 0,function(q){return g.processXlinks(a,b,c,d,e,f)})),h;for(var l=[],m=$jscomp.makeIterator(shaka.util.TXml.getChildNodes(a)),n=m.next(),p={};!n.done;p={child$jscomp$9:void 0},n=m.next())p.child$jscomp$9=n.value,"urn:mpeg:dash:resolve-to-zero:2013"==h.getAttributeNS(p.child$jscomp$9,
|
|
1821
|
+
k,"href")?a.children=a.children.filter(function(q){return function(r){return r!==q.child$jscomp$9}}(p)):"SegmentTimeline"!=p.child$jscomp$9.tagName&&l.push(shaka.dash.MpdUtils.processXlinks(p.child$jscomp$9,b,c,d,e,f));return shaka.util.AbortableOperation.all(l).chain(function(){return a})};shaka.dash.MpdUtils.XlinkNamespaceUri_="http://www.w3.org/1999/xlink";shaka.media.Mp4SegmentIndexParser=function(){};shaka.media.Mp4SegmentIndexParser.parse=function(a,b,c,d,e,f,g){var h=shaka.media.Mp4SegmentIndexParser,k,l=(new shaka.util.Mp4Parser).fullBox("sidx",function(m){k=h.parseSIDX_(b,d,e,f,g,c,m)});a&&l.parse(a);if(k)return k;shaka.log.error('Invalid box type, expected "sidx".');throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MEDIA,shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE);};
|
|
1821
1822
|
shaka.media.Mp4SegmentIndexParser.parseSIDX_=function(a,b,c,d,e,f,g){goog.asserts.assert(null!=g.version,"SIDX is a full box and should have a valid version.");var h=[];g.reader.skip(4);var k=g.reader.readUint32();if(0==k)throw shaka.log.error("Invalid timescale."),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MEDIA,shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE);if(0==g.version){var l=g.reader.readUint32();var m=g.reader.readUint32()}else l=g.reader.readUint64(),
|
|
1822
1823
|
m=g.reader.readUint64();g.reader.skip(2);var n=g.reader.readUint16();a=a+g.size+m;for(m=0;m<n;m++){var p=g.reader.readUint32(),q=(p&2147483648)>>>31;p&=2147483647;var r=g.reader.readUint32();g.reader.skip(4);if(1==q)throw shaka.log.error("Heirarchical SIDXs are not supported."),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MEDIA,shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED);h.push(new shaka.media.SegmentReference(l/k+c,(l+r)/k+c,function(){return f},a,a+p-
|
|
1823
1824
|
1,b,c,d,e));l+=r;a+=p}g.parser.stop();return h};shaka.util.EbmlParser=function(a){this.dataView_=shaka.util.BufferUtils.toDataView(a);this.reader_=new shaka.util.DataViewReader(this.dataView_,shaka.util.DataViewReader.Endianness.BIG_ENDIAN)};shaka.util.EbmlParser.prototype.hasMoreData=function(){return this.reader_.hasMoreData()};
|
|
@@ -1948,8 +1949,8 @@ shaka.util.PeriodCombiner.cloneStream_=function(a){var b=Object.assign({},a);b.o
|
|
|
1948
1949
|
b.closedCaptions=null;b.trickModeVideo=null;return b};shaka.util.PeriodCombiner.cloneStreamDB_=function(a){a=Object.assign({},a);a.roles=a.roles.slice();a.keyIds=new Set;a.segments=[];a.variantIds=[];a.closedCaptions=null;return a};
|
|
1949
1950
|
shaka.util.PeriodCombiner.concatenateStreams_=function(a,b){var c=function(f,g){f||(f=[]);g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next())h=h.value,f.includes(h)||f.push(h);return f};a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));c=$jscomp.makeIterator(b.keyIds);for(var d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.originalId=null==a.originalId?b.originalId:a.originalId+(","+(b.originalId||""));c=shaka.util.DrmUtils.getCommonDrmInfos(a.drmInfos,
|
|
1950
1951
|
b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.INCONSISTENT_DRM_ACROSS_PERIODS);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),c=$jscomp.makeIterator(b.closedCaptions),d=c.next();!d.done;d=c.next()){var e=$jscomp.makeIterator(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}a.bandwidth&&
|
|
1951
|
-
b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=shaka.util.PeriodCombiner.cloneStream_(b.trickModeVideo),a.trickModeVideo.createSegmentIndex=function(){
|
|
1952
|
-
a.trickModeVideo&&shaka.util.PeriodCombiner.concatenateStreams_(a.trickModeVideo,b)};
|
|
1952
|
+
b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=shaka.util.PeriodCombiner.cloneStream_(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=function(){if(a.trickModeVideo.segmentIndex)return Promise.resolve();var f=new shaka.media.MetaSegmentIndex;goog.asserts.assert(a.trickModeVideo.matchedStreams,"trickmode matched streams should exist");for(var g=$jscomp.makeIterator(a.trickModeVideo.matchedStreams),
|
|
1953
|
+
h=g.next();!h.done;h=g.next())h=h.value,goog.asserts.assert(h.segmentIndex,"trickmode segment index should exist"),f.appendSegmentIndex(h.segmentIndex);a.trickModeVideo.segmentIndex=f;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),shaka.util.PeriodCombiner.concatenateStreams_(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),shaka.util.PeriodCombiner.concatenateStreams_(a.trickModeVideo,b))};
|
|
1953
1954
|
shaka.util.PeriodCombiner.concatenateStreamDBs_=function(a,b){var c=a.roles;c||(c=[]);for(var d=$jscomp.makeIterator(b.roles),e=d.next();!e.done;e=d.next())e=e.value,c.includes(e)||c.push(e);a.roles=c;c=$jscomp.makeIterator(b.keyIds);for(d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.encrypted=a.encrypted&&b.encrypted;a.segments.push.apply(a.segments,$jscomp.arrayFromIterable(b.segments));if(b.closedCaptions)for(a.closedCaptions||(a.closedCaptions=new Map),b=$jscomp.makeIterator(b.closedCaptions),
|
|
1954
1955
|
c=b.next();!c.done;c=b.next())d=$jscomp.makeIterator(c.value),c=d.next().value,d=d.next().value,a.closedCaptions.set(c,d)};shaka.util.PeriodCombiner.prototype.findMatchesInAllPeriods_=function(a,b,c){c=(void 0===c?0:c)?b.matchedStreams:[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=this.findBestMatchInPeriod_(d.value,b);if(!d)return;c.push(d)}b.matchedStreams=c};
|
|
1955
1956
|
shaka.util.PeriodCombiner.prototype.findBestMatchInPeriod_=function(a,b){var c=this,d={audio:shaka.util.PeriodCombiner.generateAudioKey_,video:shaka.util.PeriodCombiner.generateVideoKey_,text:shaka.util.PeriodCombiner.generateTextKey_,image:shaka.util.PeriodCombiner.generateImageKey_}[b.type],e=null,f=d(b);if(a.has(f))e=a.get(f);else{f={audio:function(l,m){return c.areAVStreamsCompatible_(l,m)},video:function(l,m){return c.areAVStreamsCompatible_(l,m)},text:shaka.util.PeriodCombiner.areTextStreamsCompatible_,
|
|
@@ -1976,14 +1977,14 @@ goog.exportProperty(shaka.util.PeriodCombiner.prototype,"getImageStreams",shaka.
|
|
|
1976
1977
|
shaka.util.XmlUtils.parseXmlString=function(a,b){var c=new DOMParser,d=shaka.util.XmlUtils.trustedHTMLFromString_.value()(a);a=null;try{a=c.parseFromString(d,"text/xml")}catch(e){return shaka.log.error("XML parsing exception:",e),null}goog.asserts.assert(a,"Parsed XML document cannot be null!");c=a.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!=
|
|
1977
1978
|
b)return shaka.log.error('XML tag name does not match expected "'+b+'":',c.tagName),null;if(!("createNodeIterator"in document))return c;for(b=document.createNodeIterator(a,NodeFilter.SHOW_ALL);a=b.nextNode();)if(a instanceof HTMLElement||a instanceof SVGElement)return shaka.log.error("XML document embeds unsafe content!"),null;return c};
|
|
1978
1979
|
shaka.util.XmlUtils.parseXml=function(a,b){try{var c=shaka.util.StringUtils.fromBytesAutoDetect(a);return shaka.util.XmlUtils.parseXmlString(c,b)}catch(d){return shaka.log.error("parseXmlString threw!",d),null}};shaka.util.XmlUtils.toArrayBuffer=function(a){return shaka.util.StringUtils.toUTF8(a.outerHTML)};
|
|
1979
|
-
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.dash.DashParser=function(){var a=this;this.playerInterface_=this.config_=null;this.manifestUris_=[];this.manifest_=null;this.globalId_=1;this.patchLocationNodes_=[];this.manifestPatchContext_={mpdId:"",type:"",profiles:[],mediaPresentationDuration:null,availabilityTimeOffset:0,getBaseUris:null,publishTime:0};this.contextCache_=new Map;this.streamMap_={};this.periodDurations_={};this.periodCombiner_=new shaka.util.PeriodCombiner;this.updatePeriod_=0;this.averageUpdateDuration_=
|
|
1980
|
-
this.updateTimer_=new shaka.util.Timer(function(){a.onUpdate_()});this.operationManager_=new shaka.util.OperationManager;this.largestPeriodStartTime_=null;this.lastManifestUpdatePeriodIds_=[];this.minTotalAvailabilityTimeOffset_=Infinity;this.lowLatencyMode_=!1;this.contentSteeringManager_=null;this.isTransitionFromDynamicToStatic_=!1};
|
|
1980
|
+
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.dash.DashParser=function(){var a=this;this.playerInterface_=this.config_=null;this.manifestUris_=[];this.manifest_=null;this.globalId_=1;this.patchLocationNodes_=[];this.manifestPatchContext_={mpdId:"",type:"",profiles:[],mediaPresentationDuration:null,availabilityTimeOffset:0,getBaseUris:null,publishTime:0};this.contextCache_=new Map;this.streamMap_={};this.indexStreamMap_={};this.periodDurations_={};this.periodCombiner_=new shaka.util.PeriodCombiner;this.updatePeriod_=0;this.averageUpdateDuration_=
|
|
1981
|
+
new shaka.abr.Ewma(5);this.updateTimer_=new shaka.util.Timer(function(){a.onUpdate_()});this.operationManager_=new shaka.util.OperationManager;this.largestPeriodStartTime_=null;this.lastManifestUpdatePeriodIds_=[];this.minTotalAvailabilityTimeOffset_=Infinity;this.lowLatencyMode_=!1;this.contentSteeringManager_=null;this.isTransitionFromDynamicToStatic_=!1};
|
|
1981
1982
|
shaka.dash.DashParser.prototype.configure=function(a){goog.asserts.assert(null!=a.dash,"DashManifestConfiguration should not be null!");var b=this.playerInterface_&&a.dash.updatePeriod!=this.config_.dash.updatePeriod&&0<=a.dash.updatePeriod;this.config_=a;b&&this.manifest_&&this.manifest_.presentationTimeline.isLive()&&this.updateNow_();this.contentSteeringManager_&&this.contentSteeringManager_.configure(this.config_);this.periodCombiner_&&(this.periodCombiner_.setAllowMultiTypeVariants(this.config_.dash.multiTypeVariantsAllowed&&
|
|
1982
1983
|
shaka.media.Capabilities.isChangeTypeSupported()),this.periodCombiner_.setUseStreamOnce(this.config_.dash.useStreamOnceInPeriodFlattening))};
|
|
1983
1984
|
shaka.dash.DashParser.prototype.start=function(a,b){var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress)return goog.asserts.assert(c.config_,"Must call configure() before start()!"),c.lowLatencyMode_=b.isLowLatencyMode(),c.manifestUris_=[a],c.playerInterface_=b,e.yield(c.requestManifest_(),2);d=e.yieldResult;c.playerInterface_&&c.setUpdateTimer_(d);if(!c.playerInterface_)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.PLAYER,
|
|
1984
1985
|
shaka.util.Error.Code.OPERATION_ABORTED);goog.asserts.assert(c.manifest_,"Manifest should be non-null!");return e.return(c.manifest_)})};
|
|
1985
|
-
shaka.dash.DashParser.prototype.stop=function(){for(var a=$jscomp.makeIterator(Object.values(this.streamMap_)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.periodCombiner_&&this.periodCombiner_.release();this.config_=this.playerInterface_=null;this.manifestUris_=[];this.manifest_=null;this.streamMap_={};this.contextCache_.clear();this.manifestPatchContext_={mpdId:"",type:"",profiles:[],mediaPresentationDuration:null,availabilityTimeOffset:0,
|
|
1986
|
-
publishTime:0};this.periodCombiner_=null;null!=this.updateTimer_&&(this.updateTimer_.stop(),this.updateTimer_=null);this.contentSteeringManager_&&this.contentSteeringManager_.destroy();return this.operationManager_.destroy()};
|
|
1986
|
+
shaka.dash.DashParser.prototype.stop=function(){for(var a=$jscomp.makeIterator(Object.values(this.streamMap_)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.periodCombiner_&&this.periodCombiner_.release();this.config_=this.playerInterface_=null;this.manifestUris_=[];this.manifest_=null;this.streamMap_={};this.indexStreamMap_={};this.contextCache_.clear();this.manifestPatchContext_={mpdId:"",type:"",profiles:[],mediaPresentationDuration:null,availabilityTimeOffset:0,
|
|
1987
|
+
getBaseUris:null,publishTime:0};this.periodCombiner_=null;null!=this.updateTimer_&&(this.updateTimer_.stop(),this.updateTimer_=null);this.contentSteeringManager_&&this.contentSteeringManager_.destroy();return this.operationManager_.destroy()};
|
|
1987
1988
|
shaka.dash.DashParser.prototype.update=function(){var a=this,b;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return c.setCatchFinallyBlocks(2),c.yield(a.requestManifest_(),4);if(2!=c.nextAddress)return c.leaveTryBlock(0);b=c.enterCatchBlock();if(!a.playerInterface_||!b)return c.return();goog.asserts.assert(b instanceof shaka.util.Error,"Bad error type");a.playerInterface_.onError(b);c.jumpToEnd()})};
|
|
1988
1989
|
shaka.dash.DashParser.prototype.onExpirationUpdated=function(a,b){};shaka.dash.DashParser.prototype.onInitialVariantChosen=function(a){if(this.manifest_&&this.manifest_.presentationTimeline.isLive()){var b=a.video||a.audio;if(b&&b.segmentIndex){a=this.manifest_.presentationTimeline.getSegmentAvailabilityEnd();var c=b.segmentIndex.find(a);null!=c&&(b=b.segmentIndex.get(c))&&(this.updatePeriod_=b.endTime-a,this.setUpdateTimer_(0))}}};
|
|
1989
1990
|
shaka.dash.DashParser.prototype.banLocation=function(a){this.contentSteeringManager_&&this.contentSteeringManager_.banLocation(a)};
|
|
@@ -1998,11 +1999,11 @@ d.parseAttr(a,"publishTime",d.parseDate)||0;c.patchLocationNodes_=d.findChildren
|
|
|
1998
1999
|
c.contentSteeringManager_.setBaseUris(e),c.contentSteeringManager_.setDefaultPathwayId(w),y=d.getContents(v))(x=d.parseAttr(v,"queryBeforeStart",d.parseBoolean,!1))?t=c.contentSteeringManager_.requestInfo(y):c.contentSteeringManager_.requestInfo(y);u=$jscomp.makeIterator(g.keys());for(z=u.next();!z.done;z=u.next())F=z.value,B=g.get(F),c.contentSteeringManager_.addLocation("Location",F,B)}A=d.findChildren(a,"BaseURL");H=!1;if(c.contentSteeringManager_)for(D=$jscomp.makeIterator(A),G=D.next();!G.done;G=
|
|
1999
2000
|
D.next())I=G.value,C=I.attributes.serviceLocation,J=d.getContents(I),C&&J&&(c.contentSteeringManager_.addLocation("BaseURL",C,J),H=!0);H&&c.contentSteeringManager_||(L=A.map(d.getContents),E=shaka.util.ManifestParserUtils.resolveUris(e,L));M=function(){return c.contentSteeringManager_&&H?c.contentSteeringManager_.getLocations("BaseURL"):E?E:[]};c.manifestPatchContext_.getBaseUris=M;K=0;A&&A.length&&(K=d.parseAttr(A[0],"availabilityTimeOffset",d.parseFloat)||0);c.manifestPatchContext_.availabilityTimeOffset=
|
|
2000
2001
|
K;N=c.config_.dash.ignoreMinBufferTime;O=0;N||(O=d.parseAttr(a,"minBufferTime",d.parseDuration)||0);c.updatePeriod_=d.parseAttr(a,"minimumUpdatePeriod",d.parseDuration,-1);T=d.parseAttr(a,"availabilityStartTime",d.parseDate);R=d.parseAttr(a,"timeShiftBufferDepth",d.parseDuration);P=c.config_.dash.ignoreSuggestedPresentationDelay;V=null;P||(V=d.parseAttr(a,"suggestedPresentationDelay",d.parseDuration));W=c.config_.dash.ignoreMaxSegmentDuration;U=null;W||(U=d.parseAttr(a,"maxSegmentDuration",d.parseDuration));
|
|
2001
|
-
Q=a.attributes.type||"static";c.manifest_&&c.manifest_.presentationTimeline&&(c.isTransitionFromDynamicToStatic_=c.manifest_.presentationTimeline.isLive()&&"static"==Q);c.manifestPatchContext_.type=Q;if(c.manifest_)for(S=c.manifest_.presentationTimeline,Y=$jscomp.makeIterator(Object.values(c.streamMap_)),aa=Y.next();!aa.done;aa=Y.next())ba=aa.value,ba.segmentIndex&&ba.segmentIndex.evict(S.getSegmentAvailabilityStart());else ea=c.config_.defaultPresentationDelay||1.5*O,fa=null!=
|
|
2002
|
-
fa,c.config_.dash.autoCorrectDrift);S.setStatic("static"==Q);(na=S.isLive())&&!isNaN(c.config_.availabilityWindowOverride)&&(R=c.config_.availabilityWindowOverride);null==R&&(R=Infinity);S.setSegmentAvailabilityDuration(R);ca=a.attributes.profiles||"";c.manifestPatchContext_.profiles=ca.split(",");da={dynamic:"static"!=Q,presentationTimeline:S,period:null,periodInfo:null,adaptationSet:null,representation:null,bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:K,
|
|
2003
|
-
profiles:ca.split(",")};Z=c.parsePeriods_(da,M,a);ha=Z.duration;ia=Z.periods;("static"!=Q||c.isTransitionFromDynamicToStatic_)&&Z.durationDerivedFromPeriods||S.setDuration(ha||Infinity);c.minTotalAvailabilityTimeOffset_&&!c.lowLatencyMode_&&(oa=c.playerInterface_.isAutoLowLatencyMode())&&(c.playerInterface_.enableLowLatencyMode(),c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());c.lowLatencyMode_?S.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_):
|
|
2004
|
-
shaka.log.alwaysWarn("Low-latency DASH live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details.");S.notifyMaxSegmentDuration(U||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&S.assertIsValid();return X.yield(t,2);case 2:return c.lowLatencyMode_&&(O=0,ja=null!=V?V:c.config_.defaultPresentationDelay,S.setDelay(ja)),c.manifest_?X.yield(c.postPeriodProcessing_(Z.periods
|
|
2005
|
-
4):X.yield(c.periodCombiner_.combinePeriods(ia,da.dynamic),6);case 6:c.manifest_={presentationTimeline:S,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)};if(!S.usingPresentationStartTime()){X.jumpTo(7);
|
|
2002
|
+
Q=a.attributes.type||"static";c.manifest_&&c.manifest_.presentationTimeline&&(c.isTransitionFromDynamicToStatic_=c.manifest_.presentationTimeline.isLive()&&"static"==Q);c.manifestPatchContext_.type=Q;c.cleanStreamMap_();if(c.manifest_)for(S=c.manifest_.presentationTimeline,Y=$jscomp.makeIterator(Object.values(c.streamMap_)),aa=Y.next();!aa.done;aa=Y.next())ba=aa.value,ba.segmentIndex&&ba.segmentIndex.evict(S.getSegmentAvailabilityStart());else ea=c.config_.defaultPresentationDelay||1.5*O,fa=null!=
|
|
2003
|
+
V?V:ea,S=new shaka.media.PresentationTimeline(T,fa,c.config_.dash.autoCorrectDrift);S.setStatic("static"==Q);(na=S.isLive())&&!isNaN(c.config_.availabilityWindowOverride)&&(R=c.config_.availabilityWindowOverride);null==R&&(R=Infinity);S.setSegmentAvailabilityDuration(R);ca=a.attributes.profiles||"";c.manifestPatchContext_.profiles=ca.split(",");da={dynamic:"static"!=Q,presentationTimeline:S,period:null,periodInfo:null,adaptationSet:null,representation:null,bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:K,
|
|
2004
|
+
mediaPresentationDuration:null,profiles:ca.split(",")};Z=c.parsePeriods_(da,M,a,!1);ha=Z.duration;ia=Z.periods;("static"!=Q||c.isTransitionFromDynamicToStatic_)&&Z.durationDerivedFromPeriods||S.setDuration(ha||Infinity);c.minTotalAvailabilityTimeOffset_&&!c.lowLatencyMode_&&(oa=c.playerInterface_.isAutoLowLatencyMode())&&(c.playerInterface_.enableLowLatencyMode(),c.lowLatencyMode_=c.playerInterface_.isLowLatencyMode());c.lowLatencyMode_?S.setAvailabilityTimeOffset(c.minTotalAvailabilityTimeOffset_):
|
|
2005
|
+
c.minTotalAvailabilityTimeOffset_&&shaka.log.alwaysWarn("Low-latency DASH live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details.");S.notifyMaxSegmentDuration(U||1);goog.DEBUG&&!c.isTransitionFromDynamicToStatic_&&S.assertIsValid();return X.yield(t,2);case 2:return c.lowLatencyMode_&&(O=0,ja=null!=V?V:c.config_.defaultPresentationDelay,S.setDelay(ja)),c.manifest_?X.yield(c.postPeriodProcessing_(Z.periods,
|
|
2006
|
+
!1),4):X.yield(c.periodCombiner_.combinePeriods(ia,da.dynamic),6);case 6:c.manifest_={presentationTimeline:S,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)};if(!S.usingPresentationStartTime()){X.jumpTo(7);
|
|
2006
2007
|
break}ka=shaka.util.TXml;la=ka.findChildren(a,"UTCTiming");return X.yield(c.parseUtcTiming_(M,la),8);case 8:ma=X.yieldResult;if(!c.playerInterface_)return X.return();S.setClockOffset(ma);case 7:S.lockStartTime();case 4:c.playerInterface_.makeTextStreamsForClosedCaptions(c.manifest_),X.jumpToEnd()}})};
|
|
2007
2008
|
shaka.dash.DashParser.prototype.postPeriodProcessing_=function(a,b){var c=this,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){if(1==e.nextAddress)return e.yield(c.periodCombiner_.combinePeriods(a,!0,b),2);c.manifest_.variants=c.periodCombiner_.getVariants();d=c.periodCombiner_.getTextStreams();0<d.length&&(c.manifest_.textStreams=d);c.manifest_.imageStreams=c.periodCombiner_.getImageStreams();c.playerInterface_.filter(c.manifest_);e.jumpToEnd()})};
|
|
2008
2009
|
shaka.dash.DashParser.prototype.processPatchManifest_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,v,w,y,x,u,z,F,B,A,E,H,D,G,I,C;return $jscomp.asyncExecutePromiseGeneratorProgram(function(J){if(1==J.nextAddress){c=shaka.util.TXml;d=a.attributes.mpdId;e=c.parseAttr(a,"originalPublishTime",c.parseDate);if(!d||d!==b.manifestPatchContext_.mpdId||e!==b.manifestPatchContext_.publishTime)throw b.patchLocationNodes_=[],new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.MANIFEST,
|
|
@@ -2012,7 +2013,8 @@ h.add(B);else n=!1;n||shaka.log.warning("Unhandled "+m.tagName+" operation",m.at
|
|
|
2012
2013
|
Infinity));J.jumpToEnd()})};shaka.dash.DashParser.prototype.parsePatchMpdTypeChange_=function(a){this.manifest_.presentationTimeline.setStatic("static"==a);this.manifestPatchContext_.type=a;for(var b=$jscomp.makeIterator(this.contextCache_.values()),c=b.next();!c.done;c=b.next())c.value.dynamic="dynamic"==a;"static"==a&&(this.updatePeriod_=-1)};
|
|
2013
2014
|
shaka.dash.DashParser.prototype.parsePatchMediaPresentationDurationChange_=function(a){a=shaka.util.TXml.parseDuration(a);if(null!=a){this.manifestPatchContext_.mediaPresentationDuration=a;for(var b=$jscomp.makeIterator(this.contextCache_.values()),c=b.next();!c.done;c=b.next())c.value.mediaPresentationDuration=a}};
|
|
2014
2015
|
shaka.dash.DashParser.prototype.parsePatchPeriod_=function(a){goog.asserts.assert(this.manifestPatchContext_.getBaseUris,"Must provide getBaseUris on manifestPatchContext_");return this.parsePeriods_({dynamic:"dynamic"==this.manifestPatchContext_.type,presentationTimeline:this.manifest_.presentationTimeline,period:null,periodInfo:null,adaptationSet:null,representation:null,bandwidth:0,indexRangeWarningGiven:!1,availabilityTimeOffset:this.manifestPatchContext_.availabilityTimeOffset,profiles:this.manifestPatchContext_.profiles,
|
|
2015
|
-
mediaPresentationDuration:this.manifestPatchContext_.mediaPresentationDuration},this.manifestPatchContext_.getBaseUris,a).periods};
|
|
2016
|
+
mediaPresentationDuration:this.manifestPatchContext_.mediaPresentationDuration},this.manifestPatchContext_.getBaseUris,a,!0).periods};
|
|
2017
|
+
shaka.dash.DashParser.prototype.removePatchPeriod_=function(a){for(var b=shaka.dash.SegmentTemplate,c=$jscomp.makeIterator(this.contextCache_.keys()),d=c.next();!d.done;d=c.next())if(d=d.value,d.startsWith(a)){var e=this.contextCache_.get(d);b.removeTimepoints(e);this.parsePatchSegment_(d);this.contextCache_.delete(d)}this.lastManifestUpdatePeriodIds_=this.lastManifestUpdatePeriodIds_.filter(function(f){return f!==a})};
|
|
2016
2018
|
shaka.dash.DashParser.prototype.getContextIdsFromPath_=function(a){var b="",c="",d=-1,e="";a=$jscomp.makeIterator(a);for(var f=a.next();!f.done;f=a.next())f=f.value,"Period"===f.name?b=f.id:"AdaptationSet"===f.name?(c=f.id,null!==f.position&&(d=f.position)):"Representation"===f.name&&(e=f.id);a=[];if(e)a.push(b+","+e);else if(c)for(d=$jscomp.makeIterator(this.contextCache_.values()),e=d.next();!e.done;e=d.next())e=e.value,e.period.id===b&&e.adaptationSet.id===c&&e.representation.id&&a.push(b+","+
|
|
2017
2019
|
e.representation.id);else if(-1<d)for(c=$jscomp.makeIterator(this.contextCache_.values()),e=c.next();!e.done;e=c.next())e=e.value,e.period.id===b&&e.adaptationSet.position===d&&e.representation.id&&a.push(b+","+e.representation.id);return a};
|
|
2018
2020
|
shaka.dash.DashParser.prototype.modifySegmentTemplate_=function(a){var b=shaka.util.TXml,c=b.parseXpath(a.attributes.sel||""),d=c[c.length-1];if(!d.attribute)return[];c=this.getContextIdsFromPath_(c);for(var e=b.getContents(a)||"",f=$jscomp.makeIterator(c),g=f.next();!g.done;g=f.next())g=this.contextCache_.get(g.value),goog.asserts.assert(g&&g.representation.segmentTemplate,"cannot modify segment template"),b.modifyNodeAttribute(g.representation.segmentTemplate,a.tagName,d.attribute,e);return c};
|
|
@@ -2021,15 +2023,16 @@ shaka.dash.DashParser.prototype.parsePatchSegment_=function(a){var b=this,c=this
|
|
|
2021
2023
|
function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){if(1==g.nextAddress)return d.segmentIndex?g.jumpTo(0):g.yield(e.generateSegmentIndex(),3);d.segmentIndex=g.yieldResult;g.jumpToEnd()})}}catch(g){a=shaka.util.ManifestParserUtils.ContentType;c=c.representation.contentType;var f=c==a.IMAGE;if(c!=a.TEXT&&c!=a.APPLICATION&&!f||g.code!=shaka.util.Error.Code.DASH_NO_SEGMENT_INFO)throw g;}};
|
|
2022
2024
|
shaka.dash.DashParser.prototype.parseServiceDescription_=function(a){var b=shaka.util.TXml,c=b.findChild(a,"ServiceDescription");if(!c)return null;a=b.findChild(c,"Latency");b=b.findChild(c,"PlaybackRate");if(!a&&!b)return null;c={};a&&("target"in a.attributes&&(c.targetLatency=parseInt(a.attributes.target,10)/1E3),"max"in a.attributes&&(c.maxLatency=parseInt(a.attributes.max,10)/1E3),"min"in a.attributes&&(c.minLatency=parseInt(a.attributes.min,10)/1E3));b&&("max"in b.attributes&&(c.maxPlaybackRate=
|
|
2023
2025
|
parseFloat(b.attributes.max)),"min"in b.attributes&&(c.minPlaybackRate=parseFloat(b.attributes.min)));return c};shaka.dash.DashParser.prototype.parseMpdChaining_=function(a){a=shaka.util.TXml.findChildren(a,"SupplementalProperty");if(!a.length)return null;a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,"urn:mpeg:dash:chaining:2016"==b.attributes.schemeIdUri)return b.attributes.value;return null};
|
|
2024
|
-
shaka.dash.DashParser.prototype.parsePeriods_=function(a,b,c){var
|
|
2025
|
-
"start",
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
shaka.dash.DashParser.prototype.
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
shaka.util.
|
|
2026
|
+
shaka.dash.DashParser.prototype.parsePeriods_=function(a,b,c,d){var e=shaka.util.TXml,f=a.mediaPresentationDuration;f||(f=e.parseAttr(c,"mediaPresentationDuration",e.parseDuration),this.manifestPatchContext_.mediaPresentationDuration=f);var g=0;this.manifest_&&this.manifest_.presentationTimeline&&this.isTransitionFromDynamicToStatic_&&(g=this.manifest_.presentationTimeline.getSeekRangeStart());var h=[],k=g;c=e.findChildren(c,"Period");for(var l=0;l<c.length;l++){var m=c[l],n=c[l+1],p=e.parseAttr(m,
|
|
2027
|
+
"start",e.parseDuration,k),q=m.attributes.id,r=e.parseAttr(m,"duration",e.parseDuration),t=null;if(n){var v=e.parseAttr(n,"start",e.parseDuration);null!=v&&(t=v-p)}else null!=f&&(t=f-p+g);v=shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS;t&&r&&Math.abs(t-r)>v&&shaka.log.warning("There is a gap/overlap between Periods",m);null==t&&(t=r);if(null!==this.largestPeriodStartTime_&&null!==q&&null!==p&&p<this.largestPeriodStartTime_&&!this.lastManifestUpdatePeriodIds_.includes(q)&&l+1!=c.length)shaka.log.debug("Skipping Period with ID "+
|
|
2028
|
+
q+" as its start time is smaller than the largest period start time that has been seen, and ID is unseen before");else{null!==p&&(null===this.largestPeriodStartTime_||p>this.largestPeriodStartTime_)&&(this.largestPeriodStartTime_=p);k=this.parsePeriod_(a,b,{start:p,duration:t,node:m,isLastPeriod:null==t||!n});h.push(k);a.period.id&&t&&(this.periodDurations_[a.period.id]=t);if(null==t){n&&shaka.log.warning("Skipping Period",l+1,"and any subsequent Periods:","Period",l+1,"does not have a valid start time.",
|
|
2029
|
+
n);k=null;break}k=p+t}}if(d)for(a=$jscomp.makeIterator(h),b=a.next();!b.done;b=a.next())b=b.value.id,this.lastManifestUpdatePeriodIds_.includes(b)||this.lastManifestUpdatePeriodIds_.push(b);else this.lastManifestUpdatePeriodIds_=h.map(function(w){return w.id});return null!=f?(null!=k&&Math.abs(k-g-f)>shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS&&shaka.log.warning("@mediaPresentationDuration does not match the total duration ","of all Periods."),{periods:h,duration:f+g,durationDerivedFromPeriods:!1}):
|
|
2030
|
+
{periods:h,duration:k,durationDerivedFromPeriods:!0}};shaka.dash.DashParser.prototype.cleanStreamMap_=function(){var a=this,b=Object.keys(this.indexStreamMap_);if(b.length!==this.lastManifestUpdatePeriodIds_.length){b=b.filter(function(f){return!a.lastManifestUpdatePeriodIds_.includes(f)});b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=$jscomp.makeIterator(this.indexStreamMap_[c]),e=d.next();!e.done;e=d.next())delete this.streamMap_[e.value];delete this.indexStreamMap_[c]}}};
|
|
2031
|
+
shaka.dash.DashParser.prototype.parsePeriod_=function(a,b,c){var d=this,e=shaka.util.Functional,f=shaka.util.TXml,g=shaka.util.ManifestParserUtils.ContentType;goog.asserts.assert(c.node,"periodInfo.node should exist");a.period=this.createFrame_(c.node,null,b);a.periodInfo=c;a.period.availabilityTimeOffset=a.availabilityTimeOffset;a.period.id||(shaka.log.info("No Period ID given for Period with start time "+c.start+", Assigning a default"),a.period.id="__shaka_period_"+c.start);var h=f.findChildren(c.node,
|
|
2032
|
+
"EventStream");b=a.presentationTimeline.getSegmentAvailabilityStart();h=$jscomp.makeIterator(h);for(var k=h.next();!k.done;k=h.next())this.parseEventStream_(c.start,c.duration,k.value,b);e=f.findChildren(c.node,"AdaptationSet").map(function(n,p){return d.parseAdaptationSet_(a,p,n)}).filter(e.isNotNull);if(a.dynamic){c=[];f=$jscomp.makeIterator(e);for(b=f.next();!b.done;b=f.next())for(b=$jscomp.makeIterator(b.value.representationIds),h=b.next();!h.done;h=b.next())c.push(h.value);f=new Set(c);if(c.length!=
|
|
2033
|
+
f.size)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);}c=e.filter(function(n){return!n.trickModeFor});e=e.filter(function(n){return n.trickModeFor});e=$jscomp.makeIterator(e);for(f=e.next();!f.done;f=e.next())for(f=f.value,b=f.trickModeFor.split(" "),h=$jscomp.makeIterator(c),k=h.next();!k.done;k=h.next())if(k=k.value,b.includes(k.id)){k=$jscomp.makeIterator(k.streams);for(var l=k.next(),m={};!l.done;m=
|
|
2034
|
+
{stream$jscomp$99:void 0},l=k.next())m.stream$jscomp$99=l.value,m.stream$jscomp$99.trickModeVideo=f.streams.find(function(n){return function(p){return shaka.util.MimeUtils.getNormalizedCodec(n.stream$jscomp$99.codecs)==shaka.util.MimeUtils.getNormalizedCodec(p.codecs)}}(m))}e=this.getStreamsFromSets_(this.config_.disableAudio,c,g.AUDIO);f=this.getStreamsFromSets_(this.config_.disableVideo,c,g.VIDEO);b=this.getStreamsFromSets_(this.config_.disableText,c,g.TEXT);g=this.getStreamsFromSets_(this.config_.disableThumbnails,
|
|
2035
|
+
c,g.IMAGE);if(0===f.length&&0===e.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_EMPTY_PERIOD);return{id:a.period.id,audioStreams:e,videoStreams:f,textStreams:b,imageStreams:g}};shaka.dash.DashParser.prototype.getStreamsFromSets_=function(a,b,c){return a||!b.length?[]:b.reduce(function(d,e){if(e.contentType!=c)return d;d.push.apply(d,$jscomp.arrayFromIterable(e.streams));return d},[])};
|
|
2033
2036
|
shaka.dash.DashParser.prototype.parseAdaptationSet_=function(a,b,c){var d=this,e=shaka.util.TXml,f=shaka.util.Functional,g=shaka.util.ManifestParserUtils,h=g.ContentType,k=shaka.dash.ContentProtection;a.adaptationSet=this.createFrame_(c,a.period,null);a.adaptationSet.position=b;var l=!1,m=e.findChildren(c,"Role"),n=m.map(function(C){return C.attributes.value}).filter(f.isNotNull),p=void 0;if(b=a.adaptationSet.contentType==h.TEXT)p=g.TextStreamKind.SUBTITLE;f=$jscomp.makeIterator(m);for(m=f.next();!m.done;m=
|
|
2034
2037
|
f.next()){m=m.value;var q=m.attributes.schemeIdUri;if(null==q||"urn:mpeg:dash:role:2011"==q)switch(m=m.attributes.value,m){case "main":l=!0;break;case "caption":case "subtitle":p=m}}var r,t;q=function(C){switch(C){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var v=function(C){switch(C){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}},w=e.findChildren(c,"EssentialProperty");f=null;var y=!1;m=!1;w=$jscomp.makeIterator(w);
|
|
2035
2038
|
for(var x=w.next();!x.done;x=w.next()){x=x.value;var u=x.attributes.schemeIdUri;"http://dashif.org/guidelines/trickmode"==u?f=x.attributes.value:"urn:mpeg:mpegB:cicp:TransferCharacteristics"==u?r=q(parseInt(x.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==u?t=v(parseInt(x.attributes.value,10)):"urn:mpeg:mpegB:cicp:MatrixCoefficients"!=u&&("urn:mpeg:dash:ssr:2023"==u&&this.config_.dash.enableFastSwitching?y=!0:m=!0)}var z=null;w=e.findChildren(c,"SupplementalProperty");w=$jscomp.makeIterator(w);
|
|
@@ -2046,12 +2049,11 @@ L,M;return $jscomp.asyncExecutePromiseGeneratorProgram(function(K){if(1==K.nextA
|
|
|
2046
2049
|
y;x=function(J,L,M,K){return n.requestSegment_(J,L,M,K)};if(a.representation.segmentBase)var B=shaka.dash.SegmentBase.createStreamInfo(a,x,y);else if(a.representation.segmentList)B=shaka.dash.SegmentList.createStreamInfo(a,this.streamMap_,y);else if(a.representation.segmentTemplate)B=shaka.dash.SegmentTemplate.createStreamInfo(a,x,this.streamMap_,!!this.manifest_,this.config_.dash.initialSegmentLimit,this.periodDurations_,y,m,!1);else{goog.asserts.assert(w,"Must have Segment* with non-text streams.");
|
|
2047
2050
|
var A=a.periodInfo.duration||0,E=a.representation.getBaseUris,H=a.representation.mimeType,D=a.representation.codecs;B={generateSegmentIndex:function(){var J=shaka.media.SegmentIndex.forSingleSegment(t,A,E());J.forEachTopLevelReference(function(L){L.mimeType=H;L.codecs=D});return Promise.resolve(J)}}}}catch(J){if((w||q)&&J.code==shaka.util.Error.Code.DASH_NO_SEGMENT_INFO)return null;throw J;}m=p.findChildren(k,"ContentProtection");m=shaka.dash.ContentProtection.parseFromRepresentation(m,b,this.config_.dash.ignoreDrmInfo,
|
|
2048
2051
|
this.config_.dash.keySystemsByURI);m=new Set(m?[m]:[]);x=!1;p.findChildren(k,"SupplementalProperty").some(function(J){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==J.attributes.schemeIdUri&&"JOC"==J.attributes.value})&&(x=!0);u=!1;w&&(u=g.includes("forced_subtitle")||g.includes("forced-subtitle"));var G;if(q&&((k=p.findChildren(k,"EssentialProperty").find(function(J){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(J.attributes.schemeIdUri)}))&&
|
|
2049
|
-
(G=k.attributes.value),!G))return null;var I;
|
|
2050
|
-
closeSegmentIndex:function(){C.segmentIndex&&(C.segmentIndex.release(),C.segmentIndex=null)},segmentIndex:null,mimeType:a.representation.mimeType,codecs:
|
|
2052
|
+
(G=k.attributes.value),!G))return null;var I;p=a.representation.codecs;a.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(p.includes("hvc1.2.4.L153.B0")||p.includes("hev1.2.4.L153.B0"))&&(I="PQ");k=a.representation.id?a.period.id+","+a.representation.id:"";this.patchLocationNodes_.length&&r&&this.contextCache_.set(a.period.id+","+r,this.cloneContext_(a));var C=k&&this.streamMap_[k]?this.streamMap_[k]:{id:this.globalId_++,originalId:a.representation.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
2053
|
+
closeSegmentIndex:function(){C.segmentIndex&&(C.segmentIndex.release(),C.segmentIndex=null)},segmentIndex:null,mimeType:a.representation.mimeType,codecs:p,frameRate:a.representation.frameRate,pixelAspectRatio:a.representation.pixelAspectRatio,bandwidth:a.bandwidth,width:a.representation.width,height:a.representation.height,kind:c,encrypted:0<b.drmInfos.length,drmInfos:b.drmInfos,keyIds:m,language:d,originalLanguage:a.adaptationSet.language,label:e,type:a.adaptationSet.contentType,primary:f,trickModeVideo:null,
|
|
2051
2054
|
emsgSchemeIdUris:a.representation.emsgSchemeIdUris,roles:g,forced:u,channelsCount:a.representation.numChannels,audioSamplingRate:a.representation.audioSamplingRate,spatialAudio:x,closedCaptions:h,hdr:I,colorGamut:void 0,videoLayout:void 0,tilesLayout:G,accessibilityPurpose:l,external:!1,fastSwitching:!1,fullMimeTypes:new Set([shaka.util.MimeUtils.getFullType(a.representation.mimeType,a.representation.codecs)])};C.createSegmentIndex=function(){var J;return $jscomp.asyncExecutePromiseGeneratorProgram(function(L){if(1==
|
|
2052
|
-
L.nextAddress){if(C.segmentIndex)return L.jumpTo(0);J=C;return L.yield(B.generateSegmentIndex(),3)}J.segmentIndex=L.yieldResult;L.jumpToEnd()})};
|
|
2053
|
-
shaka.dash.DashParser.prototype.cloneContext_=function(a){
|
|
2054
|
-
id:e.id,position:e.position,numChannels:e.numChannels,audioSamplingRate:e.audioSamplingRate,availabilityTimeOffset:e.availabilityTimeOffset,initialization:e.initialization}}else"periodInfo"==d?(e=a[d],b[d]={start:e.start,duration:e.duration,node:null,isLastPeriod:e.isLastPeriod}):b[d]=a[d];return b};
|
|
2055
|
+
L.nextAddress){if(C.segmentIndex)return L.jumpTo(0);J=C;return L.yield(B.generateSegmentIndex(),3)}J.segmentIndex=L.yieldResult;L.jumpToEnd()})};k&&a.dynamic&&!this.streamMap_[k]&&(a=a.period.id||"",this.indexStreamMap_[a]||(this.indexStreamMap_[a]=[]),this.streamMap_[k]=C,this.indexStreamMap_[a].push(k));return C};
|
|
2056
|
+
shaka.dash.DashParser.prototype.cloneContext_=function(a){var b=function(c){if(!c)return null;c=shaka.util.ObjectUtils.shallowCloneObject(c);c.segmentBase=null;c.segmentList=null;c.segmentTemplate=shaka.util.TXml.cloneNode(c.segmentTemplate);return c};a=shaka.util.ObjectUtils.shallowCloneObject(a);a.period=b(a.period);a.adaptationSet=b(a.adaptationSet);a.representation=b(a.representation);a.periodInfo&&(a.periodInfo=shaka.util.ObjectUtils.shallowCloneObject(a.periodInfo),a.periodInfo.node=null);return a};
|
|
2055
2057
|
shaka.dash.DashParser.prototype.onUpdate_=function(){var a=this,b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){switch(d.nextAddress){case 1:return goog.asserts.assert(0<=a.updatePeriod_,"There should be an update period"),shaka.log.info("Updating manifest..."),b=0,d.setCatchFinallyBlocks(2),d.yield(a.requestManifest_(),4);case 4:b=d.yieldResult;d.leaveTryBlock(3);break;case 2:if(c=d.enterCatchBlock(),goog.asserts.assert(c instanceof shaka.util.Error,"Should only receive a Shaka error"),
|
|
2056
2058
|
a.playerInterface_){if(a.config_.raiseFatalErrorOnManifestUpdateRequestFailure)return a.playerInterface_.onError(c),d.return();c.severity=shaka.util.Error.Severity.RECOVERABLE;a.playerInterface_.onError(c)}case 3:if(!a.playerInterface_)return d.return();a.playerInterface_.onManifestUpdated();a.setUpdateTimer_(b);d.jumpToEnd()}})};shaka.dash.DashParser.prototype.updateNow_=function(){this.updateTimer_.tickNow()};
|
|
2057
2059
|
shaka.dash.DashParser.prototype.setUpdateTimer_=function(a){if(!(0>this.updatePeriod_)){var b=this.updatePeriod_;0<=this.config_.dash.updatePeriod&&(b=this.config_.dash.updatePeriod);a=Math.max(b-a,this.averageUpdateDuration_.getEstimate());this.updateTimer_.tickAfter(a)}};
|
|
@@ -2368,9 +2370,9 @@ shaka.offline.indexeddb.BaseStorageCell.prototype.getAllManifests=function(){var
|
|
|
2368
2370
|
d.return(c)})};shaka.offline.indexeddb.BaseStorageCell.prototype.convertSegmentData=function(a){return a};shaka.offline.indexeddb.BaseStorageCell.prototype.convertManifest=function(a){return Promise.resolve(a)};shaka.offline.indexeddb.BaseStorageCell.prototype.rejectAdd=function(a){return Promise.reject(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.NEW_KEY_OPERATION_NOT_SUPPORTED,"Cannot add new value to "+a))};
|
|
2369
2371
|
shaka.offline.indexeddb.BaseStorageCell.prototype.rejectUpdate=function(a){return Promise.reject(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.MODIFY_OPERATION_NOT_SUPPORTED,"Cannot modify values in "+a))};
|
|
2370
2372
|
shaka.offline.indexeddb.BaseStorageCell.prototype.add=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){d=c.connection_.startReadWriteOperation(a);e=d.store();f=[];g=$jscomp.makeIterator(b);h=g.next();for(k={};!h.done;k={request$jscomp$55:void 0},h=g.next())l=h.value,k.request$jscomp$55=e.add(l),k.request$jscomp$55.onsuccess=function(n){return function(p){f.push(n.request$jscomp$55.result)}}(k);return m.yield(d.promise(),2)}return m.return(f)})};
|
|
2371
|
-
shaka.offline.indexeddb.BaseStorageCell.prototype.remove_=function(a,b,c){a=this.connection_.startReadWriteOperation(a);var d=a.store();b=$jscomp.makeIterator(b);for(var e=b.next(),f={};!e.done;f={key$jscomp$
|
|
2372
|
-
shaka.offline.indexeddb.BaseStorageCell.prototype.get_=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){d=c.connection_.startReadOnlyOperation(a);e=d.store();f={};g=[];h=$jscomp.makeIterator(b);k=h.next();for(l={};!k.done;l={request$jscomp$56:void 0,key$jscomp$
|
|
2373
|
-
g.push(n.key$jscomp$
|
|
2373
|
+
shaka.offline.indexeddb.BaseStorageCell.prototype.remove_=function(a,b,c){a=this.connection_.startReadWriteOperation(a);var d=a.store();b=$jscomp.makeIterator(b);for(var e=b.next(),f={};!e.done;f={key$jscomp$142:void 0},e=b.next())f.key$jscomp$142=e.value,d.delete(f.key$jscomp$142).onsuccess=function(g){return function(){return c(g.key$jscomp$142)}}(f);return a.promise()};
|
|
2374
|
+
shaka.offline.indexeddb.BaseStorageCell.prototype.get_=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){d=c.connection_.startReadOnlyOperation(a);e=d.store();f={};g=[];h=$jscomp.makeIterator(b);k=h.next();for(l={};!k.done;l={request$jscomp$56:void 0,key$jscomp$143:void 0},k=h.next())l.key$jscomp$143=k.value,l.request$jscomp$56=e.get(l.key$jscomp$143),l.request$jscomp$56.onsuccess=function(n){return function(){void 0==n.request$jscomp$56.result&&
|
|
2375
|
+
g.push(n.key$jscomp$143);f[n.key$jscomp$143]=n.request$jscomp$56.result}}(l);return m.yield(d.promise(),2)}if(g.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.KEY_NOT_FOUND,"Could not find values for "+g);return m.return(b.map(function(n){return f[n]}))})};shaka.offline.indexeddb.EmeSessionStorageCell=function(a,b){this.connection_=new shaka.offline.indexeddb.DBConnection(a);this.store_=b};shaka.offline.indexeddb.EmeSessionStorageCell.prototype.destroy=function(){return this.connection_.destroy()};
|
|
2374
2376
|
shaka.offline.indexeddb.EmeSessionStorageCell.prototype.getAll=function(){var a=this,b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){return 1==d.nextAddress?(b=a.connection_.startReadOnlyOperation(a.store_),c=[],d.yield(b.forEachEntry(function(e,f){c.push(f)}),2)):3!=d.nextAddress?d.yield(b.promise(),3):d.return(c)})};
|
|
2375
2377
|
shaka.offline.indexeddb.EmeSessionStorageCell.prototype.add=function(a){var b=this.connection_.startReadWriteOperation(this.store_),c=b.store();a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next())c.add(d.value);return b.promise()};
|
|
2376
2378
|
shaka.offline.indexeddb.EmeSessionStorageCell.prototype.remove=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){return 1==d.nextAddress?(c=b.connection_.startReadWriteOperation(b.store_),d.yield(c.forEachEntry(function(e,f,g){a.includes(f.sessionId)&&g.delete()}),2)):d.yield(c.promise(),0)})};shaka.offline.StorageCellHandle={};shaka.offline.StorageCellPath={};shaka.offline.StorageMuxer=function(){this.mechanisms_=new Map};shaka.offline.StorageMuxer.prototype.destroy=function(){for(var a=[],b=$jscomp.makeIterator(this.mechanisms_.values()),c=b.next();!c.done;c=b.next())a.push(c.value.destroy());this.mechanisms_.clear();return Promise.all(a)};
|