shaka-player 4.10.16 → 4.10.17
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/locales.js +57 -57
- package/dist/shaka-player.compiled.d.ts +9 -0
- package/dist/shaka-player.compiled.debug.d.ts +9 -0
- package/dist/shaka-player.compiled.debug.externs.js +13 -0
- package/dist/shaka-player.compiled.debug.js +39 -35
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +13 -0
- package/dist/shaka-player.compiled.js +324 -321
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +9 -0
- package/dist/shaka-player.ui.debug.d.ts +9 -0
- package/dist/shaka-player.ui.debug.externs.js +13 -0
- package/dist/shaka-player.ui.debug.js +292 -288
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +13 -0
- package/dist/shaka-player.ui.js +604 -601
- package/dist/shaka-player.ui.map +3 -3
- package/lib/dash/dash_parser.js +3 -3
- package/lib/dash/mpd_utils.js +0 -3
- package/lib/dash/segment_template.js +11 -2
- package/lib/media/presentation_timeline.js +16 -0
- package/lib/media/segment_index.js +4 -4
- package/lib/media/streaming_engine.js +2 -1
- package/lib/player.js +4 -2
- package/lib/text/ttml_text_parser.js +1 -1
- package/lib/util/periods.js +56 -3
- package/lib/util/tXml.js +17 -9
- package/package.json +1 -1
- package/ui/locales/ar-XB.json +1 -1
- package/ui/locales/ar.json +1 -1
- package/ui/locales/bg.json +1 -1
- package/ui/locales/ca.json +5 -5
- package/ui/locales/cs.json +1 -1
- package/ui/locales/da.json +1 -1
- package/ui/locales/de.json +1 -1
- package/ui/locales/el.json +1 -1
- package/ui/locales/en-GB.json +1 -1
- package/ui/locales/en-XA.json +1 -1
- package/ui/locales/es-419.json +4 -4
- package/ui/locales/es.json +4 -4
- package/ui/locales/fa.json +1 -1
- package/ui/locales/fi.json +1 -1
- package/ui/locales/fil.json +1 -1
- package/ui/locales/fr.json +5 -5
- package/ui/locales/hi.json +1 -1
- package/ui/locales/hr.json +1 -1
- package/ui/locales/hu.json +1 -1
- package/ui/locales/id.json +1 -1
- package/ui/locales/it.json +1 -1
- package/ui/locales/iw.json +1 -1
- package/ui/locales/ja.json +1 -1
- package/ui/locales/ko.json +1 -1
- package/ui/locales/lt.json +1 -1
- package/ui/locales/lv.json +1 -1
- package/ui/locales/nl.json +1 -1
- package/ui/locales/no.json +1 -1
- package/ui/locales/pl.json +5 -5
- package/ui/locales/pt-BR.json +7 -7
- package/ui/locales/pt-PT.json +8 -8
- package/ui/locales/ro.json +1 -1
- package/ui/locales/ru.json +1 -1
- package/ui/locales/sk.json +1 -1
- package/ui/locales/sl.json +1 -1
- package/ui/locales/sr.json +1 -1
- package/ui/locales/sv.json +1 -1
- package/ui/locales/th.json +1 -1
- package/ui/locales/tr.json +1 -1
- package/ui/locales/uk.json +1 -1
- package/ui/locales/vi.json +1 -1
- package/ui/locales/zh-HK.json +1 -1
- package/ui/locales/zh-TW.json +1 -1
- package/ui/locales/zh.json +1 -1
|
@@ -484,13 +484,13 @@ shaka.util.Pssh.normaliseInitData=function(a){if(!a)return a;var b=new shaka.uti
|
|
|
484
484
|
Copyright 2015 Tobias Nickel
|
|
485
485
|
SPDX-License-Identifier: MIT
|
|
486
486
|
*/
|
|
487
|
-
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(
|
|
487
|
+
shaka.util.TXml=function(){};shaka.util.TXml.parseXml=function(a,b,c){c=void 0===c?!1:c;a=shaka.util.StringUtils.fromBytesAutoDetect(a);return shaka.util.TXml.parseXmlString(a,b,c)};shaka.util.TXml.parseXmlString=function(a,b,c){a=shaka.util.TXml.parse(a,void 0===c?!1:c);if(!b&&a.length)return a[0];if(a=a.find(function(d){return d.tagName===b}))return a;shaka.log.error("parseXml root element not found!");return null};
|
|
488
488
|
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)};
|
|
489
|
-
shaka.util.TXml.parse=function(a){function
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
parent:null};
|
|
493
|
-
|
|
489
|
+
shaka.util.TXml.parse=function(a,b){function c(f,g){g=void 0===g?!1:g;for(var h=[];a[e];)if(60==a.charCodeAt(e)){if(47===a.charCodeAt(e+1)){g=e+2;e=a.indexOf(">",e);g=a.substring(g,e);var k=g.indexOf(f);if(-1==k){var l=f.indexOf(".");0<l&&(f=f.substring(0,l),k=g.indexOf(f))}if(-1==k)throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(33===a.charCodeAt(e+1)){if(45==a.charCodeAt(e+2)){for(;-1!==
|
|
490
|
+
e&&(62!==a.charCodeAt(e)||45!=a.charCodeAt(e-1)||45!=a.charCodeAt(e-2)||-1==e);)e=a.indexOf(">",e+1);-1===e&&(e=a.length)}else if(91===a.charCodeAt(e+2)&&91===a.charCodeAt(e+8)&&"cdata"===a.substr(e+3,5).toLowerCase()){k=a.indexOf("]]\x3e",e);-1==k?(h.push(a.substr(e+9)),e=a.length):(h.push(a.substring(e+9,k)),e=k+3);continue}e++;continue}a:{l=g;e++;var m=d(),n={};for(k=[];62!==a.charCodeAt(e)&&a[e];){var p=a.charCodeAt(e);if(64<p&&91>p||96<p&&123>p){p=d();for(var q=a.charCodeAt(e);q&&39!==q&&34!==
|
|
491
|
+
q&&!(64<q&&91>q||96<q&&123>q)&&62!==q;)e++,q=a.charCodeAt(e);var r=e+1;e=a.indexOf(a[e],r);r=a.slice(r,e);if(39===q||34===q){if(-1===e){l={tagName:m,attributes:n,children:k,parent:null};if(b)for(m=0;m<k.length;m++)"string"!==typeof k[m]&&(k[m].parent=l);k=l;break a}}else r=null,e--;p.startsWith("xmlns:")&&(q=p.split(":"),shaka.util.TXml.setKnownNameSpace(r,q[1]));"tt"===m&&"xml:space"===p&&"preserve"===r&&(l=!0);n[p]=r}e++}47!==a.charCodeAt(e-1)?(e++,k=c(m,l)):e++;l={tagName:m,attributes:n,children:k,
|
|
492
|
+
parent:null};m=k.length;for(n=0;n<m;n++)p=k[n],"string"!==typeof p?b&&(p.parent=l):n==m-1&&"\n"==p&&k.pop();k=l}h.push(k);if("string"===typeof k)break;"?"===k.tagName[0]&&k.children&&(h.push.apply(h,$jscomp.arrayFromIterable(k.children)),k.children=[])}else k=e,e=a.indexOf("<",e)-1,-2===e&&(e=a.length),k=a.slice(k,e+1),g?0<k.length&&h.push(k):h.length&&1==k.length&&"\n"==k[0]?h.push(k):0<k.trim().length&&h.push(k),e++;return h}function d(){for(var f=e;-1==="\r\n\t>/= ".indexOf(a[e])&&a[e];)e++;return a.slice(f,
|
|
493
|
+
e)}var e=0;return c("")};shaka.util.TXml.isNode=function(a){return!!a.tagName};shaka.util.TXml.isText=function(a){return"string"===typeof a};shaka.util.TXml.getChildNodes=function(a){var b=[];if(!a.children)return[];a=$jscomp.makeIterator(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,"string"!==typeof c&&b.push(c);return b};
|
|
494
494
|
shaka.util.TXml.findChildren=function(a,b){var c=[];if(!a.children)return[];a=$jscomp.makeIterator(a.children);for(var d=a.next();!d.done;d=a.next())d=d.value,d.tagName===b&&c.push(d);return c};shaka.util.TXml.getTextContents=function(a){var b=shaka.util.StringUtils;if("string"===typeof a)return b.htmlUnescape(a);a=a.children.reduce(function(c,d){return"string"===typeof d?c+d:c},"");return""===a?null:b.htmlUnescape(a)};
|
|
495
495
|
shaka.util.TXml.getContents=function(a){if(!Array.from(a.children).every(function(b){return"string"===typeof b}))return null;(a=shaka.util.TXml.getTextContents(a))&&(a=a.trim());return a};shaka.util.TXml.getElementsByTagName=function(a,b,c){c=void 0===c?[]:c;a.tagName===b&&c.push(a);if(a.children){a=$jscomp.makeIterator(a.children);for(var d=a.next();!d.done;d=a.next())shaka.util.TXml.getElementsByTagName(d.value,b,c)}return c};
|
|
496
496
|
shaka.util.TXml.findChild=function(a,b){a=shaka.util.TXml.findChildren(a,b);return 1!=a.length?null:a[0]};shaka.util.TXml.findChildNS=function(a,b,c){a=shaka.util.TXml.findChildrenNS(a,b,c);return 1!=a.length?null:a[0]};shaka.util.TXml.parseAttr=function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.attributes[b];null!=a&&(e=c(a));return null==e?d:e};shaka.util.TXml.getAttributeNS=function(a,b,c){b=shaka.util.TXml.getKnownNameSpace(b);return a.attributes[b+":"+c]||null};
|
|
@@ -814,10 +814,10 @@ shaka.media.PresentationTimeline.prototype.setDelay=function(a){goog.asserts.ass
|
|
|
814
814
|
shaka.media.PresentationTimeline.prototype.notifyTimeRange=function(a,b){if(0!=a.length){var c=(Date.now()+this.clockOffset_)/1E3;a=a.filter(function(e){return e.start+b<c});if(0!=a.length){var d=a[a.length-1].end+b;this.notifyMinSegmentStartTime(a[0].start+b);this.maxSegmentDuration_=a.reduce(function(e,f){return Math.max(e,f.end-f.start)},this.maxSegmentDuration_);this.maxSegmentEndTime_=Math.max(this.maxSegmentEndTime_,d);null!=this.presentationStartTime_&&this.autoCorrectDrift_&&!this.startTimeLocked_&&
|
|
815
815
|
(this.presentationStartTime_=c-this.maxSegmentEndTime_-this.maxSegmentDuration_);shaka.log.v1("notifySegments:","maxSegmentDuration="+this.maxSegmentDuration_)}}};
|
|
816
816
|
shaka.media.PresentationTimeline.prototype.notifySegments=function(a){if(0!=a.length){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.clockOffset_)/1E3;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next())e=e.value,d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.maxSegmentDuration_=Math.max(this.maxSegmentDuration_,e.endTime-e.startTime));this.notifyMinSegmentStartTime(b);this.maxSegmentEndTime_=Math.max(this.maxSegmentEndTime_,c);null!=this.presentationStartTime_&&
|
|
817
|
-
this.autoCorrectDrift_&&!this.startTimeLocked_&&(this.presentationStartTime_=d-this.maxSegmentEndTime_-this.maxSegmentDuration_);shaka.log.v1("notifySegments:","maxSegmentDuration="+this.maxSegmentDuration_)}};shaka.media.PresentationTimeline.prototype.
|
|
818
|
-
shaka.media.PresentationTimeline.prototype.
|
|
819
|
-
shaka.media.PresentationTimeline.prototype.
|
|
820
|
-
shaka.media.PresentationTimeline.prototype.isLive=function(){return Infinity==this.duration_&&!this.static_};shaka.media.PresentationTimeline.prototype.isInProgress=function(){return Infinity!=this.duration_&&!this.static_};
|
|
817
|
+
this.autoCorrectDrift_&&!this.startTimeLocked_&&(this.presentationStartTime_=d-this.maxSegmentEndTime_-this.maxSegmentDuration_);shaka.log.v1("notifySegments:","maxSegmentDuration="+this.maxSegmentDuration_)}};shaka.media.PresentationTimeline.prototype.notifyPeriodDuration=function(a,b){this.notifyMinSegmentStartTime(a);Infinity==b||this.isLive()||(this.maxSegmentEndTime_=Math.max(this.maxSegmentEndTime_,b))};shaka.media.PresentationTimeline.prototype.getMaxSegmentEndTime=function(){return this.maxSegmentEndTime_};
|
|
818
|
+
shaka.media.PresentationTimeline.prototype.lockStartTime=function(){this.startTimeLocked_=!0};shaka.media.PresentationTimeline.prototype.isStartTimeLocked=function(){return this.startTimeLocked_};shaka.media.PresentationTimeline.prototype.setInitialProgramDateTime=function(a){this.initialProgramDateTime_=a};shaka.media.PresentationTimeline.prototype.getInitialProgramDateTime=function(){return this.initialProgramDateTime_};
|
|
819
|
+
shaka.media.PresentationTimeline.prototype.notifyMinSegmentStartTime=function(a){this.minSegmentStartTime_=null==this.minSegmentStartTime_?a:Math.min(this.minSegmentStartTime_,a)};shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration=function(a){this.maxSegmentDuration_=Math.max(this.maxSegmentDuration_,a);shaka.log.v1("notifyNewSegmentDuration:","maxSegmentDuration="+this.maxSegmentDuration_)};
|
|
820
|
+
shaka.media.PresentationTimeline.prototype.offset=function(a){null!=this.minSegmentStartTime_&&(this.minSegmentStartTime_+=a);null!=this.maxSegmentEndTime_&&(this.maxSegmentEndTime_+=a)};shaka.media.PresentationTimeline.prototype.isLive=function(){return Infinity==this.duration_&&!this.static_};shaka.media.PresentationTimeline.prototype.isInProgress=function(){return Infinity!=this.duration_&&!this.static_};
|
|
821
821
|
shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart=function(){goog.asserts.assert(0<=this.segmentAvailabilityDuration_,"The availability duration should be positive");var a=this.getSegmentAvailabilityEnd()-this.segmentAvailabilityDuration_;return Math.max(this.userSeekStart_,a)};shaka.media.PresentationTimeline.prototype.setUserSeekStart=function(a){this.userSeekStart_=a};
|
|
822
822
|
shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd=function(){return this.isLive()||this.isInProgress()?Math.min(this.getLiveEdge_()+this.availabilityTimeOffset_,this.duration_):this.maxSegmentEndTime_?Math.min(this.maxSegmentEndTime_,this.duration_):this.duration_};
|
|
823
823
|
shaka.media.PresentationTimeline.prototype.getSafeSeekRangeStart=function(a){var b=Math.max(this.minSegmentStartTime_,this.userSeekStart_);if(Infinity==this.segmentAvailabilityDuration_)return Math.ceil(1E3*b)/1E3;var c=this.getSegmentAvailabilityEnd()-this.segmentAvailabilityDuration_;a=Math.min(c+a,this.getSeekRangeEnd());return Math.max(b,a)};shaka.media.PresentationTimeline.prototype.getSeekRangeStart=function(){return this.getSafeSeekRangeStart(0)};
|
|
@@ -830,8 +830,8 @@ goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSafeSeekRange
|
|
|
830
830
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSegmentAvailabilityStart",shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"isInProgress",shaka.media.PresentationTimeline.prototype.isInProgress);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"isLive",shaka.media.PresentationTimeline.prototype.isLive);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"offset",shaka.media.PresentationTimeline.prototype.offset);
|
|
831
831
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyMaxSegmentDuration",shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyMinSegmentStartTime",shaka.media.PresentationTimeline.prototype.notifyMinSegmentStartTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getInitialProgramDateTime",shaka.media.PresentationTimeline.prototype.getInitialProgramDateTime);
|
|
832
832
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setInitialProgramDateTime",shaka.media.PresentationTimeline.prototype.setInitialProgramDateTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"isStartTimeLocked",shaka.media.PresentationTimeline.prototype.isStartTimeLocked);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"lockStartTime",shaka.media.PresentationTimeline.prototype.lockStartTime);
|
|
833
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getMaxSegmentEndTime",shaka.media.PresentationTimeline.prototype.getMaxSegmentEndTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
834
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getDelay",shaka.media.PresentationTimeline.prototype.getDelay);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setDelay",shaka.media.PresentationTimeline.prototype.setDelay);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSegmentAvailabilityDuration",shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration);
|
|
833
|
+
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getMaxSegmentEndTime",shaka.media.PresentationTimeline.prototype.getMaxSegmentEndTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyPeriodDuration",shaka.media.PresentationTimeline.prototype.notifyPeriodDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifySegments",shaka.media.PresentationTimeline.prototype.notifySegments);
|
|
834
|
+
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyTimeRange",shaka.media.PresentationTimeline.prototype.notifyTimeRange);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getDelay",shaka.media.PresentationTimeline.prototype.getDelay);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setDelay",shaka.media.PresentationTimeline.prototype.setDelay);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSegmentAvailabilityDuration",shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration);
|
|
835
835
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setSegmentAvailabilityDuration",shaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setStatic",shaka.media.PresentationTimeline.prototype.setStatic);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setClockOffset",shaka.media.PresentationTimeline.prototype.setClockOffset);
|
|
836
836
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getPresentationStartTime",shaka.media.PresentationTimeline.prototype.getPresentationStartTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setDuration",shaka.media.PresentationTimeline.prototype.setDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setPresentationStartTime",shaka.media.PresentationTimeline.prototype.setPresentationStartTime);
|
|
837
837
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getMaxSegmentDuration",shaka.media.PresentationTimeline.prototype.getMaxSegmentDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getDuration",shaka.media.PresentationTimeline.prototype.getDuration);shaka.media.StallDetector=function(a,b,c){this.onEvent_=c;this.implementation_=a;this.wasMakingProgress_=a.shouldBeMakingProgress();this.value_=a.getPresentationSeconds();this.lastUpdateSeconds_=a.getWallSeconds();this.didJump_=!1;this.stallsDetected_=0;this.stallThresholdSeconds_=b;this.onStall_=function(){}};shaka.media.StallDetector.prototype.release=function(){this.onEvent_=this.implementation_=null;this.onStall_=function(){}};
|
|
@@ -894,10 +894,11 @@ shaka.media.MetaSegmentIndex.prototype.evictEmpty=function(){for(;1<this.indexes
|
|
|
894
894
|
shaka.media.MetaSegmentIndex.prototype.clone=function(){var a=new shaka.media.MetaSegmentIndex;a.indexes_=this.indexes_.slice();a.numEvicted_=this.numEvicted_;return a};shaka.media.MetaSegmentIndex.prototype.release=function(){for(var a=$jscomp.makeIterator(this.indexes_),b=a.next();!b.done;b=a.next())b.value.release();this.indexes_=[]};shaka.media.MetaSegmentIndex.prototype.forEachTopLevelReference=function(a){for(var b=$jscomp.makeIterator(this.indexes_),c=b.next();!c.done;c=b.next())c.value.forEachTopLevelReference(a)};
|
|
895
895
|
shaka.media.MetaSegmentIndex.prototype.find=function(a){for(var b=this.numEvicted_,c=$jscomp.makeIterator(this.indexes_),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(null!=e)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};
|
|
896
896
|
shaka.media.MetaSegmentIndex.prototype.get=function(a){for(var b=this.numEvicted_,c=!1,d=$jscomp.makeIterator(this.indexes_),e=d.next();!e.done;e=d.next()){e=e.value;goog.asserts.assert(!c||0==e.getNumEvicted(),"Should not see evicted segments after available segments");var f=e.get(a-b);if(f)return f;f=e.getNumReferences();b+=e.getNumEvicted()+f;c=c||0!=f}return null};shaka.media.MetaSegmentIndex.prototype.offset=function(a){goog.asserts.assert(!1,"offset() should not be used in MetaSegmentIndex!")};
|
|
897
|
-
shaka.media.MetaSegmentIndex.prototype.merge=function(a){goog.asserts.assert(!1,"merge() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.evict=function(a){
|
|
898
|
-
shaka.media.MetaSegmentIndex.prototype.
|
|
899
|
-
goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"
|
|
900
|
-
goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"
|
|
897
|
+
shaka.media.MetaSegmentIndex.prototype.merge=function(a){goog.asserts.assert(!1,"merge() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.evict=function(a){for(var b=$jscomp.makeIterator(this.indexes_),c=b.next();!c.done;c=b.next())c.value.evict(a);this.evictEmpty()};shaka.media.MetaSegmentIndex.prototype.mergeAndEvict=function(a,b){goog.asserts.assert(!1,"mergeAndEvict() should not be used in MetaSegmentIndex!")};
|
|
898
|
+
shaka.media.MetaSegmentIndex.prototype.fit=function(a,b){goog.asserts.assert(!1,"fit() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.updateEvery=function(a,b){goog.asserts.assert(!1,"updateEvery() should not be used in MetaSegmentIndex!")};goog.exportSymbol("shaka.media.MetaSegmentIndex",shaka.media.MetaSegmentIndex);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"updateEvery",shaka.media.MetaSegmentIndex.prototype.updateEvery);
|
|
899
|
+
goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"fit",shaka.media.MetaSegmentIndex.prototype.fit);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"mergeAndEvict",shaka.media.MetaSegmentIndex.prototype.mergeAndEvict);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"evict",shaka.media.MetaSegmentIndex.prototype.evict);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"merge",shaka.media.MetaSegmentIndex.prototype.merge);
|
|
900
|
+
goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"offset",shaka.media.MetaSegmentIndex.prototype.offset);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"get",shaka.media.MetaSegmentIndex.prototype.get);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"find",shaka.media.MetaSegmentIndex.prototype.find);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"forEachTopLevelReference",shaka.media.MetaSegmentIndex.prototype.forEachTopLevelReference);
|
|
901
|
+
goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"release",shaka.media.MetaSegmentIndex.prototype.release);shaka.media.PlayRateController=function(a){var b=this;this.harness_=a;this.isBuffering_=!1;this.rate_=this.harness_.getRate();this.pollRate_=.25;this.timer_=new shaka.util.Timer(function(){b.harness_.movePlayhead(b.rate_*b.pollRate_)})};shaka.media.PlayRateController.prototype.release=function(){this.set(this.getDefaultRate());this.timer_&&(this.timer_.stop(),this.timer_=null);this.harness_=null};shaka.media.PlayRateController.prototype.setBuffering=function(a){this.isBuffering_=a;this.apply_()};
|
|
901
902
|
shaka.media.PlayRateController.prototype.set=function(a){goog.asserts.assert(0!=a,"Should never set rate of 0 explicitly!");this.rate_=a;this.apply_()};shaka.media.PlayRateController.prototype.getRealRate=function(){return this.rate_};shaka.media.PlayRateController.prototype.getDefaultRate=function(){return this.harness_.getDefaultRate()};
|
|
902
903
|
shaka.media.PlayRateController.prototype.apply_=function(){this.timer_.stop();var a=this.calculateCurrentRate_();shaka.log.v1("Changing effective playback rate to",a);if(0<=a)try{this.applyRate_(a);return}catch(b){}this.timer_.tickEvery(this.pollRate_);this.applyRate_(0)};shaka.media.PlayRateController.prototype.calculateCurrentRate_=function(){return this.isBuffering_?0:this.rate_};
|
|
903
904
|
shaka.media.PlayRateController.prototype.applyRate_=function(a){var b=this.harness_.getRate();b!=a&&this.harness_.setRate(a);return b!=a};shaka.media.IPlayheadObserver=function(){};shaka.media.IPlayheadObserver.prototype.poll=function(a,b){};shaka.media.PlayheadObserverManager=function(a){var b=this;this.mediaElement_=a;this.observers_=new Set;this.pollingLoop_=(new shaka.util.Timer(function(){b.pollAllObservers_(!1)})).tickEvery(.25)};shaka.media.PlayheadObserverManager.prototype.release=function(){this.pollingLoop_.stop();for(var a=$jscomp.makeIterator(this.observers_),b=a.next();!b.done;b=a.next())b.value.release();this.observers_.clear()};
|
|
@@ -1042,9 +1043,9 @@ c.reader.getPosition());if(b&&b.includes(d)||this.config_.dispatchAllEmsgBoxes)i
|
|
|
1042
1043
|
d)&&(d=shaka.util.Id3Utils.getID3Frames(a),d.length))this.playerInterface_.onMetadata([{cueTime:l,data:a,frames:d,dts:l,pts:l}],0,b)};
|
|
1043
1044
|
shaka.media.StreamingEngine.prototype.parsePrft_=function(a,b){if(!this.parsedPrftEventRaised_&&a.initSegmentReference.timescale){goog.asserts.assert(0==b.version||1==b.version,"PRFT version can only be 0 or 1");b=shaka.util.Mp4BoxParsers.parsePRFTInaccurate(b.reader,b.version);a=a.initSegmentReference.timescale;var c=this.convertNtp(b.ntpTimestamp);a={wallClockTime:c,programStartDate:new Date(c-b.mediaTime/a*1E3)};b=shaka.util.FakeEvent.EventName.Prft;a=(new Map).set("detail",a);b=new shaka.util.FakeEvent(b,
|
|
1044
1045
|
a);this.playerInterface_.onEvent(b);this.parsedPrftEventRaised_=!0}};shaka.media.StreamingEngine.prototype.convertNtp=function(a){var b=new Date(Date.UTC(1900,0,1,0,0,0));return(new Date(b.getTime()+a)).getTime()};
|
|
1045
|
-
shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){d=a.stream.segmentIndex;d instanceof shaka.media.MetaSegmentIndex&&d.
|
|
1046
|
-
"buffer behind okay because nothing buffered:","presentationTime="+b,"bufferBehind="+f),l.return();h=b-g;k=h-f;if(k<=c.config_.evictionGoal)return shaka.log.v2(e,"buffer behind okay:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"underflow="+Math.abs(k)),l.return();shaka.log.v1(e,"buffer behind too large:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"overflow="+
|
|
1047
|
-
g,g+k),2)}c.destroyer_.ensureNotDestroyed();shaka.log.v1(e,"evicted "+k+" seconds");l.jumpToEnd()})};shaka.media.StreamingEngine.isEmbeddedText_=function(a){var b=shaka.util.MimeUtils,c=b.CEA608_CLOSED_CAPTION_MIMETYPE;b=b.CEA708_CLOSED_CAPTION_MIMETYPE;return a&&a.type==shaka.util.ManifestParserUtils.ContentType.TEXT&&(a.stream.mimeType==c||a.stream.mimeType==b)};
|
|
1046
|
+
shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){d=a.stream.segmentIndex;d instanceof shaka.media.MetaSegmentIndex&&d.evict(c.manifest_.presentationTimeline.getSeekRangeStart());e=shaka.media.StreamingEngine.logPrefix_(a);shaka.log.v2(e,"checking buffer length");f=Math.max(c.config_.bufferBehind,c.manifest_.presentationTimeline.getMaxSegmentDuration());g=c.playerInterface_.mediaSourceEngine.bufferStart(a.type);
|
|
1047
|
+
if(null==g)return shaka.log.v2(e,"buffer behind okay because nothing buffered:","presentationTime="+b,"bufferBehind="+f),l.return();h=b-g;k=h-f;if(k<=c.config_.evictionGoal)return shaka.log.v2(e,"buffer behind okay:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"underflow="+Math.abs(k)),l.return();shaka.log.v1(e,"buffer behind too large:","presentationTime="+b,"bufferedBehind="+h,"bufferBehind="+f,"evictionGoal="+c.config_.evictionGoal,"overflow="+
|
|
1048
|
+
k);return l.yield(c.playerInterface_.mediaSourceEngine.remove(a.type,g,g+k),2)}c.destroyer_.ensureNotDestroyed();shaka.log.v1(e,"evicted "+k+" seconds");l.jumpToEnd()})};shaka.media.StreamingEngine.isEmbeddedText_=function(a){var b=shaka.util.MimeUtils,c=b.CEA608_CLOSED_CAPTION_MIMETYPE;b=b.CEA708_CLOSED_CAPTION_MIMETYPE;return a&&a.type==shaka.util.ManifestParserUtils.ContentType.TEXT&&(a.stream.mimeType==c||a.stream.mimeType==b)};
|
|
1048
1049
|
shaka.media.StreamingEngine.prototype.fetch_=function(a,b,c){var d=this,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){switch(l.nextAddress){case 1:if(e=b.getSegmentData())return l.return(e);f=null;a.segmentPrefetch&&(f=a.segmentPrefetch.getPrefetchedSegment(b,c));f||(f=d.dispatchFetch_(b,a.stream,c));g=0;a.segmentIterator&&(g=a.segmentIterator.currentPosition());a.operation=f;return l.yield(f.promise,2);case 2:h=l.yieldResult;a.operation=null;k=h.data;if(!b.aesKey){l.jumpTo(3);
|
|
1049
1050
|
break}return l.yield(shaka.media.SegmentUtils.aesDecrypt(k,b.aesKey,g),4);case 4:k=l.yieldResult;case 3:return l.return(k)}})};shaka.media.StreamingEngine.prototype.dispatchFetch_=function(a,b,c){goog.asserts.assert(this.playerInterface_.netEngine,"Must have net engine");return shaka.media.StreamingEngine.dispatchFetch(a,b,c||null,this.config_.retryParameters,this.playerInterface_.netEngine)};
|
|
1050
1051
|
shaka.media.StreamingEngine.dispatchFetch=function(a,b,c,d,e){var f=shaka.net.NetworkingEngine.RequestType.SEGMENT,g=a instanceof shaka.media.SegmentReference?a:void 0,h=g?shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT:shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT;c=shaka.util.Networking.createSegmentRequest(a.getUris(),a.startByte,a.endByte,d,c);c.contentType=b.type;shaka.log.v2("fetching: reference=",a);return e.request(f,c,{type:h,stream:b,segment:g})};
|
|
@@ -1457,8 +1458,8 @@ shaka.Player.prototype.switchHtml5Track_=function(a){goog.asserts.assert(this.vi
|
|
|
1457
1458
|
shaka.Player.prototype.setInitialTextState_=function(a,b){b?(this.shouldInitiallyShowText_(a.audio,b)&&(this.isTextVisible_=!0),this.isTextVisible_&&(this.mediaSourceEngine_.getTextDisplayer().setTextVisibility(!0),goog.asserts.assert(this.shouldStreamText_(),"Should be streaming text")),this.onTextTrackVisibility_()):this.isTextVisible_=!1};
|
|
1458
1459
|
shaka.Player.prototype.shouldInitiallyShowText_=function(a,b){var c=shaka.config.AutoShowText;if(this.config_.autoShowText==c.NEVER)return!1;if(this.config_.autoShowText==c.ALWAYS)return!0;var d=shaka.util.LanguageUtils,e=d.normalize(this.config_.preferredTextLanguage);b=d.normalize(b.language);if(this.config_.autoShowText==c.IF_PREFERRED_TEXT_LANGUAGE)return d.areLanguageCompatible(b,e);if(this.config_.autoShowText==c.IF_SUBTITLES_MAY_BE_NEEDED){if(!a)return!1;a=d.normalize(a.language);return d.areLanguageCompatible(b,
|
|
1459
1460
|
e)&&!d.areLanguageCompatible(a,b)}shaka.log.alwaysWarn("Invalid autoShowText setting!");return!1};shaka.Player.prototype.onManifestUpdate_=function(){this.parser_&&this.parser_.update&&this.parser_.update()};
|
|
1460
|
-
shaka.Player.prototype.onSegmentAppended_=function(a,b,c,d){if(this.playhead_){this.playhead_.notifyOfBufferingChange();var e=this.mediaSourceEngine_.bufferStart(c);!this.isLive()&&this.video_.paused&&null!=e&&0<e&&this.playhead_.getTime()<e&&this.playhead_.setStartTime(e)}this.pollBufferState_();a=(new Map).set("start",a).set("end",b).set("contentType",c).set("isMuxed",d);this.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.SegmentAppended,
|
|
1461
|
-
shaka.Player.prototype.switch_=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;shaka.log.debug("switch_");goog.asserts.assert(this.config_.abr.enabled,"AbrManager should not call switch while disabled!");this.manifest_&&this.streamingEngine_&&a!=this.streamingEngine_.getCurrentVariant()&&this.switchVariant_(a,!0,b,c)};
|
|
1461
|
+
shaka.Player.prototype.onSegmentAppended_=function(a,b,c,d){if(this.playhead_){this.playhead_.notifyOfBufferingChange();var e=this.mediaSourceEngine_.bufferStart(c),f=shaka.util.ManifestParserUtils.ContentType;!this.isLive()&&this.video_.paused&&null!=e&&c!=f.TEXT&&0<e&&this.playhead_.getTime()<e&&this.playhead_.setStartTime(e)}this.pollBufferState_();a=(new Map).set("start",a).set("end",b).set("contentType",c).set("isMuxed",d);this.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.SegmentAppended,
|
|
1462
|
+
a))};shaka.Player.prototype.switch_=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c;shaka.log.debug("switch_");goog.asserts.assert(this.config_.abr.enabled,"AbrManager should not call switch while disabled!");this.manifest_&&this.streamingEngine_&&a!=this.streamingEngine_.getCurrentVariant()&&this.switchVariant_(a,!0,b,c)};
|
|
1462
1463
|
shaka.Player.prototype.onAdaptation_=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.Adaptation,a);this.delayDispatchEvent_(b)};shaka.Player.prototype.onTracksChanged_=function(){var a=shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.TracksChanged);this.delayDispatchEvent_(a)};
|
|
1463
1464
|
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)};
|
|
1464
1465
|
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))};
|
|
@@ -1497,7 +1498,7 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
|
|
|
1497
1498
|
goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.configure);goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);goog.exportProperty(shaka.Player.prototype,"destroyAllPreloads",shaka.Player.prototype.destroyAllPreloads);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);
|
|
1498
1499
|
goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);
|
|
1499
1500
|
goog.exportProperty(shaka.Player.prototype,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);
|
|
1500
|
-
goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.10.
|
|
1501
|
+
goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.10.17-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1501
1502
|
shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.errors_=this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};shaka.ads.AdsStats.prototype.incrementErrors=function(){this.errors_++};
|
|
1502
1503
|
shaka.ads.AdsStats.prototype.getAverageLoadTime_=function(){return this.loadTimes_.length?this.loadTimes_.reduce(function(a,b){return a+b},0)/this.loadTimes_.length:0};shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,averageLoadTime:this.getAverageLoadTime_(),started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_,errors:this.errors_}};shaka.ads.ClientSideAd=function(a,b,c){var d=this;this.ad_=a;this.manager_=b;this.video_=c;this.isPaused_=!1;this.volume_=this.manager_.getVolume();this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.PAUSED,function(){d.isPaused_=!0});this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.RESUMED,function(){d.isPaused_=!1})};shaka.ads.ClientSideAd.prototype.needsSkipUI=function(){return!1};
|
|
1503
1504
|
shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};shaka.ads.ClientSideAd.prototype.getMinSuggestedDuration=function(){return this.ad_.getMinSuggestedDuration()};shaka.ads.ClientSideAd.prototype.getRemainingTime=function(){return this.manager_.getRemainingTime()};shaka.ads.ClientSideAd.prototype.isPaused=function(){return this.isPaused_};shaka.ads.ClientSideAd.prototype.isSkippable=function(){return 0<=this.ad_.getSkipTimeOffset()};
|
|
@@ -1920,7 +1921,7 @@ g=null;if(b=c.inheritChild(a,b,"SegmentTimeline"))d=d.findChildren(b,"S"),g=c.cr
|
|
|
1920
1921
|
shaka.dash.MpdUtils.inheritAttribute=function(a,b,c){b=shaka.dash.MpdUtils.getNodes(a,b);a=null;b=$jscomp.makeIterator(b);for(var d=b.next();!d.done&&!(a=d.value.attributes[c]);d=b.next());return a};shaka.dash.MpdUtils.inheritChild=function(a,b,c){var d=shaka.dash.MpdUtils.getNodes(a,b);a=shaka.util.TXml;b=null;d=$jscomp.makeIterator(d);for(var e=d.next();!e.done&&!(b=a.findChild(e.value,c));e=d.next());return b};
|
|
1921
1922
|
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,
|
|
1922
1923
|
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 u=k.resolveUris([d],[m]);d=shaka.net.NetworkingEngine.RequestType.MANIFEST;k=shaka.net.NetworkingEngine.makeRequest(u,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,
|
|
1923
|
-
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();
|
|
1924
|
+
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();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,u[0],e,f+1)})};
|
|
1924
1925
|
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,
|
|
1925
1926
|
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);};
|
|
1926
1927
|
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(),
|
|
@@ -1972,9 +1973,9 @@ q,w,r.segment$jscomp$9.start,r.segment$jscomp$9.end,f,m,a,n,[],"",null,null,shak
|
|
|
1972
1973
|
shaka.dash.SegmentList.parseMediaSegments_=function(a){var b=[a.representation.segmentList,a.adaptationSet.segmentList,a.period.segmentList].filter(shaka.util.Functional.isNotNull),c=shaka.util.TXml,d=shaka.util.StringUtils;return b.map(function(e){return c.findChildren(e,"SegmentURL")}).reduce(function(e,f){return 0<e.length?e:f}).map(function(e){e.attributes.indexRange&&!a.indexRangeWarningGiven&&(a.indexRangeWarningGiven=!0,shaka.log.warning("We do not support the SegmentURL@indexRange attribute on SegmentList. We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate."));
|
|
1973
1974
|
var f=d.htmlUnescape(e.attributes.media);e=c.parseAttr(e,"mediaRange",c.parseRange,{start:0,end:null});return{mediaUri:f,start:e.start,end:e.end}})};shaka.dash.SegmentTemplate=function(){};
|
|
1974
1975
|
shaka.dash.SegmentTemplate.createStreamInfo=function(a,b,c,d,e,f,g,h,k){goog.asserts.assert(a.representation.segmentTemplate,"Should only be called with SegmentTemplate or segment info defined");var l=shaka.dash.MpdUtils,m=shaka.dash.SegmentTemplate,n=shaka.dash.TimelineSegmentIndex;k||a.representation.initialization||(a.representation.initialization=l.inheritAttribute(a,m.fromInheritance_,"initialization"));var p=a.representation.initialization?m.createInitSegment_(a,g):null,q=m.parseSegmentTemplateInfo_(a);
|
|
1975
|
-
m.checkSegmentTemplateInfo_(a,q);var r=shaka.util.ObjectUtils.shallowCloneObject(a);if(q.indexTemplate)return shaka.dash.SegmentBase.checkSegmentIndexSupport(a,p),{generateSegmentIndex:function(){return m.generateSegmentIndexFromIndexTemplate_(r,b,p,q)}};if(q.segmentDuration)return d||"image"===a.adaptationSet.contentType||(a.
|
|
1976
|
-
q,e,p,f,g,h)}};var t=null;d=d=null;a.period.id&&a.representation.id&&(d=a.period.id+","+a.representation.id,d=c[d])&&(t=d.segmentIndex);var u=a.periodInfo.start,w=a.periodInfo.duration?u+a.periodInfo.duration:Infinity;shaka.log.debug("New manifest "+u+" - "+w);var y=!(a.dynamic&&a.periodInfo.isLastPeriod);t?(c=t,c.appendTemplateInfo(q,u,w,y,p),n=a.presentationTimeline.getSegmentAvailabilityStart(),c.evict(n)):(shaka.log.debug("Creating TSI with end "+
|
|
1977
|
-
u,w,p,y,g,a.representation.segmentSequenceCadence));q.timeline&&"image"!==a.adaptationSet.contentType&&a.presentationTimeline.notifyTimeRange(q.timeline,u);d&&a.dynamic&&(d.segmentIndex=t);return{generateSegmentIndex:function(){t instanceof shaka.dash.TimelineSegmentIndex&&t.isEmpty()&&t.appendTemplateInfo(q,u,w,y,p);return Promise.resolve(t)}}};
|
|
1976
|
+
m.checkSegmentTemplateInfo_(a,q);var r=shaka.util.ObjectUtils.shallowCloneObject(a);if(q.indexTemplate)return shaka.dash.SegmentBase.checkSegmentIndexSupport(a,p),{generateSegmentIndex:function(){return m.generateSegmentIndexFromIndexTemplate_(r,b,p,q)}};if(q.segmentDuration)return d||"image"===a.adaptationSet.contentType||(c=a.periodInfo.start,n=a.period.id,d=a.periodInfo.duration,n=(n=null!=n&&f[n]||d)?c+n:Infinity,a.presentationTimeline.notifyMaxSegmentDuration(q.segmentDuration),a.presentationTimeline.notifyPeriodDuration(c,
|
|
1977
|
+
n)),{generateSegmentIndex:function(){return m.generateSegmentIndexFromDuration_(r,q,e,p,f,g,h)}};var t=null;d=d=null;a.period.id&&a.representation.id&&(d=a.period.id+","+a.representation.id,d=c[d])&&(t=d.segmentIndex);var u=a.periodInfo.start,w=a.periodInfo.duration?u+a.periodInfo.duration:Infinity;shaka.log.debug("New manifest "+u+" - "+w);var y=!(a.dynamic&&a.periodInfo.isLastPeriod);t?(c=t,c.appendTemplateInfo(q,u,w,y,p),n=a.presentationTimeline.getSegmentAvailabilityStart(),c.evict(n)):(shaka.log.debug("Creating TSI with end "+
|
|
1978
|
+
w),t=new n(q,a.representation.id,a.bandwidth,a.representation.getBaseUris,u,w,p,y,g,a.representation.segmentSequenceCadence));q.timeline&&"image"!==a.adaptationSet.contentType&&a.presentationTimeline.notifyTimeRange(q.timeline,u);d&&a.dynamic&&(d.segmentIndex=t);return{generateSegmentIndex:function(){t instanceof shaka.dash.TimelineSegmentIndex&&t.isEmpty()&&t.appendTemplateInfo(q,u,w,y,p);return Promise.resolve(t)}}};
|
|
1978
1979
|
shaka.dash.SegmentTemplate.modifyTimepoints=function(a,b){var c=shaka.util.TXml;a=shaka.dash.MpdUtils.inheritChild(a,shaka.dash.SegmentTemplate.fromInheritance_,"SegmentTimeline");goog.asserts.assert(a,"timeline node not found");var d=c.findChildren(a,"S");goog.asserts.assert(d,"timepoints should exist");c.modifyNodes(d,b);a.children=d};
|
|
1979
1980
|
shaka.dash.SegmentTemplate.removeTimepoints=function(a){a=shaka.dash.MpdUtils.inheritChild(a,shaka.dash.SegmentTemplate.fromInheritance_,"SegmentTimeline");goog.asserts.assert(a,"timeline node not found");a.children=[]};shaka.dash.SegmentTemplate.fromInheritance_=function(a){return a.segmentTemplate};
|
|
1980
1981
|
shaka.dash.SegmentTemplate.parseSegmentTemplateInfo_=function(a){var b=shaka.dash.SegmentTemplate,c=shaka.dash.MpdUtils,d=shaka.util.StringUtils,e=c.parseSegmentInfo(a,b.fromInheritance_),f=c.inheritAttribute(a,b.fromInheritance_,"media");b=c.inheritAttribute(a,b.fromInheritance_,"index");return{segmentDuration:e.segmentDuration,timescale:e.timescale,startNumber:e.startNumber,scaledPresentationTimeOffset:e.scaledPresentationTimeOffset,unscaledPresentationTimeOffset:e.unscaledPresentationTimeOffset,
|
|
@@ -2014,6 +2015,8 @@ h&&(f["URI-REPLACEMENT"].HOST?(h=new goog.Uri(h),h.setDomain(f["URI-REPLACEMENT"
|
|
|
2014
2015
|
return!0});d.length&&(this.lastPathwayUsed_=d[0].pathwayId);d=d.map(function(k){return k.location});if(!d.length&&this.defaultPathwayId_)for(e=$jscomp.makeIterator(this.defaultPathwayId_.split(",")),g=e.next();!g.done;g=e.next())if(g=a.get(g.value))this.lastPathwayUsed_=this.defaultPathwayId_,d.push(g);if(!d.length)for(a=$jscomp.makeIterator(a.values()),e=a.next();!e.done;e=a.next())d.push(e.value);return b?d:shaka.util.ManifestParserUtils.resolveUris(this.baseUris_,d)};shaka.util.PeriodCombiner=function(){this.variants_=[];this.audioStreams_=[];this.videoStreams_=[];this.textStreams_=[];this.imageStreams_=[];this.useStreamOnce_=this.multiTypeVariantsAllowed_=!1;this.usedPeriodIds_=new Set};
|
|
2015
2016
|
shaka.util.PeriodCombiner.prototype.release=function(){var a=this.audioStreams_.concat(this.videoStreams_,this.textStreams_,this.imageStreams_);a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.audioStreams_=[];this.videoStreams_=[];this.textStreams_=[];this.imageStreams_=[];this.variants_=[]};shaka.util.PeriodCombiner.prototype.getVariants=function(){return this.variants_};shaka.util.PeriodCombiner.prototype.getTextStreams=function(){return this.textStreams_.slice()};
|
|
2016
2017
|
shaka.util.PeriodCombiner.prototype.getImageStreams=function(){return this.imageStreams_};
|
|
2018
|
+
shaka.util.PeriodCombiner.prototype.deleteStream=function(a,b){if(a){var c=shaka.util.ManifestParserUtils.ContentType;if(a.type==c.AUDIO){c=$jscomp.makeIterator(this.audioStreams_);for(var d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a})}else if(a.type==c.VIDEO)for(c=$jscomp.makeIterator(this.videoStreams_),d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a}),d.trickModeVideo&&(d.trickModeVideo.matchedStreams=
|
|
2019
|
+
d.trickModeVideo.matchedStreams.filter(function(e){return e!==a}));else if(a.type==c.TEXT)for(c=$jscomp.makeIterator(this.textStreams_),d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a});else if(a.type==c.IMAGE)for(c=$jscomp.makeIterator(this.imageStreams_),d=c.next();!d.done;d=c.next())d=d.value,d.matchedStreams=d.matchedStreams.filter(function(e){return e!==a});a.segmentIndex&&a.closeSegmentIndex();this.usedPeriodIds_.delete(b)}};
|
|
2017
2020
|
shaka.util.PeriodCombiner.prototype.getStreamsPerPeriod_=function(a,b){var c=shaka.util.ManifestParserUtils.ContentType,d=shaka.util.PeriodCombiner,e=[],f=[],g=[],h=[];a=$jscomp.makeIterator(a);for(var k=a.next();!k.done;k=a.next()){var l=k.value;k=new Map(l.audioStreams.map(function(q){return[d.generateAudioKey_(q),q]}));var m=new Map(l.videoStreams.map(function(q){return[d.generateVideoKey_(q),q]})),n=new Map(l.textStreams.map(function(q){return[d.generateTextKey_(q),q]}));l=new Map(l.imageStreams.map(function(q){return[d.generateImageKey_(q),
|
|
2018
2021
|
q]}));if(b){var p=d.dummyStream_(c.TEXT);n.set(d.generateTextKey_(p),p);p=d.dummyStream_(c.IMAGE);l.set(d.generateImageKey_(p),p)}e.push(k);f.push(m);g.push(n);h.push(l)}return{audioStreamsPerPeriod:e,videoStreamsPerPeriod:f,textStreamsPerPeriod:g,imageStreamsPerPeriod:h}};
|
|
2019
2022
|
shaka.util.PeriodCombiner.prototype.combinePeriods=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,k,l,m,n,p,q,r,t,u,w,y,x,v,A,C,z,B,E,J,G,D,H,F,K,L,M;return $jscomp.asyncExecutePromiseGeneratorProgram(function(I){if(1==I.nextAddress){e=shaka.util.ManifestParserUtils.ContentType;if(!b&&1==a.length)return f=d.getStreamsPerPeriod_(a,!1),g=f.audioStreamsPerPeriod,h=f.videoStreamsPerPeriod,k=f.textStreamsPerPeriod,l=f.imageStreamsPerPeriod,d.audioStreams_=Array.from(g[0].values()),d.videoStreams_=
|
|
@@ -2027,17 +2030,17 @@ n.next())q=p.value,r=c.dummyStreamDB_(b.IMAGE),q.set(c.generateImageKey_(r),r);t
|
|
|
2027
2030
|
0),4);case 4:return y=L.yieldResult,L.yield(t.combine_([],g,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_,0),5);case 5:x=L.yieldResult;v=0;if(w.length&&u.length)for(E=$jscomp.makeIterator(u),J=E.next();!J.done;J=E.next())for(G=J.value,D=$jscomp.makeIterator(w),H=D.next();!H.done;H=D.next())F=H.value,K=v++,F.variantIds.push(K),G.variantIds.push(K);else for(A=w.concat(u),C=$jscomp.makeIterator(A),z=C.next();!z.done;z=C.next())B=z.value,B.variantIds=[v++];
|
|
2028
2031
|
return L.return(w.concat(u).concat(y).concat(x))}})};
|
|
2029
2032
|
shaka.util.PeriodCombiner.prototype.combine_=function(a,b,c,d,e,f){var g=this,h,k,l,m,n,p,q,r,t,u,w,y,x,v,A,C,z,B,E,J;return $jscomp.asyncExecutePromiseGeneratorProgram(function(G){switch(G.nextAddress){case 1:h=[];for(k=0;k<b.length;k++)k>=c?h.push(new Set(b[k].values())):h.push(new Set);l=$jscomp.makeIterator(a);m=l.next();case 2:if(m.done){G.jumpTo(4);break}n=m.value;return G.yield(g.extendExistingOutputStream_(n,b,c,e,h,f),5);case 5:p=G.yieldResult;if(!p)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2030
|
-
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);m=l.next();G.jumpTo(2);break;case 4:q=$jscomp.makeIterator(h);for(r=q.next();!r.done;r=q.next())for(t=r.value,u=$jscomp.makeIterator(t),w=u.next();!w.done;w=u.next())y=w.value,(x=g.createNewOutputStream_(y,b,d,e,h))&&a.push(x);v=$jscomp.makeIterator(h);for(A=v.next();!A.done;A=v.next())for(C=A.value,z=$jscomp.makeIterator(C),B=z.next(),E={};!B.done;E={stream$jscomp$
|
|
2031
|
-
!shaka.util.PeriodCombiner.isDummy_(E.stream$jscomp$
|
|
2033
|
+
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);m=l.next();G.jumpTo(2);break;case 4:q=$jscomp.makeIterator(h);for(r=q.next();!r.done;r=q.next())for(t=r.value,u=$jscomp.makeIterator(t),w=u.next();!w.done;w=u.next())y=w.value,(x=g.createNewOutputStream_(y,b,d,e,h))&&a.push(x);v=$jscomp.makeIterator(h);for(A=v.next();!A.done;A=v.next())for(C=A.value,z=$jscomp.makeIterator(C),B=z.next(),E={};!B.done;E={stream$jscomp$92:void 0},B=z.next())if(E.stream$jscomp$92=B.value,
|
|
2034
|
+
!shaka.util.PeriodCombiner.isDummy_(E.stream$jscomp$92)&&(J=a.some(function(D){return function(H){return g.areAVStreamsCompatible_(D.stream$jscomp$92,H)}}(E))))throw shaka.log.error("Unused stream in period-flattening!",E.stream$jscomp$92,a),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);return G.return(a)}})};
|
|
2032
2035
|
shaka.util.PeriodCombiner.prototype.extendExistingOutputStream_=function(a,b,c,d,e,f){var g=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){if(1==h.nextAddress)return g.findMatchesInAllPeriods_(b,a,0<f),goog.asserts.assert(a.createSegmentIndex,"outputStream should be a Stream type!"),a.matchedStreams?a.segmentIndex?h.yield(shaka.util.PeriodCombiner.extendOutputSegmentIndex_(a,c+f),2):h.jumpTo(2):(shaka.log.error("No matches extending output stream!",a,b),h.return(!1));shaka.util.PeriodCombiner.extendOutputStream_(a,
|
|
2033
2036
|
c,d,e,f);return h.return(!0)})};
|
|
2034
|
-
shaka.util.PeriodCombiner.extendOutputSegmentIndex_=function(a,b){var c,d,e,f,g,h
|
|
2035
|
-
|
|
2037
|
+
shaka.util.PeriodCombiner.extendOutputSegmentIndex_=function(a,b){var c,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress){c=[];d=a.matchedStreams;goog.asserts.assert(d,"matched streams should be valid");for(e=b;e<d.length;e++)f=d[e],c.push(f.createSegmentIndex()),f.trickModeVideo&&!f.trickModeVideo.segmentIndex&&c.push(f.trickModeVideo.createSegmentIndex());return k.yield(Promise.all(c),2)}if(a.segmentIndex instanceof shaka.media.MetaSegmentIndex)for(g=b;g<
|
|
2038
|
+
d.length;g++)h=d[g],goog.asserts.assert(h.segmentIndex,"stream should have a segmentIndex."),h.segmentIndex&&a.segmentIndex.appendSegmentIndex(h.segmentIndex);k.jumpToEnd()})};
|
|
2036
2039
|
shaka.util.PeriodCombiner.prototype.createNewOutputStream_=function(a,b,c,d,e){if(shaka.util.PeriodCombiner.isDummy_(a))return null;var f=c(a);this.findMatchesInAllPeriods_(b,f);f.createSegmentIndex&&(f.createSegmentIndex=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){if(f.segmentIndex)return g.jumpTo(0);f.segmentIndex=new shaka.media.MetaSegmentIndex;return g.yield(shaka.util.PeriodCombiner.extendOutputSegmentIndex_(f,0),0)})});if(!f.matchedStreams||!f.matchedStreams.length)return null;
|
|
2037
2040
|
shaka.util.PeriodCombiner.extendOutputStream_(f,0,d,e,0);return f};
|
|
2038
2041
|
shaka.util.PeriodCombiner.extendOutputStream_=function(a,b,c,d,e){var f=shaka.util.ManifestParserUtils.ContentType,g=shaka.util.LanguageUtils,h=a.matchedStreams;goog.asserts.assert(a.matchedStreams,"matchedStreams should be non-null");for(b+=e;b<h.length;b++){var k=h[b];c(a,k);var l=!0;a.type==f.AUDIO&&0==g.relatedness(a.language,k.language)&&(l=!1);if(l&&(d[b-e].delete(k),k.fullMimeTypes))for(k=$jscomp.makeIterator(k.fullMimeTypes.values()),l=k.next();!l.done;l=k.next())a.fullMimeTypes.add(l.value)}};
|
|
2039
2042
|
shaka.util.PeriodCombiner.cloneStream_=function(a){var b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=function(){return Promise.resolve()};b.closeSegmentIndex=function(){b.segmentIndex&&(b.segmentIndex.release(),b.segmentIndex=null);if(b.matchedStreams)for(var c=$jscomp.makeIterator(b.matchedStreams),d=c.next();!d.done;d=c.next())d=d.value,d.segmentIndex&&(d.segmentIndex.release(),d.segmentIndex=null)};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set;
|
|
2040
|
-
b.closedCaptions=null;b.trickModeVideo=null;return b};shaka.util.PeriodCombiner.cloneStreamDB_=function(a){
|
|
2043
|
+
b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;b.trickModeVideo=null;return b};shaka.util.PeriodCombiner.cloneStreamDB_=function(a){var b=Object.assign({},a);b.roles=b.roles.slice();b.keyIds=new Set;b.segments=[];b.variantIds=[];b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;return b};
|
|
2041
2044
|
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);null==a.originalId?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=
|
|
2042
2045
|
","+c);c=shaka.util.DrmUtils.getCommonDrmInfos(a.drmInfos,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=
|
|
2043
2046
|
e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}a.bandwidth&&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");
|
|
@@ -2065,7 +2068,8 @@ shaka.util.PeriodCombiner.generateVideoKey_=function(a){return shaka.util.Period
|
|
|
2065
2068
|
shaka.util.PeriodCombiner.generateAudioKey_=function(a){return shaka.util.PeriodCombiner.generateKey_([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,shaka.util.PeriodCombiner.getCodec_(a.codecs),a.mimeType,a.roles,a.audioSamplingRate,a.primary])};shaka.util.PeriodCombiner.generateTextKey_=function(a){return shaka.util.PeriodCombiner.generateKey_([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])};
|
|
2066
2069
|
shaka.util.PeriodCombiner.generateImageKey_=function(a){return shaka.util.PeriodCombiner.generateKey_([a.width,a.codecs,a.mimeType])};shaka.util.PeriodCombiner.generateKey_=function(a){return JSON.stringify(a)};shaka.util.PeriodCombiner.getCodec_=function(a){if(!shaka.util.PeriodCombiner.memoizedCodecs.has(a)){var b=shaka.util.MimeUtils.getNormalizedCodec(a);shaka.util.PeriodCombiner.memoizedCodecs.set(a,b)}return shaka.util.PeriodCombiner.memoizedCodecs.get(a)};
|
|
2067
2070
|
goog.exportSymbol("shaka.util.PeriodCombiner",shaka.util.PeriodCombiner);goog.exportProperty(shaka.util.PeriodCombiner.prototype,"setUseStreamOnce",shaka.util.PeriodCombiner.prototype.setUseStreamOnce);goog.exportProperty(shaka.util.PeriodCombiner.prototype,"setAllowMultiTypeVariants",shaka.util.PeriodCombiner.prototype.setAllowMultiTypeVariants);goog.exportProperty(shaka.util.PeriodCombiner.prototype,"combinePeriods",shaka.util.PeriodCombiner.prototype.combinePeriods);
|
|
2068
|
-
goog.exportProperty(shaka.util.PeriodCombiner.prototype,"
|
|
2071
|
+
goog.exportProperty(shaka.util.PeriodCombiner.prototype,"deleteStream",shaka.util.PeriodCombiner.prototype.deleteStream);goog.exportProperty(shaka.util.PeriodCombiner.prototype,"getImageStreams",shaka.util.PeriodCombiner.prototype.getImageStreams);goog.exportProperty(shaka.util.PeriodCombiner.prototype,"getTextStreams",shaka.util.PeriodCombiner.prototype.getTextStreams);goog.exportProperty(shaka.util.PeriodCombiner.prototype,"getVariants",shaka.util.PeriodCombiner.prototype.getVariants);
|
|
2072
|
+
shaka.util.PeriodCombiner.BetterOrWorse={BETTER:1,EQUAL:0,WORSE:-1};shaka.util.PeriodCombiner.memoizedCodecs=new Map;shaka.util.XmlUtils=function(){};
|
|
2069
2073
|
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!=
|
|
2070
2074
|
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};
|
|
2071
2075
|
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)};
|
|
@@ -2121,11 +2125,11 @@ shaka.dash.DashParser.prototype.parsePeriods_=function(a,b,c,d){var e=shaka.util
|
|
|
2121
2125
|
l+1!=c.length)shaka.log.debug("Skipping Period with ID "+q+" as its start time is smaller than the largest period start time that has been seen, and ID is unseen before");else{null!==p&&(null===this.largestPeriodStartTime_||p>this.largestPeriodStartTime_)&&(this.largestPeriodStartTime_=p);k=this.parsePeriod_(a,b,{start:p,duration:t,node:m,isLastPeriod:null==t||!n});h.push(k);a.period.id&&t&&(this.periodDurations_[a.period.id]=t);if(null==t){n&&shaka.log.warning("Skipping Period",l+1,"and any subsequent Periods:",
|
|
2122
2126
|
"Period",l+1,"does not have a valid start time.",n);k=null;break}k=p+t}}if(d)for(a=$jscomp.makeIterator(h),b=a.next();!b.done;b=a.next())b=b.value.id,this.lastManifestUpdatePeriodIds_.includes(b)||this.lastManifestUpdatePeriodIds_.push(b);else this.lastManifestUpdatePeriodIds_=h.map(function(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."),
|
|
2123
2127
|
{periods:h,duration:f+g,durationDerivedFromPeriods:!1}):{periods:h,duration:k,durationDerivedFromPeriods:!0}};
|
|
2124
|
-
shaka.dash.DashParser.prototype.cleanStreamMap_=function(){var a=this,b=Object.keys(this.indexStreamMap_)
|
|
2128
|
+
shaka.dash.DashParser.prototype.cleanStreamMap_=function(){var a=this,b=Object.keys(this.indexStreamMap_).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())e=e.value,this.periodCombiner_&&this.periodCombiner_.deleteStream(this.streamMap_[e],c),delete this.streamMap_[e];delete this.indexStreamMap_[c]}};
|
|
2125
2129
|
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,
|
|
2126
2130
|
"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!=
|
|
2127
2131
|
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=
|
|
2128
|
-
{stream$jscomp$
|
|
2132
|
+
{stream$jscomp$102:void 0},l=k.next())m.stream$jscomp$102=l.value,m.stream$jscomp$102.trickModeVideo=f.streams.find(function(n){return function(p){return shaka.util.MimeUtils.getNormalizedCodec(n.stream$jscomp$102.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,
|
|
2129
2133
|
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},[])};
|
|
2130
2134
|
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(F){return F.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=
|
|
2131
2135
|
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(F){switch(F){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var u=function(F){switch(F){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);
|
|
@@ -2737,7 +2741,7 @@ shaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_=function(){try{return!!shaka.poly
|
|
|
2737
2741
|
shaka.text.LrcTextParser.prototype.parseMedia=function(a,b){var c=shaka.text.LrcTextParser,d=null,e=[];a=shaka.util.StringUtils.fromUTF8(a).split(/\r?\n/);a=$jscomp.makeIterator(a);for(var f=a.next();!f.done;f=a.next()){var g=f.value;g&&!/^\s+$/.test(g)&&((f=c.lyricLine_.exec(g))?(g=c.parseTime_(f[1]),f=new shaka.text.Cue(g,b.segmentEnd?b.segmentEnd:g+2,f[2]),d&&(d.endTime=g,e.push(d)),d=f):shaka.log.warning("LrcTextParser encountered an unknown line.",g))}d&&e.push(d);return e};
|
|
2738
2742
|
shaka.text.LrcTextParser.parseTime_=function(a){var b=shaka.text.LrcTextParser.timeFormat_.exec(a);a=parseInt(b[1],10);b=parseFloat(b[2].replace(",","."));return 60*a+b};goog.exportSymbol("shaka.text.LrcTextParser",shaka.text.LrcTextParser);goog.exportProperty(shaka.text.LrcTextParser.prototype,"parseMedia",shaka.text.LrcTextParser.prototype.parseMedia);goog.exportProperty(shaka.text.LrcTextParser.prototype,"setManifestType",shaka.text.LrcTextParser.prototype.setManifestType);
|
|
2739
2743
|
goog.exportProperty(shaka.text.LrcTextParser.prototype,"setSequenceMode",shaka.text.LrcTextParser.prototype.setSequenceMode);goog.exportProperty(shaka.text.LrcTextParser.prototype,"parseInit",shaka.text.LrcTextParser.prototype.parseInit);shaka.text.LrcTextParser.lyricLine_=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/;shaka.text.LrcTextParser.timeFormat_=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;shaka.text.TextEngine.registerParser("application/x-subtitle-lrc",function(){return new shaka.text.LrcTextParser});shaka.text.TtmlTextParser=function(){};shaka.text.TtmlTextParser.prototype.parseInit=function(a){goog.asserts.assert(!1,"TTML does not have init segments")};shaka.text.TtmlTextParser.prototype.setSequenceMode=function(a){};shaka.text.TtmlTextParser.prototype.setManifestType=function(a){};
|
|
2740
|
-
shaka.text.TtmlTextParser.prototype.parseMedia=function(a,b,c){var d=shaka.text.TtmlTextParser,e=shaka.util.TXml,f=d.parameterNs_,g=d.styleNs_,h=shaka.util.StringUtils.fromUTF8(a);a=[];if(""==h)return a;var k=e.parseXmlString(h,"tt");if(!k)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_XML,"Failed to parse TTML.");h=e.getElementsByTagName(k,"body")[0];if(!h)return[];var l=e.getAttributeNSList(k,f,"frameRate"),m=e.getAttributeNSList(k,
|
|
2744
|
+
shaka.text.TtmlTextParser.prototype.parseMedia=function(a,b,c){var d=shaka.text.TtmlTextParser,e=shaka.util.TXml,f=d.parameterNs_,g=d.styleNs_,h=shaka.util.StringUtils.fromUTF8(a);a=[];if(""==h)return a;var k=e.parseXmlString(h,"tt",!0);if(!k)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_XML,"Failed to parse TTML.");h=e.getElementsByTagName(k,"body")[0];if(!h)return[];var l=e.getAttributeNSList(k,f,"frameRate"),m=e.getAttributeNSList(k,
|
|
2741
2745
|
f,"subFrameRate"),n=e.getAttributeNSList(k,f,"frameRateMultiplier"),p=e.getAttributeNSList(k,f,"tickRate"),q=e.getAttributeNSList(k,f,"cellResolution"),r=k.attributes["xml:space"]||"default";f=e.getAttributeNSList(k,g,"extent");if("default"!=r&&"preserve"!=r)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_XML,"Invalid xml:space value: "+r);g="default"==r;l=new d.RateInfo_(l,m,n,p);m=d.getCellResolution_(q);n=e.getElementsByTagName(k,
|
|
2742
2746
|
"metadata")[0];n=(n?n.children:[]).filter(function(u){return"\n"!=u});p=e.getElementsByTagName(k,"style");k=e.getElementsByTagName(k,"region");q=[];r=$jscomp.makeIterator(k);for(var t=r.next();!t.done;t=r.next())(t=d.parseCueRegion_(t.value,p,f))&&q.push(t);if(e.findChildren(h,"p").length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_CUE,"<p> can only be inside <div> in TTML");f=$jscomp.makeIterator(e.findChildren(h,
|
|
2743
2747
|
"div"));for(r=f.next();!r.done;r=f.next())if(e.findChildren(r.value,"span").length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_CUE,"<span> can only be inside <p> in TTML");if(b=d.parseCue_(h,b,l,n,p,k,q,g,m,null,!1,c))b.backgroundColor||(b.backgroundColor="transparent"),a.push(b);return a};
|