shaka-player 4.11.1 → 4.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deps.js +1 -1
- package/dist/locales.js +37 -37
- package/dist/shaka-player.compiled.debug.js +25 -23
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.js +151 -149
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.debug.js +30 -27
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.js +323 -321
- package/dist/shaka-player.ui.map +4 -4
- package/lib/dash/dash_parser.js +7 -2
- package/lib/media/segment_index.js +14 -2
- package/lib/media/streaming_engine.js +6 -0
- package/lib/player.js +1 -1
- package/lib/text/ttml_text_parser.js +23 -3
- package/lib/util/periods.js +4 -1
- package/package.json +1 -1
package/dist/deps.js
CHANGED
|
@@ -92,7 +92,7 @@ goog.addDependency('../../../../lib/media/segment_prefetch.js', ['shaka.media.Se
|
|
|
92
92
|
goog.addDependency('../../../../lib/media/segment_reference.js', ['shaka.media.InitSegmentReference', 'shaka.media.SegmentReference'], ['goog.asserts', 'shaka.log', 'shaka.util.ArrayUtils', 'shaka.util.BufferUtils'], {'lang': 'es6'});
|
|
93
93
|
goog.addDependency('../../../../lib/media/segment_utils.js', ['shaka.media.SegmentUtils'], ['goog.asserts', 'shaka.log', 'shaka.media.Capabilities', 'shaka.media.ClosedCaptionParser', 'shaka.util.BufferUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Mp4BoxParsers', 'shaka.util.Mp4Parser', 'shaka.util.TsParser'], {'lang': 'es8'});
|
|
94
94
|
goog.addDependency('../../../../lib/media/stall_detector.js', ['shaka.media.StallDetector', 'shaka.media.StallDetector.Implementation', 'shaka.media.StallDetector.MediaElementImplementation'], ['shaka.media.TimeRangesUtils', 'shaka.util.FakeEvent', 'shaka.util.IReleasable'], {'lang': 'es6'});
|
|
95
|
-
goog.addDependency('../../../../lib/media/streaming_engine.js', ['shaka.media.StreamingEngine'], ['goog.asserts', 'shaka.log', 'shaka.media.InitSegmentReference', 'shaka.media.ManifestParser', 'shaka.media.MediaSourceEngine', 'shaka.media.SegmentIterator', 'shaka.media.SegmentPrefetch', 'shaka.media.SegmentReference', 'shaka.media.SegmentUtils', 'shaka.net.Backoff', 'shaka.net.NetworkingEngine', 'shaka.util.DelayedTick', 'shaka.util.Destroyer', 'shaka.util.Error', 'shaka.util.FakeEvent', 'shaka.util.IDestroyable', 'shaka.util.Id3Utils', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Mp4BoxParsers', 'shaka.util.Mp4Parser', 'shaka.util.Networking'], {'lang': 'es8'});
|
|
95
|
+
goog.addDependency('../../../../lib/media/streaming_engine.js', ['shaka.media.StreamingEngine'], ['goog.asserts', 'shaka.log', 'shaka.media.InitSegmentReference', 'shaka.media.ManifestParser', 'shaka.media.MediaSourceEngine', 'shaka.media.MetaSegmentIndex', 'shaka.media.SegmentIterator', 'shaka.media.SegmentPrefetch', 'shaka.media.SegmentReference', 'shaka.media.SegmentUtils', 'shaka.net.Backoff', 'shaka.net.NetworkingEngine', 'shaka.util.DelayedTick', 'shaka.util.Destroyer', 'shaka.util.Error', 'shaka.util.FakeEvent', 'shaka.util.IDestroyable', 'shaka.util.Id3Utils', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Mp4BoxParsers', 'shaka.util.Mp4Parser', 'shaka.util.Networking'], {'lang': 'es8'});
|
|
96
96
|
goog.addDependency('../../../../lib/media/time_ranges_utils.js', ['shaka.media.TimeRangesUtils'], [], {'lang': 'es6'});
|
|
97
97
|
goog.addDependency('../../../../lib/media/video_wrapper.js', ['shaka.media.VideoWrapper', 'shaka.media.VideoWrapper.PlayheadMover'], ['goog.asserts', 'shaka.log', 'shaka.util.EventManager', 'shaka.util.IReleasable', 'shaka.util.MediaReadyState', 'shaka.util.Timer'], {'lang': 'es6'});
|
|
98
98
|
goog.addDependency('../../../../lib/media/webm_segment_index_parser.js', ['shaka.media.WebmSegmentIndexParser'], ['goog.asserts', 'shaka.log', 'shaka.media.InitSegmentReference', 'shaka.media.SegmentReference', 'shaka.util.EbmlElement', 'shaka.util.EbmlParser', 'shaka.util.Error'], {'lang': 'es6'});
|
package/dist/locales.js
CHANGED
|
@@ -912,51 +912,51 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
912
912
|
* @const
|
|
913
913
|
*/
|
|
914
914
|
shaka.ui.Locales.Ids = {
|
|
915
|
-
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
916
|
-
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
917
|
-
AD_STATISTICS: 'AD_STATISTICS',
|
|
918
|
-
BACK: 'BACK',
|
|
919
|
-
CAPTIONS: 'CAPTIONS',
|
|
920
|
-
PAUSE: 'PAUSE',
|
|
921
|
-
LOOP: 'LOOP',
|
|
922
|
-
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
923
|
-
QUALITY: 'QUALITY',
|
|
924
|
-
FULL_SCREEN: 'FULL_SCREEN',
|
|
925
|
-
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
926
|
-
OFF: 'OFF',
|
|
927
|
-
STATISTICS: 'STATISTICS',
|
|
928
915
|
AD_TIME: 'AD_TIME',
|
|
929
|
-
|
|
930
|
-
|
|
916
|
+
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
917
|
+
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
918
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
931
919
|
REPLAY: 'REPLAY',
|
|
932
|
-
|
|
920
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
921
|
+
AD_DURATION: 'AD_DURATION',
|
|
922
|
+
LOOP: 'LOOP',
|
|
923
|
+
SKIP_AD: 'SKIP_AD',
|
|
933
924
|
LANGUAGE: 'LANGUAGE',
|
|
925
|
+
AIRPLAY: 'AIRPLAY',
|
|
926
|
+
CHAPTERS: 'CHAPTERS',
|
|
927
|
+
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
928
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
929
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
930
|
+
REWIND: 'REWIND',
|
|
931
|
+
RESOLUTION: 'RESOLUTION',
|
|
934
932
|
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
935
|
-
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
936
933
|
UNMUTE: 'UNMUTE',
|
|
934
|
+
ON: 'ON',
|
|
935
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
936
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
937
937
|
LIVE: 'LIVE',
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
938
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
939
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
941
940
|
RECENTER_VR: 'RECENTER_VR',
|
|
942
|
-
|
|
943
|
-
FAST_FORWARD: 'FAST_FORWARD',
|
|
944
|
-
VOLUME: 'VOLUME',
|
|
945
|
-
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
946
|
-
ON: 'ON',
|
|
947
|
-
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
948
|
-
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME',
|
|
949
|
-
AD_DURATION: 'AD_DURATION',
|
|
941
|
+
OFF: 'OFF',
|
|
950
942
|
CAST: 'CAST',
|
|
943
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
944
|
+
STATISTICS: 'STATISTICS',
|
|
945
|
+
SEEK: 'SEEK',
|
|
946
|
+
CAPTIONS: 'CAPTIONS',
|
|
947
|
+
FAST_FORWARD: 'FAST_FORWARD',
|
|
948
|
+
PLAY: 'PLAY',
|
|
949
|
+
AD_STATISTICS: 'AD_STATISTICS',
|
|
950
|
+
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
951
|
+
SURROUND: 'SURROUND',
|
|
952
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
951
953
|
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
952
|
-
|
|
953
|
-
AD_PROGRESS: 'AD_PROGRESS',
|
|
954
|
-
REWIND: 'REWIND',
|
|
954
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
955
955
|
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
956
|
+
MUTE: 'MUTE',
|
|
957
|
+
QUALITY: 'QUALITY',
|
|
958
|
+
BACK: 'BACK',
|
|
959
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
960
|
+
VOLUME: 'VOLUME',
|
|
961
|
+
PAUSE: 'PAUSE',
|
|
962
962
|
};
|
|
@@ -73,8 +73,8 @@ $jscomp.assign=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.assign?Obj
|
|
|
73
73
|
$jscomp.polyfill("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}},"es9","es3");$jscomp.polyfill("Array.prototype.entries",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(b,c){return[b,c]})}},"es6","es3");
|
|
74
74
|
$jscomp.polyfill("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}},"es6","es3");$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(b){var c=$jscomp.checkStringArgs(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}},"es6","es3");
|
|
75
75
|
$jscomp.polyfill("Number.isFinite",function(a){return a?a:function(b){return"number"!==typeof b?!1:!isNaN(b)&&Infinity!==b&&-Infinity!==b}},"es6","es3");$jscomp.polyfill("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push(b[d]);return c}},"es8","es3");$jscomp.polyfill("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}},"es6","es3");$jscomp.polyfill("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991},"es6","es3");
|
|
76
|
-
$jscomp.polyfill("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}},"es6","es3");
|
|
77
|
-
goog.exportPath_=function(a,b,c,d){a=a.split(".");d=d||goog.global;a[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)if(a.length||void 0===b)d=d[e]&&d[e]!==Object.prototype[e]?d[e]:d[e]={};else if(!c&&goog.isObject(b)&&goog.isObject(d[e]))for(var f in b)b.hasOwnProperty(f)&&(d[e][f]=b[f]);else d[e]=b};
|
|
76
|
+
$jscomp.polyfill("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=$jscomp.checkStringArgs(this,b,"endsWith");b+="";void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}},"es6","es3");$jscomp.polyfill("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var c=Math.floor(Math.abs(b));return 0>b?-c:c}},"es6","es3");
|
|
77
|
+
var COMPILED=!0,goog=goog||{};goog.global=this||self;goog.exportPath_=function(a,b,c,d){a=a.split(".");d=d||goog.global;a[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)if(a.length||void 0===b)d=d[e]&&d[e]!==Object.prototype[e]?d[e]:d[e]={};else if(!c&&goog.isObject(b)&&goog.isObject(d[e]))for(var f in b)b.hasOwnProperty(f)&&(d[e][f]=b[f]);else d[e]=b};
|
|
78
78
|
goog.define=function(a,b){if(!COMPILED){var c=goog.global.CLOSURE_UNCOMPILED_DEFINES,d=goog.global.CLOSURE_DEFINES;c&&void 0===c.nodeType&&Object.prototype.hasOwnProperty.call(c,a)?b=c[a]:d&&void 0===d.nodeType&&Object.prototype.hasOwnProperty.call(d,a)&&(b=d[a])}return b};goog.FEATURESET_YEAR=2012;goog.DEBUG=!0;goog.LOCALE="en";goog.getLocale=function(){return goog.LOCALE};goog.TRUSTED_SITE=!0;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1;
|
|
79
79
|
goog.provide=function(a){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(a))throw Error('Namespace "'+a+'" already declared.');goog.constructNamespace_(a)};goog.constructNamespace_=function(a,b,c){if(!COMPILED){delete goog.implicitNamespaces_[a];for(var d=a;(d=d.substring(0,d.lastIndexOf(".")))&&!goog.getObjectByName(d);)goog.implicitNamespaces_[d]=!0}goog.exportPath_(a,b,c)};goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/;
|
|
80
80
|
goog.getScriptNonce_=function(a){a=(a||goog.global).document;return(a=a.querySelector&&a.querySelector("script[nonce]"))&&(a=a.nonce||a.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(a)?a:""};goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/;
|
|
@@ -907,10 +907,10 @@ shaka.media.SegmentIterator.prototype.current=function(){var a=this.segmentIndex
|
|
|
907
907
|
shaka.media.SegmentIterator.prototype.next=function(){var a=this.segmentIndex_.get(this.currentPosition_);this.reverse?a&&a.hasPartialSegments()?(this.currentPartialPosition_--,0>this.currentPartialPosition_&&(this.currentPosition_--,(a=this.segmentIndex_.get(this.currentPosition_))&&a.hasPartialSegments()?this.currentPartialPosition_=a.partialReferences.length-1:this.currentPartialPosition_=0)):(this.currentPosition_--,this.currentPartialPosition_=0):a&&a.hasPartialSegments()?(this.currentPartialPosition_++,
|
|
908
908
|
a.hasAllPartialSegments()&&this.currentPartialPosition_==a.partialReferences.length&&(this.currentPosition_++,this.currentPartialPosition_=0)):(this.currentPosition_++,this.currentPartialPosition_=0);a=this.current();return{value:a,done:!a}};goog.exportSymbol("shaka.media.SegmentIterator",shaka.media.SegmentIterator);goog.exportProperty(shaka.media.SegmentIterator.prototype,"next",shaka.media.SegmentIterator.prototype.next);goog.exportProperty(shaka.media.SegmentIterator.prototype,"current",shaka.media.SegmentIterator.prototype.current);
|
|
909
909
|
goog.exportProperty(shaka.media.SegmentIterator.prototype,"currentPosition",shaka.media.SegmentIterator.prototype.currentPosition);goog.exportProperty(shaka.media.SegmentIterator.prototype,"setReverse",shaka.media.SegmentIterator.prototype.setReverse);shaka.media.MetaSegmentIndex=function(){shaka.media.SegmentIndex.call(this,[]);this.indexes_=[]};$jscomp.inherits(shaka.media.MetaSegmentIndex,shaka.media.SegmentIndex);
|
|
910
|
-
shaka.media.MetaSegmentIndex.prototype.appendSegmentIndex=function(a){goog.asserts.assert(0==this.indexes_.length||0==a.getNumEvicted(),"Should not append a new segment index with already-evicted segments");this.indexes_.push(a)};
|
|
911
|
-
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)};
|
|
912
|
-
shaka.media.MetaSegmentIndex.prototype.find=function(a){for(var b=
|
|
913
|
-
shaka.media.MetaSegmentIndex.prototype.get=function(a){for(var b=
|
|
910
|
+
shaka.media.MetaSegmentIndex.prototype.evictEmpty=function(){for(;1<this.indexes_.length&&this.indexes_[0].isEmpty();){var a=this.indexes_.shift();this.numEvicted_+=a.getNumEvicted();a.release()}};shaka.media.MetaSegmentIndex.prototype.appendSegmentIndex=function(a){goog.asserts.assert(0==this.indexes_.length||0==a.getNumEvicted(),"Should not append a new segment index with already-evicted segments");this.indexes_.push(a)};
|
|
911
|
+
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)};
|
|
912
|
+
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};
|
|
913
|
+
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!")};
|
|
914
914
|
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){goog.asserts.assert(!1,"evict() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.mergeAndEvict=function(a,b){goog.asserts.assert(!1,"mergeAndEvict() should not be used in MetaSegmentIndex!")};shaka.media.MetaSegmentIndex.prototype.fit=function(a,b){goog.asserts.assert(!1,"fit() should not be used in MetaSegmentIndex!")};
|
|
915
915
|
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);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"fit",shaka.media.MetaSegmentIndex.prototype.fit);
|
|
916
916
|
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);goog.exportProperty(shaka.media.MetaSegmentIndex.prototype,"offset",shaka.media.MetaSegmentIndex.prototype.offset);
|
|
@@ -1060,9 +1060,9 @@ c.reader.getPosition());if(b&&b.includes(d)||this.config_.dispatchAllEmsgBoxes)i
|
|
|
1060
1060
|
d)&&(d=shaka.util.Id3Utils.getID3Frames(a),d.length))this.playerInterface_.onMetadata([{cueTime:l,data:a,frames:d,dts:l,pts:l}],0,b)};
|
|
1061
1061
|
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,
|
|
1062
1062
|
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()};
|
|
1063
|
-
shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(
|
|
1064
|
-
"bufferBehind="+
|
|
1065
|
-
shaka.log.v1(
|
|
1063
|
+
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.evictEmpty();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);if(null==g)return shaka.log.v2(e,
|
|
1064
|
+
"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="+k);return l.yield(c.playerInterface_.mediaSourceEngine.remove(a.type,
|
|
1065
|
+
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)};
|
|
1066
1066
|
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);
|
|
1067
1067
|
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,d){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)};
|
|
1068
1068
|
shaka.media.StreamingEngine.dispatchFetch=function(a,b,c,d,e,f){f=void 0===f?!1:f;var g=shaka.net.NetworkingEngine.RequestType.SEGMENT,h=a instanceof shaka.media.SegmentReference?a:void 0,k=h?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(g,c,{type:k,stream:b,segment:h,
|
|
@@ -1522,7 +1522,7 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
|
|
|
1522
1522
|
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);
|
|
1523
1523
|
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);
|
|
1524
1524
|
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);
|
|
1525
|
-
goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.11.
|
|
1525
|
+
goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.11.2-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1526
1526
|
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_++};
|
|
1527
1527
|
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};
|
|
1528
1528
|
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()};
|
|
@@ -2081,12 +2081,13 @@ shaka.util.PeriodCombiner.extendOutputStream_(f,0,d,e,0);return f};
|
|
|
2081
2081
|
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)}};
|
|
2082
2082
|
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;
|
|
2083
2083
|
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};
|
|
2084
|
-
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
|
|
2085
|
-
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=
|
|
2086
|
-
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");
|
|
2087
|
-
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,
|
|
2088
|
-
|
|
2089
|
-
|
|
2084
|
+
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+=
|
|
2085
|
+
","+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=
|
|
2086
|
+
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");
|
|
2087
|
+
for(var g=$jscomp.makeIterator(a.trickModeVideo.matchedStreams),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,
|
|
2088
|
+
b))};
|
|
2089
|
+
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),c=
|
|
2090
|
+
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};
|
|
2090
2091
|
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_,
|
|
2091
2092
|
image:shaka.util.PeriodCombiner.areImageStreamsCompatible_}[b.type];for(var g={audio:shaka.util.PeriodCombiner.isAudioStreamBetterMatch_,video:shaka.util.PeriodCombiner.isVideoStreamBetterMatch_,text:shaka.util.PeriodCombiner.isTextStreamBetterMatch_,image:shaka.util.PeriodCombiner.isImageStreamBetterMatch_}[b.type],h=$jscomp.makeIterator(a.values()),k=h.next();!k.done;k=h.next())k=k.value,!f(b,k)||b.fastSwitching!=k.fastSwitching||e&&!g(b,e,k)||(e=k)}this.useStreamOnce_&&!shaka.util.PeriodCombiner.isDummy_(e)&&
|
|
2092
2093
|
a.delete(d(e));return e};shaka.util.PeriodCombiner.areAVStreamsExactMatch_=function(a,b){return a.mimeType!=b.mimeType?!1:shaka.util.PeriodCombiner.getCodec_(a.codecs)===shaka.util.PeriodCombiner.getCodec_(b.codecs)};shaka.util.PeriodCombiner.prototype.setAllowMultiTypeVariants=function(a){this.multiTypeVariantsAllowed_=a};shaka.util.PeriodCombiner.prototype.setUseStreamOnce=function(a){this.useStreamOnce_=a};
|
|
@@ -2215,8 +2216,8 @@ shaka.dash.DashParser.prototype.parseUtcTiming_=function(a,b){var c=this,d,e,f,g
|
|
|
2215
2216
|
switch(k){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return p.jumpTo(7);case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return p.jumpTo(8);case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":return m=Date.parse(l),p.return(isNaN(m)?0:m-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":shaka.log.alwaysWarn("NTP UTCTiming scheme is not supported");
|
|
2216
2217
|
break;default:shaka.log.alwaysWarn("Unrecognized scheme in UTCTiming element",k)}p.jumpTo(9);break;case 7:return p.yield(c.requestForTiming_(a,l,"HEAD"),10);case 10:return p.return(p.yieldResult);case 8:return p.yield(c.requestForTiming_(a,l,"GET"),11);case 11:return p.return(p.yieldResult);case 9:p.leaveTryBlock(3);break;case 5:n=p.enterCatchBlock(),shaka.log.warning("Error fetching time from UTCTiming elem",n.message);case 3:g=f.next();p.jumpTo(2);break;case 4:return shaka.log.alwaysWarn("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),
|
|
2217
2218
|
p.return(0)}})};
|
|
2218
|
-
shaka.dash.DashParser.prototype.parseEventStream_=function(a,b,c,d){var e=shaka.util.TXml,f=shaka.util.TXml.parseNonNegativeInt,g=c.attributes.schemeIdUri||"",h=c.attributes.value||"",k=e.parseAttr(c,"timescale",f)||1;c=$jscomp.makeIterator(e.findChildren(c,"Event"));for(var
|
|
2219
|
-
|
|
2219
|
+
shaka.dash.DashParser.prototype.parseEventStream_=function(a,b,c,d){var e=shaka.util.TXml,f=shaka.util.TXml.parseNonNegativeInt,g=c.attributes.schemeIdUri||"",h=c.attributes.value||"",k=e.parseAttr(c,"timescale",f)||1,l=e.parseAttr(c,"presentationTimeOffset",f)||0;c=$jscomp.makeIterator(e.findChildren(c,"Event"));for(var m=c.next();!m.done;m=c.next()){m=m.value;var n=e.parseAttr(m,"presentationTime",f)||0,p=e.parseAttr(m,"duration",f)||0;n=Math.max((n-l)/k+a,a);p=n+p/k;null!=b&&(n=Math.min(n,a+b),
|
|
2220
|
+
p=Math.min(p,a+b));p<d||(m={schemeIdUri:g,value:h,startTime:n,endTime:p,id:m.attributes.id||"",eventElement:e.txmlNodeToDomElement(m),eventNode:e.cloneNode(m)},this.playerInterface_.onTimelineRegionAdded(m))}};
|
|
2220
2221
|
shaka.dash.DashParser.prototype.requestSegment_=function(a,b,c,d){var e=this,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress)return f=shaka.net.NetworkingEngine.RequestType.SEGMENT,g=d?shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT:shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT,h=shaka.util.Networking.createSegmentRequest(a,b,c,e.config_.retryParameters),l.yield(e.makeNetworkRequest_(h,f,{type:g}),2);k=l.yieldResult;return l.return(k.data)})};
|
|
2221
2222
|
shaka.dash.DashParser.guessContentType_=function(a,b){b=shaka.util.MimeUtils.getFullType(a,b);return shaka.text.TextEngine.isTypeSupported(b)?shaka.util.ManifestParserUtils.ContentType.TEXT:a.split("/")[0]};shaka.dash.DashParser.prototype.makeNetworkRequest_=function(a,b,c){c||(c={});c.isPreload=this.isPreloadFn_();a=this.playerInterface_.networkingEngine.request(b,a,c);this.operationManager_.manage(a);return a.promise};
|
|
2222
2223
|
shaka.dash.DashParser.prototype.updatePatchLocationNodes_=function(a){shaka.util.TXml.modifyNodes(this.patchLocationNodes_,a)};
|
|
@@ -2794,13 +2795,14 @@ k=shaka.text.TtmlTextParser.getElementsFromCollection_(u,"region",f,"")[0];if(u.
|
|
|
2794
2795
|
shaka.text.TtmlTextParser.parseCueRegion_=function(a,b,c){var d=shaka.text.TtmlTextParser,e=new shaka.text.CueRegion,f=a.attributes["xml:id"];if(!f)return shaka.log.warning("TtmlTextParser parser encountered a region with no id. Region will be ignored."),null;e.id=f;f=null;c&&(f=d.percentValues_.exec(c)||d.pixelValues_.exec(c));c=f?Number(f[1]):null;f=f?Number(f[2]):null;var g,h=d.getStyleAttributeFromRegion_(a,b,"extent");if(h){var k=(g=d.percentValues_.exec(h))||d.pixelValues_.exec(h);null!=k&&
|
|
2795
2796
|
(e.width=Number(k[1]),e.height=Number(k[2]),g||(null!=c&&(e.width=100*e.width/c),null!=f&&(e.height=100*e.height/f)),e.widthUnits=g||null!=c?shaka.text.CueRegion.units.PERCENTAGE:shaka.text.CueRegion.units.PX,e.heightUnits=g||null!=f?shaka.text.CueRegion.units.PERCENTAGE:shaka.text.CueRegion.units.PX)}if(a=d.getStyleAttributeFromRegion_(a,b,"origin"))if(k=(g=d.percentValues_.exec(a))||d.pixelValues_.exec(a),null!=k)e.viewportAnchorX=Number(k[1]),e.viewportAnchorY=Number(k[2]),g?h||(e.width=100-e.viewportAnchorX,
|
|
2796
2797
|
e.widthUnits=shaka.text.CueRegion.units.PERCENTAGE,e.height=100-e.viewportAnchorY,e.heightUnits=shaka.text.CueRegion.units.PERCENTAGE):(null!=f&&(e.viewportAnchorY=100*e.viewportAnchorY/f),null!=c&&(e.viewportAnchorX=100*e.viewportAnchorX/c)),e.viewportAnchorUnits=g||null!=c?shaka.text.CueRegion.units.PERCENTAGE:shaka.text.CueRegion.units.PX;return e};
|
|
2798
|
+
shaka.text.TtmlTextParser.convertTTMLrgbaToHTMLrgba_=function(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(","),4==b.length)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a};
|
|
2797
2799
|
shaka.text.TtmlTextParser.addStyle_=function(a,b,c,d,e,f,g,h){var k=shaka.text.TtmlTextParser,l=shaka.util.TXml,m=shaka.text.Cue;g=g||h;"rtl"==k.getStyleAttribute_(b,c,f,"direction",g)&&(a.direction=m.direction.HORIZONTAL_RIGHT_TO_LEFT);h=k.getStyleAttribute_(b,c,f,"writingMode",g);"tb"==h||"tblr"==h?a.writingMode=m.writingMode.VERTICAL_LEFT_TO_RIGHT:"tbrl"==h?a.writingMode=m.writingMode.VERTICAL_RIGHT_TO_LEFT:"rltb"==h||"rl"==h?a.direction=m.direction.HORIZONTAL_RIGHT_TO_LEFT:h&&(a.direction=m.direction.HORIZONTAL_LEFT_TO_RIGHT);
|
|
2798
2800
|
(h=k.getStyleAttribute_(b,c,f,"textAlign",!0))?(a.positionAlign=k.textAlignToPositionAlign_[h],a.lineAlign=k.textAlignToLineAlign_[h],goog.asserts.assert(h.toUpperCase()in m.textAlign,h.toUpperCase()+" Should be in Cue.textAlign values!"),a.textAlign=m.textAlign[h.toUpperCase()]):a.textAlign=m.textAlign.CENTER;if(h=k.getStyleAttribute_(b,c,f,"displayAlign",!0))goog.asserts.assert(h.toUpperCase()in m.displayAlign,h.toUpperCase()+" Should be in Cue.displayAlign values!"),a.displayAlign=m.displayAlign[h.toUpperCase()];
|
|
2799
|
-
if(h=k.getStyleAttribute_(b,c,f,"color",g))a.color=h;if(h=k.getStyleAttribute_(b,c,f,"backgroundColor",g))a.backgroundColor=h;if(h=k.getStyleAttribute_(b,c,f,"border",g))a.border=h;if(h=k.getStyleAttribute_(b,c,f,"fontFamily",g))switch(h){case "monospaceSerif":a.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":a.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":a.fontFamily=
|
|
2800
|
-
"Consolas,monospace";break;case "proportionalSerif":a.fontFamily="serif";break;default:a.fontFamily=h.split(",").filter(function(n){return"default"!=n}).join(",")}(h=k.getStyleAttribute_(b,c,f,"fontWeight",g))&&"bold"==h&&(a.fontWeight=m.fontWeight.BOLD);h=k.getStyleAttribute_(b,c,f,"wrapOption",g);a.wrapLine=h&&"noWrap"==h?!1:!0;(h=k.getStyleAttribute_(b,c,f,"lineHeight",g))&&h.match(k.unitValues_)&&(a.lineHeight=h);(h=k.getStyleAttribute_(b,
|
|
2801
|
-
(a.fontSize=h);if(h=k.getStyleAttribute_(b,c,f,"fontStyle",g))goog.asserts.assert(h.toUpperCase()in m.fontStyle,h.toUpperCase()+" Should be in Cue.fontStyle values!"),a.fontStyle=m.fontStyle[h.toUpperCase()];d?(e=d.attributes.imageType||d.attributes.imagetype,m=d.attributes.encoding,d=l.getTextContents(d).trim(),"PNG"==e&&"Base64"==m&&d&&(a.backgroundImage="data:image/png;base64,"+d)):e&&(a.backgroundImage=e);if(d=k.getStyleAttribute_(b,
|
|
2802
|
-
a.textStrokeColor=a.color:(a.textStrokeColor=d[0],d.shift()),d[0]&&d[0].match(k.unitValues_)?a.textStrokeWidth=d[0]:a.textStrokeColor="";(d=k.getStyleAttribute_(b,c,f,"letterSpacing",g))&&d.match(k.unitValues_)&&(a.letterSpacing=d);(d=k.getStyleAttribute_(b,c,f,"linePadding",g))&&d.match(k.unitValues_)&&(a.linePadding=d);if(d=k.getStyleAttribute_(b,c,f,"opacity",g))a.opacity=parseFloat(d);(d=k.getStyleAttributeFromRegion_(c,
|
|
2803
|
-
f,"textDecoration"))&&k.addTextDecoration_(a,d);if(d=k.getStyleAttribute_(b,c,f,"textCombine",g))a.textCombineUpright=d;switch(k.getStyleAttribute_(b,c,f,"ruby",g)){case "container":a.rubyTag="ruby";break;case "text":a.rubyTag="rt"}};
|
|
2801
|
+
if(h=k.getStyleAttribute_(b,c,f,"color",g))a.color=k.convertTTMLrgbaToHTMLrgba_(h);if(h=k.getStyleAttribute_(b,c,f,"backgroundColor",g))a.backgroundColor=k.convertTTMLrgbaToHTMLrgba_(h);if(h=k.getStyleAttribute_(b,c,f,"border",g))a.border=h;if(h=k.getStyleAttribute_(b,c,f,"fontFamily",g))switch(h){case "monospaceSerif":a.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":a.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":a.fontFamily=
|
|
2802
|
+
"sans-serif";break;case "monospaceSansSerif":a.fontFamily="Consolas,monospace";break;case "proportionalSerif":a.fontFamily="serif";break;default:a.fontFamily=h.split(",").filter(function(n){return"default"!=n}).join(",")}(h=k.getStyleAttribute_(b,c,f,"fontWeight",g))&&"bold"==h&&(a.fontWeight=m.fontWeight.BOLD);h=k.getStyleAttribute_(b,c,f,"wrapOption",g);a.wrapLine=h&&"noWrap"==h?!1:!0;(h=k.getStyleAttribute_(b,c,f,"lineHeight",g))&&h.match(k.unitValues_)&&(a.lineHeight=h);(h=k.getStyleAttribute_(b,
|
|
2803
|
+
c,f,"fontSize",g))&&(h.match(k.unitValues_)||h.match(k.percentValue_))&&(a.fontSize=h);if(h=k.getStyleAttribute_(b,c,f,"fontStyle",g))goog.asserts.assert(h.toUpperCase()in m.fontStyle,h.toUpperCase()+" Should be in Cue.fontStyle values!"),a.fontStyle=m.fontStyle[h.toUpperCase()];d?(e=d.attributes.imageType||d.attributes.imagetype,m=d.attributes.encoding,d=l.getTextContents(d).trim(),"PNG"==e&&"Base64"==m&&d&&(a.backgroundImage="data:image/png;base64,"+d)):e&&(a.backgroundImage=e);if(d=k.getStyleAttribute_(b,
|
|
2804
|
+
c,f,"textOutline",g))d=d.split(" "),d[0].match(k.unitValues_)?a.textStrokeColor=a.color:(a.textStrokeColor=k.convertTTMLrgbaToHTMLrgba_(d[0]),d.shift()),d[0]&&d[0].match(k.unitValues_)?a.textStrokeWidth=d[0]:a.textStrokeColor="";(d=k.getStyleAttribute_(b,c,f,"letterSpacing",g))&&d.match(k.unitValues_)&&(a.letterSpacing=d);(d=k.getStyleAttribute_(b,c,f,"linePadding",g))&&d.match(k.unitValues_)&&(a.linePadding=d);if(d=k.getStyleAttribute_(b,c,f,"opacity",g))a.opacity=parseFloat(d);(d=k.getStyleAttributeFromRegion_(c,
|
|
2805
|
+
f,"textDecoration"))&&k.addTextDecoration_(a,d);(d=k.getStyleAttributeFromElement_(b,f,"textDecoration"))&&k.addTextDecoration_(a,d);if(d=k.getStyleAttribute_(b,c,f,"textCombine",g))a.textCombineUpright=d;switch(k.getStyleAttribute_(b,c,f,"ruby",g)){case "container":a.rubyTag="ruby";break;case "text":a.rubyTag="rt"}};
|
|
2804
2806
|
shaka.text.TtmlTextParser.addTextDecoration_=function(a,b){var c=shaka.text.Cue;b=$jscomp.makeIterator(b.split(" "));for(var d=b.next();!d.done;d=b.next())switch(d.value){case "underline":a.textDecoration.includes(c.textDecoration.UNDERLINE)||a.textDecoration.push(c.textDecoration.UNDERLINE);break;case "noUnderline":a.textDecoration.includes(c.textDecoration.UNDERLINE)&&shaka.util.ArrayUtils.remove(a.textDecoration,c.textDecoration.UNDERLINE);break;case "lineThrough":a.textDecoration.includes(c.textDecoration.LINE_THROUGH)||
|
|
2805
2807
|
a.textDecoration.push(c.textDecoration.LINE_THROUGH);break;case "noLineThrough":a.textDecoration.includes(c.textDecoration.LINE_THROUGH)&&shaka.util.ArrayUtils.remove(a.textDecoration,c.textDecoration.LINE_THROUGH);break;case "overline":a.textDecoration.includes(c.textDecoration.OVERLINE)||a.textDecoration.push(c.textDecoration.OVERLINE);break;case "noOverline":a.textDecoration.includes(c.textDecoration.OVERLINE)&&shaka.util.ArrayUtils.remove(a.textDecoration,c.textDecoration.OVERLINE)}};
|
|
2806
2808
|
shaka.text.TtmlTextParser.getStyleAttribute_=function(a,b,c,d,e){e=void 0===e?!0:e;var f=shaka.text.TtmlTextParser;return(a=f.getStyleAttributeFromElement_(a,c,d))?a:e?f.getStyleAttributeFromRegion_(b,c,d):null};shaka.text.TtmlTextParser.getStyleAttributeFromRegion_=function(a,b,c){if(!a)return null;var d=shaka.util.TXml.getAttributeNSList(a,shaka.text.TtmlTextParser.styleNs_,c);return d?d:shaka.text.TtmlTextParser.getInheritedStyleAttribute_(a,b,c)};
|