shaka-player 4.9.4 → 4.9.6
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 +50 -40
- package/dist/shaka-player.compiled.debug.js +17 -15
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +915 -915
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.debug.js +28 -25
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +1113 -1113
- package/dist/shaka-player.ui.map +2 -2
- package/lib/media/time_ranges_utils.js +18 -10
- package/lib/net/http_fetch_plugin.js +2 -1
- package/lib/player.js +9 -1
- package/lib/text/mp4_ttml_parser.js +13 -0
- package/lib/text/ttml_text_parser.js +2 -2
- package/lib/util/cmcd_manager.js +10 -0
- package/lib/util/manifest_parser_utils.js +1 -1
- package/package.json +1 -1
- package/ui/locales/pl.json +16 -7
package/dist/locales.js
CHANGED
|
@@ -461,22 +461,24 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
461
461
|
]));
|
|
462
462
|
localization.insert('pl', new Map([
|
|
463
463
|
['AD_DURATION', 'Czas trwania reklamy'],
|
|
464
|
-
['AD_PROGRESS', 'Reklama
|
|
464
|
+
['AD_PROGRESS', 'Reklama [AD_ON] z [NUM_ADS]'],
|
|
465
|
+
['AD_STATISTICS', 'Statystyki reklam'],
|
|
465
466
|
['AD_TIME', 'Reklama: [AD_TIME]'],
|
|
467
|
+
['AIRPLAY', 'AirPlay'],
|
|
466
468
|
['AUTO_QUALITY', 'Automatycznie'],
|
|
467
469
|
['BACK', 'Wstecz'],
|
|
468
470
|
['CAPTIONS', 'Napisy'],
|
|
469
471
|
['CAST', 'Przesyłaj...'],
|
|
470
|
-
['ENTER_LOOP_MODE', 'Odtwarzaj bieżący film w
|
|
471
|
-
['ENTER_PICTURE_IN_PICTURE', 'Włącz tryb obrazu w
|
|
472
|
+
['ENTER_LOOP_MODE', 'Odtwarzaj bieżący film w pętli'],
|
|
473
|
+
['ENTER_PICTURE_IN_PICTURE', 'Włącz tryb obrazu w obrazie'],
|
|
472
474
|
['EXIT_FULL_SCREEN', 'Zamknij pełny ekran'],
|
|
473
|
-
['EXIT_LOOP_MODE', 'Wyłącz odtwarzanie bieżącego filmu w
|
|
474
|
-
['EXIT_PICTURE_IN_PICTURE', 'Wyłącz tryb obrazu w
|
|
475
|
+
['EXIT_LOOP_MODE', 'Wyłącz odtwarzanie bieżącego filmu w pętli'],
|
|
476
|
+
['EXIT_PICTURE_IN_PICTURE', 'Wyłącz tryb obrazu w obrazie'],
|
|
475
477
|
['FAST_FORWARD', 'Przewiń do przodu'],
|
|
476
478
|
['FULL_SCREEN', 'Pełny ekran'],
|
|
477
479
|
['LANGUAGE', 'Język'],
|
|
478
480
|
['LIVE', 'Na żywo'],
|
|
479
|
-
['LOOP', 'Odtwarzaj w
|
|
481
|
+
['LOOP', 'Odtwarzaj w pętli'],
|
|
480
482
|
['MORE_SETTINGS', 'Więcej ustawień'],
|
|
481
483
|
['MULTIPLE_LANGUAGES', 'Wiele języków'],
|
|
482
484
|
['MUTE', 'Wycisz'],
|
|
@@ -484,14 +486,21 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
484
486
|
['OFF', 'Wyłączone'],
|
|
485
487
|
['ON', 'Włączone'],
|
|
486
488
|
['PAUSE', 'Wstrzymaj'],
|
|
487
|
-
['PICTURE_IN_PICTURE', 'Obraz w
|
|
489
|
+
['PICTURE_IN_PICTURE', 'Obraz w obrazie'],
|
|
488
490
|
['PLAY', 'Odtwórz'],
|
|
489
491
|
['PLAYBACK_RATE', 'Szybkość odtwarzania'],
|
|
492
|
+
['QUALITY', 'Jakość'],
|
|
493
|
+
['RECENTER_VR', 'Wycentruj'],
|
|
494
|
+
['REPLAY', 'Odtwórz od nowa'],
|
|
490
495
|
['RESOLUTION', 'Rozdzielczość'],
|
|
491
496
|
['REWIND', 'Przewiń do tyłu'],
|
|
492
497
|
['SEEK', 'Szukaj'],
|
|
493
498
|
['SKIP_AD', 'Pomiń reklamę'],
|
|
494
499
|
['SKIP_TO_LIVE', 'Przejdź do transmisji na żywo'],
|
|
500
|
+
['STATISTICS', 'Statystyki'],
|
|
501
|
+
['SUBTITLE_FORCED', 'Wymuszone'],
|
|
502
|
+
['SURROUND', 'Przestrzenny'],
|
|
503
|
+
['TOGGLE_STEREOSCOPIC', 'Przełącz widok stereoskopowy'],
|
|
495
504
|
['UNDETERMINED_LANGUAGE', 'Nie określono'],
|
|
496
505
|
['UNMUTE', 'Wyłącz wyciszenie'],
|
|
497
506
|
['UNRECOGNIZED_LANGUAGE', 'Nierozpoznany'],
|
|
@@ -732,48 +741,49 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
732
741
|
* @const
|
|
733
742
|
*/
|
|
734
743
|
shaka.ui.Locales.Ids = {
|
|
744
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
735
745
|
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
736
|
-
|
|
737
|
-
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
746
|
+
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
738
747
|
BACK: 'BACK',
|
|
748
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
749
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
750
|
+
AIRPLAY: 'AIRPLAY',
|
|
751
|
+
SEEK: 'SEEK',
|
|
752
|
+
FAST_FORWARD: 'FAST_FORWARD',
|
|
753
|
+
AD_STATISTICS: 'AD_STATISTICS',
|
|
754
|
+
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
755
|
+
SURROUND: 'SURROUND',
|
|
756
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
739
757
|
AD_DURATION: 'AD_DURATION',
|
|
740
|
-
|
|
741
|
-
CAPTIONS: 'CAPTIONS',
|
|
758
|
+
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
742
759
|
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
760
|
+
CAST: 'CAST',
|
|
761
|
+
REWIND: 'REWIND',
|
|
762
|
+
LIVE: 'LIVE',
|
|
763
|
+
SKIP_AD: 'SKIP_AD',
|
|
764
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
748
765
|
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
749
|
-
|
|
750
|
-
|
|
766
|
+
VOLUME: 'VOLUME',
|
|
767
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
768
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
769
|
+
CAPTIONS: 'CAPTIONS',
|
|
751
770
|
PLAY: 'PLAY',
|
|
752
|
-
AIRPLAY: 'AIRPLAY',
|
|
753
771
|
ON: 'ON',
|
|
754
|
-
|
|
755
|
-
|
|
772
|
+
RECENTER_VR: 'RECENTER_VR',
|
|
773
|
+
OFF: 'OFF',
|
|
774
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
775
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
756
776
|
UNMUTE: 'UNMUTE',
|
|
757
|
-
SURROUND: 'SURROUND',
|
|
758
|
-
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
759
777
|
LOOP: 'LOOP',
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
763
|
-
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
764
|
-
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
765
|
-
RECENTER_VR: 'RECENTER_VR',
|
|
766
|
-
SEEK: 'SEEK',
|
|
767
|
-
FAST_FORWARD: 'FAST_FORWARD',
|
|
768
|
-
REWIND: 'REWIND',
|
|
769
|
-
QUALITY: 'QUALITY',
|
|
770
|
-
MUTE: 'MUTE',
|
|
771
|
-
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
772
|
-
LIVE: 'LIVE',
|
|
778
|
+
PAUSE: 'PAUSE',
|
|
779
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
773
780
|
RESOLUTION: 'RESOLUTION',
|
|
781
|
+
LANGUAGE: 'LANGUAGE',
|
|
782
|
+
QUALITY: 'QUALITY',
|
|
774
783
|
STATISTICS: 'STATISTICS',
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
784
|
+
MUTE: 'MUTE',
|
|
785
|
+
AD_TIME: 'AD_TIME',
|
|
786
|
+
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
787
|
+
REPLAY: 'REPLAY',
|
|
788
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
779
789
|
};
|
|
@@ -263,7 +263,7 @@ encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(
|
|
|
263
263
|
shaka.util.ManifestParserUtils.guessCodecs=function(a,b){if(1==b.length)return b[0];a=shaka.util.ManifestParserUtils.guessCodecsSafe(a,b);if(null!=a)return a;throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,b);};
|
|
264
264
|
shaka.util.ManifestParserUtils.guessCodecsSafe=function(a,b){for(var c=$jscomp.makeIterator(shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==shaka.util.ManifestParserUtils.ContentType.TEXT?"":null};
|
|
265
265
|
shaka.util.ManifestParserUtils.guessAllCodecsSafe=function(a,b){var c=[];a=$jscomp.makeIterator(shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_[a]);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())f=f.value,d.test(f.trim())&&c.push(f.trim())}return c};shaka.util.ManifestParserUtils.ContentType={VIDEO:"video",AUDIO:"audio",TEXT:"text",IMAGE:"image",APPLICATION:"application"};
|
|
266
|
-
shaka.util.ManifestParserUtils.TextStreamKind={SUBTITLE:"subtitle",CLOSED_CAPTION:"caption"};shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS=1/15;shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_=[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/];shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_=[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4
|
|
266
|
+
shaka.util.ManifestParserUtils.TextStreamKind={SUBTITLE:"subtitle",CLOSED_CAPTION:"caption"};shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS=1/15;shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_=[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/];shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_=[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/];
|
|
267
267
|
shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_=[/^vtt$/,/^wvtt/,/^stpp/];shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_={audio:shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_,video:shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_,text:shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_};shaka.util.MimeUtils=function(){};shaka.util.MimeUtils.getFullType=function(a,b){var c=a;b&&!shaka.util.MimeUtils.RAW_FORMATS.includes(a)&&(c+='; codecs="'+b+'"');return c};shaka.util.MimeUtils.getFullTypeWithAllCodecs=function(a,b){b&&(a+='; codecs="'+b+'"');return a};
|
|
268
268
|
shaka.util.MimeUtils.getFullOrConvertedType=function(a,b,c){var d=shaka.util.MimeUtils,e=d.getFullType(a,b);b=d.getFullTypeWithAllCodecs(a,b);d=shaka.util.ManifestParserUtils.ContentType;var f=shaka.transmuxer.TransmuxerEngine;return f.isSupported(b,c)?f.convertCodecs(c,b):"video/mp2t"!=a&&c==d.AUDIO?e.replace("video","audio"):e};
|
|
269
269
|
shaka.util.MimeUtils.getExtendedType=function(a,b,c){var d=[b];shaka.util.MimeUtils.EXTENDED_MIME_PARAMETERS_.forEach(function(e,f){var g=a[f];"codecs"==f?shaka.util.MimeUtils.RAW_FORMATS.includes(a.mimeType)||d.push('codecs="'+c+'"'):g&&d.push(e+'="'+g+'"')});"PQ"==a.hdr&&d.push('eotf="smpte2084"');return d.join(";")};shaka.util.MimeUtils.getContainerType=function(a){return a.split(";")[0].split("/")[1]};shaka.util.MimeUtils.splitCodecs=function(a){return a.split(",")};
|
|
@@ -643,9 +643,9 @@ goog.exportProperty(shaka.media.SegmentReference.prototype,"markAsByterangeOptim
|
|
|
643
643
|
goog.exportProperty(shaka.media.SegmentReference.prototype,"markAsPartial",shaka.media.SegmentReference.prototype.markAsPartial);goog.exportProperty(shaka.media.SegmentReference.prototype,"isIndependent",shaka.media.SegmentReference.prototype.isIndependent);goog.exportProperty(shaka.media.SegmentReference.prototype,"markAsNonIndependent",shaka.media.SegmentReference.prototype.markAsNonIndependent);goog.exportProperty(shaka.media.SegmentReference.prototype,"isPreload",shaka.media.SegmentReference.prototype.isPreload);
|
|
644
644
|
goog.exportProperty(shaka.media.SegmentReference.prototype,"markAsPreload",shaka.media.SegmentReference.prototype.markAsPreload);goog.exportProperty(shaka.media.SegmentReference.prototype,"markAsUnavailable",shaka.media.SegmentReference.prototype.markAsUnavailable);goog.exportProperty(shaka.media.SegmentReference.prototype,"getStatus",shaka.media.SegmentReference.prototype.getStatus);goog.exportProperty(shaka.media.SegmentReference.prototype,"getTileDuration",shaka.media.SegmentReference.prototype.getTileDuration);
|
|
645
645
|
goog.exportProperty(shaka.media.SegmentReference.prototype,"getTilesLayout",shaka.media.SegmentReference.prototype.getTilesLayout);goog.exportProperty(shaka.media.SegmentReference.prototype,"getEndByte",shaka.media.SegmentReference.prototype.getEndByte);goog.exportProperty(shaka.media.SegmentReference.prototype,"getStartByte",shaka.media.SegmentReference.prototype.getStartByte);goog.exportProperty(shaka.media.SegmentReference.prototype,"getEndTime",shaka.media.SegmentReference.prototype.getEndTime);
|
|
646
|
-
goog.exportProperty(shaka.media.SegmentReference.prototype,"getStartTime",shaka.media.SegmentReference.prototype.getStartTime);goog.exportProperty(shaka.media.SegmentReference.prototype,"getUris",shaka.media.SegmentReference.prototype.getUris);shaka.media.SegmentReference.Status={AVAILABLE:0,UNAVAILABLE:1,MISSING:2};goog.exportProperty(shaka.media.SegmentReference,"Status",shaka.media.SegmentReference.Status);shaka.media.TimeRangesUtils=function(){};shaka.media.TimeRangesUtils.
|
|
647
|
-
shaka.media.TimeRangesUtils.
|
|
648
|
-
shaka.media.TimeRangesUtils.getGapIndex=function(a,b,c){var d=shaka.media.TimeRangesUtils;if(!a||!a.length||
|
|
646
|
+
goog.exportProperty(shaka.media.SegmentReference.prototype,"getStartTime",shaka.media.SegmentReference.prototype.getStartTime);goog.exportProperty(shaka.media.SegmentReference.prototype,"getUris",shaka.media.SegmentReference.prototype.getUris);shaka.media.SegmentReference.Status={AVAILABLE:0,UNAVAILABLE:1,MISSING:2};goog.exportProperty(shaka.media.SegmentReference,"Status",shaka.media.SegmentReference.Status);shaka.media.TimeRangesUtils=function(){};shaka.media.TimeRangesUtils.isBufferNegligible_=function(a){return 1==a.length&&1E-4>a.end(0)-a.start(0)};shaka.media.TimeRangesUtils.bufferStart=function(a){return!a||shaka.media.TimeRangesUtils.isBufferNegligible_(a)?null:1==a.length&&0>a.start(0)?0:a.length?a.start(0):null};shaka.media.TimeRangesUtils.bufferEnd=function(a){return!a||shaka.media.TimeRangesUtils.isBufferNegligible_(a)?null:a.length?a.end(a.length-1):null};
|
|
647
|
+
shaka.media.TimeRangesUtils.isBuffered=function(a,b){return!a||!a.length||shaka.media.TimeRangesUtils.isBufferNegligible_(a)||b>a.end(a.length-1)?!1:b>=a.start(0)};shaka.media.TimeRangesUtils.bufferedAheadOf=function(a,b){if(!a||!a.length||shaka.media.TimeRangesUtils.isBufferNegligible_(a))return 0;var c=0;a=$jscomp.makeIterator(shaka.media.TimeRangesUtils.getBufferedInfo(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;e>b&&(c+=e-Math.max(d,b))}return c};
|
|
648
|
+
shaka.media.TimeRangesUtils.getGapIndex=function(a,b,c){var d=shaka.media.TimeRangesUtils;if(!a||!a.length||shaka.media.TimeRangesUtils.isBufferNegligible_(a))return null;a=d.getBufferedInfo(a).findIndex(function(e,f,g){return e.start>b&&(0==f||g[f-1].end-b<=c)});return 0<=a?a:null};shaka.media.TimeRangesUtils.getBufferedInfo=function(a){if(!a)return[];for(var b=[],c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b};
|
|
649
649
|
shaka.media.TimeRangesUtils.computeAddedRange=function(a,b){var c=shaka.media.TimeRangesUtils;if(!a||!a.length)return null;if(!b||!b.length)return c.getBufferedInfo(b).pop();b=c.getBufferedInfo(b).reverse();a=c.getBufferedInfo(a).reverse();c=$jscomp.makeIterator(b);for(b=c.next();!b.done;b=c.next()){b=b.value;for(var d=!1,e=$jscomp.makeIterator(a),f=e.next();!f.done;f=e.next())if(f=f.value,f.end>=b.start&&f.end<=b.end&&(d=!0,b.end>f.end))return{start:f.end,end:b.end};if(!d)return b}return null};/*
|
|
650
650
|
@license
|
|
651
651
|
Shaka Player
|
|
@@ -1151,7 +1151,8 @@ goog.exportProperty(shaka.text.UITextDisplayer.prototype,"isTextVisible",shaka.t
|
|
|
1151
1151
|
goog.exportProperty(shaka.text.UITextDisplayer.prototype,"configure",shaka.text.UITextDisplayer.prototype.configure);shaka.text.WebVttGenerator=function(){};
|
|
1152
1152
|
shaka.text.WebVttGenerator.convert=function(a,b){var c=function(f){for(var g=f,h=$jscomp.makeIterator(b),k=h.next();!k.done;k=h.next())k=k.value,k.end&&k.start<f&&(g+=k.end-k.start);f=Math.floor(g/3600);h=Math.floor(g/60%60);k=Math.floor(g%60);g=Math.floor(1E3*g%1E3);return(10>f?"0":"")+f+":"+(10>h?"0":"")+h+":"+(10>k?"0":"")+k+"."+(100>g?10>g?"00":"0":"")+g},d=shaka.text.Utils.getCuesToFlatten(a);a="WEBVTT\n\n";d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())e=e.value,a+=c(e.startTime)+
|
|
1153
1153
|
" --\x3e "+c(e.endTime)+function(f){var g=[],h=shaka.text.Cue;switch(f.textAlign){case h.textAlign.LEFT:g.push("align:left");break;case h.textAlign.RIGHT:g.push("align:right");break;case h.textAlign.CENTER:g.push("align:middle");break;case h.textAlign.START:g.push("align:start");break;case h.textAlign.END:g.push("align:end")}switch(f.writingMode){case h.writingMode.VERTICAL_LEFT_TO_RIGHT:g.push("vertical:lr");break;case h.writingMode.VERTICAL_RIGHT_TO_LEFT:g.push("vertical:rl")}return g.length?" "+
|
|
1154
|
-
g.join(" "):""}(e)+"\n",a+=e.payload+"\n\n";return a};goog.exportSymbol("shaka.text.WebVttGenerator",shaka.text.WebVttGenerator);shaka.util.CmcdManager=function(a,b){this.playerInterface_=a;this.config_=b;this.sf_=void 0;this.playbackStarted_=!1;this.buffering_=!0;this.starved_=!1};shaka.util.CmcdManager.prototype.configure=function(a){this.config_=a};shaka.util.CmcdManager.prototype.
|
|
1154
|
+
g.join(" "):""}(e)+"\n",a+=e.payload+"\n\n";return a};goog.exportSymbol("shaka.text.WebVttGenerator",shaka.text.WebVttGenerator);shaka.util.CmcdManager=function(a,b){this.playerInterface_=a;this.config_=b;this.sf_=void 0;this.playbackStarted_=!1;this.buffering_=!0;this.starved_=!1};shaka.util.CmcdManager.prototype.configure=function(a){this.config_=a};shaka.util.CmcdManager.prototype.reset=function(){this.playbackStarted_=!1;this.buffering_=!0;this.starved_=!1};
|
|
1155
|
+
shaka.util.CmcdManager.prototype.setBuffering=function(a){a||this.playbackStarted_||(this.playbackStarted_=!0);this.playbackStarted_&&a&&(this.starved_=!0);this.buffering_=a};
|
|
1155
1156
|
shaka.util.CmcdManager.prototype.applyData=function(a,b,c){c=void 0===c?{}:c;if(this.config_.enabled)if("HEAD"===b.method)this.apply_(b);else{var d=shaka.net.NetworkingEngine.RequestType,e=shaka.util.CmcdManager.ObjectType;switch(a){case d.MANIFEST:this.applyManifestData(b,c);break;case d.SEGMENT:this.applySegmentData(b,c);break;case d.LICENSE:case d.SERVER_CERTIFICATE:case d.KEY:this.apply_(b,{ot:e.KEY});break;case d.TIMING:this.apply_(b,{ot:e.OTHER})}}};
|
|
1156
1157
|
shaka.util.CmcdManager.prototype.applyManifestData=function(a,b){try{this.config_.enabled&&(b.type&&(this.sf_=this.getStreamFormat_(b.type)),this.apply_(a,{ot:shaka.util.CmcdManager.ObjectType.MANIFEST,su:!this.playbackStarted_}))}catch(c){shaka.log.warnOnce("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",c)}};
|
|
1157
1158
|
shaka.util.CmcdManager.prototype.applySegmentData=function(a,b){try{if(this.config_.enabled){var c=b.segment,d=0;c&&(d=c.endTime-c.startTime);var e={d:1E3*d,st:this.getStreamType_()};e.ot=this.getObjectType_(b);var f=shaka.util.CmcdManager.ObjectType,g=e.ot===f.VIDEO||e.ot===f.AUDIO||e.ot===f.MUXED||e.ot===f.TIMED_TEXT,h=b.stream;if(h){var k=this.playerInterface_.getPlaybackRate();if(g&&(e.bl=this.getBufferLength_(h.type),e.ot!==f.TIMED_TEXT)){var l=this.getRemainingBufferLength_(h.type);e.dl=k?l/
|
|
@@ -1207,10 +1208,10 @@ shaka.Player.prototype.atomicOperationAcquireMutex_=function(a){var b=this,c;ret
|
|
|
1207
1208
|
shaka.Player.prototype.unload=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=this,d,e,f,g,h,k,l,m,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){switch(p.nextAddress){case 1:return c.loadMode_!=shaka.Player.LoadMode.DESTROYED&&(c.loadMode_=shaka.Player.LoadMode.NOT_LOADED),p.yield(c.atomicOperationAcquireMutex_("unload"),2);case 2:if(p.yieldResult)return p.return();p.setFinallyBlock(3);c.fullyLoaded_=!1;c.makeStateChangeEvent_("unload");a&&!shaka.util.Platform.supportsMediaSource()&&
|
|
1208
1209
|
(a=!1);c.closeLcevcDec_();d=c.cleanupOnUnload_.map(function(q){return q()});c.cleanupOnUnload_=[];return p.yield(Promise.all(d),5);case 5:c.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Unloading));c.regionTimeline_&&(c.regionTimeline_.release(),c.regionTimeline_=null);c.video_&&(c.loadEventManager_.removeAll(),c.trickPlayEventManager_.removeAll());c.checkVariantsTimer_.stop();c.playheadObservers_&&(c.playheadObservers_.release(),c.playheadObservers_=null);c.bufferPoller_&&
|
|
1209
1210
|
(c.bufferPoller_.stop(),c.bufferPoller_=null);if(!c.parser_){p.jumpTo(6);break}return p.yield(c.parser_.stop(),7);case 7:c.parser_=null,c.parserFactory_=null;case 6:if(!c.abrManager_){p.jumpTo(8);break}return p.yield(c.abrManager_.stop(),8);case 8:if(!c.streamingEngine_){p.jumpTo(10);break}return p.yield(c.streamingEngine_.destroy(),11);case 11:c.streamingEngine_=null;case 10:c.playRateController_&&(c.playRateController_.release(),c.playRateController_=null);c.playhead_&&(c.playhead_.release(),c.playhead_=
|
|
1210
|
-
null);if(!shaka.util.Platform.isMediaKeysPolyfilled("webkit")||!c.drmEngine_){p.jumpTo(12);break}return p.yield(c.drmEngine_.destroy(),13);case 13:c.drmEngine_=null;case 12:if(!c.mediaSourceEngine_){p.jumpTo(14);break}return p.yield(c.mediaSourceEngine_.destroy(),15);case 15:c.mediaSourceEngine_=null;case 14:if(c.adManager_&&!b)c.adManager_.onAssetUnload();c.preloadDueAdManager_&&!b&&(c.preloadDueAdManager_.destroy(),c.preloadDueAdManager_=null);b||c.preloadDueAdManagerTimer_.stop();c.
|
|
1211
|
-
c.cmsdManager_.reset();c.video_&&shaka.util.Dom.removeAllChildren(c.video_);if(!c.video_||!c.video_.src){p.jumpTo(16);break}return p.yield(new Promise(function(q){return(new shaka.util.Timer(q)).tickAfter(.1)}),17);case 17:c.video_.removeAttribute("src"),c.video_.load();case 16:if(!c.drmEngine_){p.jumpTo(18);break}return p.yield(c.drmEngine_.destroy(),19);case 19:c.drmEngine_=null;case 18:c.preloadNextUrl_&&c.assetUri_!=c.preloadNextUrl_.getAssetUri()&&(c.preloadNextUrl_.isDestroyed()||
|
|
1212
|
-
c.preloadNextUrl_=null);c.assetUri_=null;c.mimeType_=null;c.bufferObserver_=null;if(c.manifest_){e=$jscomp.makeIterator(c.manifest_.variants);for(f=e.next();!f.done;f=e.next())for(g=f.value,h=$jscomp.makeIterator([g.audio,g.video]),k=h.next();!k.done;k=h.next())(l=k.value)&&l.segmentIndex&&l.segmentIndex.release();m=$jscomp.makeIterator(c.manifest_.textStreams);for(k=m.next();!k.done;k=m.next())n=k.value,n.segmentIndex&&n.segmentIndex.release()}c.config_.streaming.clearDecodingCache&&
|
|
1213
|
-
shaka.media.DrmEngine.clearMediaKeySystemAccessMap());c.manifest_=null;c.stats_=new shaka.util.Stats;c.lastTextFactory_=null;c.externalSrcEqualsThumbnailsStreams_=[];c.completionPercent_=NaN;c.updateBufferState_();case 3:p.enterFinallyBlock();c.mutex_.release();p.leaveFinallyBlock(4);break;case 4:if(a&&shaka.util.Platform.supportsMediaSource()&&!c.mediaSourceEngine_)return p.yield(c.initializeMediaSourceEngineInner_(),0);p.jumpTo(0)}})};
|
|
1211
|
+
null);if(!shaka.util.Platform.isMediaKeysPolyfilled("webkit")||!c.drmEngine_){p.jumpTo(12);break}return p.yield(c.drmEngine_.destroy(),13);case 13:c.drmEngine_=null;case 12:if(!c.mediaSourceEngine_){p.jumpTo(14);break}return p.yield(c.mediaSourceEngine_.destroy(),15);case 15:c.mediaSourceEngine_=null;case 14:if(c.adManager_&&!b)c.adManager_.onAssetUnload();c.preloadDueAdManager_&&!b&&(c.preloadDueAdManager_.destroy(),c.preloadDueAdManager_=null);b||c.preloadDueAdManagerTimer_.stop();c.cmcdManager_&&
|
|
1212
|
+
c.cmcdManager_.reset();c.cmsdManager_&&c.cmsdManager_.reset();c.video_&&shaka.util.Dom.removeAllChildren(c.video_);if(!c.video_||!c.video_.src){p.jumpTo(16);break}return p.yield(new Promise(function(q){return(new shaka.util.Timer(q)).tickAfter(.1)}),17);case 17:c.video_.removeAttribute("src"),c.video_.load();case 16:if(!c.drmEngine_){p.jumpTo(18);break}return p.yield(c.drmEngine_.destroy(),19);case 19:c.drmEngine_=null;case 18:c.preloadNextUrl_&&c.assetUri_!=c.preloadNextUrl_.getAssetUri()&&(c.preloadNextUrl_.isDestroyed()||
|
|
1213
|
+
c.preloadNextUrl_.destroy(),c.preloadNextUrl_=null);c.assetUri_=null;c.mimeType_=null;c.bufferObserver_=null;if(c.manifest_){e=$jscomp.makeIterator(c.manifest_.variants);for(f=e.next();!f.done;f=e.next())for(g=f.value,h=$jscomp.makeIterator([g.audio,g.video]),k=h.next();!k.done;k=h.next())(l=k.value)&&l.segmentIndex&&l.segmentIndex.release();m=$jscomp.makeIterator(c.manifest_.textStreams);for(k=m.next();!k.done;k=m.next())n=k.value,n.segmentIndex&&n.segmentIndex.release()}c.config_.streaming.clearDecodingCache&&
|
|
1214
|
+
(shaka.util.StreamUtils.clearDecodingConfigCache(),shaka.media.DrmEngine.clearMediaKeySystemAccessMap());c.manifest_=null;c.stats_=new shaka.util.Stats;c.lastTextFactory_=null;c.externalSrcEqualsThumbnailsStreams_=[];c.completionPercent_=NaN;c.updateBufferState_();case 3:p.enterFinallyBlock();c.mutex_.release();p.leaveFinallyBlock(4);break;case 4:if(a&&shaka.util.Platform.supportsMediaSource()&&!c.mediaSourceEngine_)return p.yield(c.initializeMediaSourceEngineInner_(),0);p.jumpTo(0)}})};
|
|
1214
1215
|
shaka.Player.prototype.updateStartTime=function(a){this.startTime_=a};
|
|
1215
1216
|
shaka.Player.prototype.load=function(a,b,c){b=void 0===b?null:b;var d=this,e,f,g,h,k,l,m,n,p,q,r,t,w;return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){switch(u.nextAddress){case 1:if(d.loadMode_==shaka.Player.LoadMode.DESTROYED)throw d.createAbortLoadError_();e=null;f="";a instanceof shaka.media.PreloadManager?(e=a,f=e.getAssetUri()||""):f=a||"";return u.yield(d.mutex_.acquire("load"),2);case 2:d.mutex_.release();if(!d.video_)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.PLAYER,
|
|
1216
1217
|
shaka.util.Error.Code.NO_VIDEO_ELEMENT);if(!d.assetUri_){u.jumpTo(3);break}d.assetUri_=f;return u.yield(d.unload(!1),3);case 3:g=++d.operationId_;h=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(v){if(1==v.nextAddress)return d.operationId_==g?v.jumpTo(0):e?v.yield(e.destroy(),3):v.jumpTo(3);throw d.createAbortLoadError_();})};k=function(v,x){return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){switch(z.nextAddress){case 1:return z.setFinallyBlock(2),z.yield(d.mutex_.acquire(x),
|
|
@@ -1396,7 +1397,7 @@ shaka.Player.prototype.checkVariants_=function(){goog.asserts.assert(this.manife
|
|
|
1396
1397
|
f.disabledUntilTime,"|variant.disableTimeUntilTime| must always be >= 0");return 0===f.disabledUntilTime})&&this.checkVariantsTimer_.stop();b&&this.chooseVariantAndSwitch_(!0,void 0,!1,!1)};shaka.Player.prototype.chooseTextStream_=function(){return shaka.util.StreamUtils.filterStreamsByLanguageAndRole(this.manifest_.textStreams,this.currentTextLanguage_,this.currentTextRole_,this.currentTextForced_)[0]||null};
|
|
1397
1398
|
shaka.Player.prototype.chooseVariantAndSwitch_=function(a,b,c,d){a=void 0===a?!0:a;b=void 0===b?0:b;c=void 0===c?!1:c;d=void 0===d?!0:d;goog.asserts.assert(this.config_,"Must not be destroyed");var e=this.chooseVariant_();e&&this.switchVariant_(e,d,a,b,c)};
|
|
1398
1399
|
shaka.Player.prototype.switchVariant_=function(a,b,c,d,e){e=void 0===e?!1:e;var f=this.streamingEngine_.getCurrentVariant();if(a==f)shaka.log.debug("Variant already selected."),c&&this.streamingEngine_.switchVariant(a,c,d,!0);else if(this.addVariantToSwitchHistory_(a,b),this.streamingEngine_.switchVariant(a,c,d,e,b),c=null,f&&(c=shaka.util.StreamUtils.variantToTrack(f)),a=shaka.util.StreamUtils.variantToTrack(a),b)this.onAdaptation_(c,a);else this.onVariantChanged_(c,a)};
|
|
1399
|
-
shaka.Player.prototype.switchHtml5Track_=function(a){goog.asserts.assert(this.video_&&this.video_.audioTracks,"Video and video.audioTracks should not be null!");var b=Array.from(this.video_.audioTracks).find(function(c){return c.enabled});a.enabled=!0;a.id!==b.id&&(b.enabled=!1)
|
|
1400
|
+
shaka.Player.prototype.switchHtml5Track_=function(a){goog.asserts.assert(this.video_&&this.video_.audioTracks,"Video and video.audioTracks should not be null!");var b=Array.from(this.video_.audioTracks).find(function(c){return c.enabled});a.enabled=!0;b&&(a.id!==b.id&&(b.enabled=!1),b=shaka.util.StreamUtils.html5AudioTrackToTrack(b),a=shaka.util.StreamUtils.html5AudioTrackToTrack(a),this.onVariantChanged_(b,a))};
|
|
1400
1401
|
shaka.Player.prototype.setInitialTextState_=function(a,b){b?(a.audio&&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};
|
|
1401
1402
|
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)return a=d.normalize(a.language),d.areLanguageCompatible(b,
|
|
1402
1403
|
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()};
|
|
@@ -1439,7 +1440,7 @@ goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.pro
|
|
|
1439
1440
|
goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);
|
|
1440
1441
|
goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);goog.exportProperty(shaka.Player.prototype,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);
|
|
1441
1442
|
goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);
|
|
1442
|
-
shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.
|
|
1443
|
+
shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.6-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.skipped_=this.playedCompletely_=this.started_=0};shaka.ads.AdsStats.prototype.addLoadTime=function(a){this.loadTimes_.push(a)};shaka.ads.AdsStats.prototype.incrementStarted=function(){this.started_++};shaka.ads.AdsStats.prototype.incrementPlayedCompletely=function(){this.playedCompletely_++};shaka.ads.AdsStats.prototype.incrementSkipped=function(){this.skipped_++};
|
|
1443
1444
|
shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_}};shaka.ads.ClientSideAd=function(a,b,c){var d=this;this.ad_=a;this.manager_=b;this.video_=c;this.isPaused_=!1;this.volume_=this.manager_.getVolume();this.eventManager_=new shaka.util.EventManager;this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.PAUSED,function(){d.isPaused_=!0});this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.RESUMED,function(){d.isPaused_=!1})};shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};
|
|
1444
1445
|
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()};
|
|
1445
1446
|
shaka.ads.ClientSideAd.prototype.getTimeUntilSkippable=function(){var a=this.ad_.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};shaka.ads.ClientSideAd.prototype.canSkipNow=function(){return this.manager_.getAdSkippableState()};shaka.ads.ClientSideAd.prototype.skip=function(){return this.manager_.skip()};shaka.ads.ClientSideAd.prototype.setPaused=function(a){this.isPaused_=a};shaka.ads.ClientSideAd.prototype.pause=function(){return this.manager_.pause()};
|
|
@@ -2325,7 +2326,7 @@ shaka.net.HttpFetchPlugin.request_=function(a,b,c,d,e,f,g){var h,k,l,m,n,p,q,r,t
|
|
|
2325
2326
|
r=l.clone().body.getReader();w=(t=l.headers.get("Content-Length"))?parseInt(t,10):0;u=function(y){var A=function(){var B,E,C,F;return $jscomp.asyncExecutePromiseGeneratorProgram(function(I){switch(I.nextAddress){case 1:return I.setCatchFinallyBlocks(2),I.yield(r.read(),4);case 4:B=I.yieldResult;I.leaveTryBlock(3);break;case 2:return E=I.enterCatchBlock(),shaka.log.v1("error reading from stream",E.message),I.return();case 3:if(B.done){I.jumpTo(5);break}n+=B.value.byteLength;if(!g){I.jumpTo(5);break}return I.yield(g(B.value),
|
|
2326
2327
|
5);case 5:C=Date.now();if(100<C-q||B.done)F=B.done?0:w-n,e(C-q,n-p,F),p=n,q=C;B.done?(goog.asserts.assert(!B.value,'readObj should be unset when "done" is true.'),y.close()):(y.enqueue(B.value),A());I.jumpToEnd()}})};A()};new k({start:u});return z.yield(l.arrayBuffer(),6);case 6:m=z.yieldResult;case 5:z.leaveTryBlock(3);break;case 2:v=z.enterCatchBlock();if(d.canceled)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.OPERATION_ABORTED,
|
|
2327
2328
|
a,b);if(d.timedOut)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.TIMEOUT,a,b);throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.HTTP_ERROR,a,v,b);case 3:return x=shaka.net.HttpFetchPlugin.headersToGenericObject_(l.headers),z.return(shaka.net.HttpPluginUtils.makeResponse(x,m,l.status,a,l.url,b))}})};
|
|
2328
|
-
shaka.net.HttpFetchPlugin.headersToGenericObject_=function(a){var b={};a.forEach(function(c,d){b[d.trim()]=c});return b};shaka.net.HttpFetchPlugin.isSupported=function(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||!window.AbortController)};goog.exportSymbol("shaka.net.HttpFetchPlugin",shaka.net.HttpFetchPlugin);
|
|
2329
|
+
shaka.net.HttpFetchPlugin.headersToGenericObject_=function(a){var b={};a.forEach(function(c,d){b[d.trim()]=c});return b};shaka.net.HttpFetchPlugin.isSupported=function(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)};goog.exportSymbol("shaka.net.HttpFetchPlugin",shaka.net.HttpFetchPlugin);
|
|
2329
2330
|
goog.exportProperty(shaka.net.HttpFetchPlugin,"isSupported",shaka.net.HttpFetchPlugin.isSupported);goog.exportProperty(shaka.net.HttpFetchPlugin,"parse",shaka.net.HttpFetchPlugin.parse);shaka.net.HttpFetchPlugin.fetch_=window.fetch;shaka.net.HttpFetchPlugin.AbortController_=window.AbortController;shaka.net.HttpFetchPlugin.ReadableStream_=window.ReadableStream;shaka.net.HttpFetchPlugin.Headers_=window.Headers;
|
|
2330
2331
|
shaka.net.HttpFetchPlugin.isSupported()&&(shaka.net.NetworkingEngine.registerScheme("http",shaka.net.HttpFetchPlugin.parse,shaka.net.NetworkingEngine.PluginPriority.PREFERRED,!0),shaka.net.NetworkingEngine.registerScheme("https",shaka.net.HttpFetchPlugin.parse,shaka.net.NetworkingEngine.PluginPriority.PREFERRED,!0),shaka.net.NetworkingEngine.registerScheme("blob",shaka.net.HttpFetchPlugin.parse,shaka.net.NetworkingEngine.PluginPriority.PREFERRED,!0));shaka.net.HttpXHRPlugin=function(){};
|
|
2331
2332
|
shaka.net.HttpXHRPlugin.parse=function(a,b,c,d,e){var f=new shaka.net.HttpXHRPlugin.Xhr_,g=Date.now(),h=0,k=new Promise(function(l,m){f.open(b.method,a,!0);f.responseType="arraybuffer";f.timeout=b.retryParameters.timeout;f.withCredentials=b.allowCrossSiteCredentials;f.onabort=function(){m(new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.NETWORK,shaka.util.Error.Code.OPERATION_ABORTED,a,c))};var n=!1;f.onreadystatechange=function(r){2!=f.readyState||n||(r=shaka.net.HttpXHRPlugin.headersToGenericObject_(f),
|
|
@@ -2648,14 +2649,15 @@ shaka.text.TtmlTextParser.parseTickTime_=function(a,b){b=shaka.text.TtmlTextPars
|
|
|
2648
2649
|
shaka.text.TtmlTextParser.parseTimeFromRegex_=function(a,b){a=a.exec(b);return null==a||""==a[0]?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+60*(Number(a[2])||0)+3600*(Number(a[1])||0)};shaka.text.TtmlTextParser.getCellResolution_=function(a){if(!a)return null;var b=/^(\d+) (\d+)$/.exec(a);if(!b)return null;a=parseInt(b[1],10);b=parseInt(b[2],10);return{columns:a,rows:b}};goog.exportSymbol("shaka.text.TtmlTextParser",shaka.text.TtmlTextParser);
|
|
2649
2650
|
goog.exportProperty(shaka.text.TtmlTextParser.prototype,"parseMedia",shaka.text.TtmlTextParser.prototype.parseMedia);goog.exportProperty(shaka.text.TtmlTextParser.prototype,"setManifestType",shaka.text.TtmlTextParser.prototype.setManifestType);goog.exportProperty(shaka.text.TtmlTextParser.prototype,"setSequenceMode",shaka.text.TtmlTextParser.prototype.setSequenceMode);goog.exportProperty(shaka.text.TtmlTextParser.prototype,"parseInit",shaka.text.TtmlTextParser.prototype.parseInit);
|
|
2650
2651
|
shaka.text.TtmlTextParser.RateInfo_=function(a,b,c,d){this.frameRate=Number(a)||30;this.subFrameRate=Number(b)||1;this.tickRate=Number(d);0==this.tickRate&&(this.tickRate=a?this.frameRate*this.subFrameRate:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))};shaka.text.TtmlTextParser.percentValues_=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/;shaka.text.TtmlTextParser.percentValue_=/^(\d{1,2}(?:\.\d+)?|100)%$/;
|
|
2651
|
-
shaka.text.TtmlTextParser.unitValues_=/^(\d+px|\d+em|\d*\.?\d+c)$/;shaka.text.TtmlTextParser.pixelValues_=/^(\d+)px (\d+)px$/;shaka.text.TtmlTextParser.timeColonFormatFrames_=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/;shaka.text.TtmlTextParser.timeColonFormat_=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/;shaka.text.TtmlTextParser.timeColonFormatMilliseconds_=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d
|
|
2652
|
-
shaka.text.TtmlTextParser.
|
|
2652
|
+
shaka.text.TtmlTextParser.unitValues_=/^(\d+px|\d+em|\d*\.?\d+c)$/;shaka.text.TtmlTextParser.pixelValues_=/^(\d+)px (\d+)px$/;shaka.text.TtmlTextParser.timeColonFormatFrames_=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/;shaka.text.TtmlTextParser.timeColonFormat_=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/;shaka.text.TtmlTextParser.timeColonFormatMilliseconds_=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/;shaka.text.TtmlTextParser.timeFramesFormat_=/^(\d*(?:\.\d*)?)f$/;shaka.text.TtmlTextParser.timeTickFormat_=/^(\d*(?:\.\d*)?)t$/;
|
|
2653
|
+
shaka.text.TtmlTextParser.timeHMSFormat_=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$");shaka.text.TtmlTextParser.textAlignToLineAlign_={left:shaka.text.Cue.lineAlign.START,center:shaka.text.Cue.lineAlign.CENTER,right:shaka.text.Cue.lineAlign.END,start:shaka.text.Cue.lineAlign.START,end:shaka.text.Cue.lineAlign.END};
|
|
2653
2654
|
shaka.text.TtmlTextParser.textAlignToPositionAlign_={left:shaka.text.Cue.positionAlign.LEFT,center:shaka.text.Cue.positionAlign.CENTER,right:shaka.text.Cue.positionAlign.RIGHT};shaka.text.TtmlTextParser.parameterNs_=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"];shaka.text.TtmlTextParser.styleNs_=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"];shaka.text.TtmlTextParser.styleEbuttsNs_="urn:ebu:tt:style";
|
|
2654
2655
|
shaka.text.TtmlTextParser.smpteNsList_=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];shaka.text.TextEngine.registerParser("application/ttml+xml",function(){return new shaka.text.TtmlTextParser});shaka.text.Mp4TtmlParser=function(){this.parser_=new shaka.text.TtmlTextParser};
|
|
2655
2656
|
shaka.text.Mp4TtmlParser.prototype.parseInit=function(a){var b=shaka.util.Mp4Parser,c=!1;(new b).box("moov",b.children).box("trak",b.children).box("mdia",b.children).box("minf",b.children).box("stbl",b.children).fullBox("stsd",b.sampleDescription).box("stpp",function(d){c=!0;d.parser.stop()}).parse(a);if(!c)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_MP4_TTML);};shaka.text.Mp4TtmlParser.prototype.setSequenceMode=function(a){};
|
|
2656
2657
|
shaka.text.Mp4TtmlParser.prototype.setManifestType=function(a){};shaka.text.Mp4TtmlParser.prototype.parseMedia=function(a,b,c){var d=this,e=shaka.util.Mp4Parser,f=!1,g=[];(new e).box("mdat",e.allData(function(h){f=!0;g=g.concat(d.parser_.parseMedia(h,b,c))})).parse(a,!1);if(!f)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_MP4_TTML);return g};goog.exportSymbol("shaka.text.Mp4TtmlParser",shaka.text.Mp4TtmlParser);
|
|
2657
2658
|
goog.exportProperty(shaka.text.Mp4TtmlParser.prototype,"parseMedia",shaka.text.Mp4TtmlParser.prototype.parseMedia);goog.exportProperty(shaka.text.Mp4TtmlParser.prototype,"setManifestType",shaka.text.Mp4TtmlParser.prototype.setManifestType);goog.exportProperty(shaka.text.Mp4TtmlParser.prototype,"setSequenceMode",shaka.text.Mp4TtmlParser.prototype.setSequenceMode);goog.exportProperty(shaka.text.Mp4TtmlParser.prototype,"parseInit",shaka.text.Mp4TtmlParser.prototype.parseInit);
|
|
2658
|
-
shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml.im1t"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.
|
|
2659
|
+
shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml.im1t"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml.im2t"',function(){return new shaka.text.Mp4TtmlParser});
|
|
2660
|
+
shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml.etd1"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml.etd1|im1t"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.ttml.im1t|etd1"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.TextEngine.registerParser('application/mp4; codecs="stpp.TTML.im1t"',function(){return new shaka.text.Mp4TtmlParser});shaka.text.VttTextParser=function(){this.sequenceMode_=!1;this.manifestType_=shaka.media.ManifestParser.UNKNOWN};shaka.text.VttTextParser.prototype.parseInit=function(a){goog.asserts.assert(!1,"VTT does not have init segments")};shaka.text.VttTextParser.prototype.setSequenceMode=function(a){this.sequenceMode_=a};shaka.text.VttTextParser.prototype.setManifestType=function(a){this.manifestType_=a};
|
|
2659
2661
|
shaka.text.VttTextParser.prototype.parseMedia=function(a,b){var c=shaka.text.VttTextParser;a=shaka.util.StringUtils.fromUTF8(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_HEADER);a=b.vttOffset;d[0].includes("X-TIMESTAMP-MAP")&&this.manifestType_==shaka.media.ManifestParser.HLS&&(a=this.sequenceMode_?this.computeHlsSequenceModeOffset_(d[0],
|
|
2660
2662
|
b):b.segmentStart);b=[];for(var e=$jscomp.makeIterator(d[0].split("\n")),f=e.next();!f.done;f=e.next())f=f.value,/^Region:/.test(f)&&(f=c.parseRegion_(f),b.push(f));e=new Map;c.addDefaultTextColor_(e);f=[];d=$jscomp.makeIterator(d.slice(1));for(var g=d.next();!g.done;g=d.next())g=g.value.split("\n"),c.parseStyle_(g,e),(g=c.parseCue_(g,a,b,e))&&f.push(g);return f};
|
|
2661
2663
|
shaka.text.VttTextParser.prototype.computeHlsSequenceModeOffset_=function(a,b){var c=a.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);a=a.match(/MPEGTS:(\d+)/m);if(!c||!a)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_HEADER);c=new shaka.util.TextParser(c[1]);c=shaka.text.VttTextParser.parseTime_(c);if(null==c)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.INVALID_TEXT_HEADER);
|