shaka-player 4.9.2-caf2 → 4.9.2-caf3
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/.eslintrc.js +1 -0
- package/dist/deps.js +1 -1
- package/dist/locales.js +34 -34
- package/dist/shaka-player.compiled.debug.js +15 -14
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +1113 -1111
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +18 -17
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +1307 -1306
- package/dist/shaka-player.ui.map +3 -3
- package/lib/media/media_source_engine.js +1 -1
- package/lib/media/playhead.js +17 -6
- package/lib/player.js +1 -1
- package/lib/polyfill/media_capabilities.js +46 -8
- package/lib/util/platform.js +19 -0
- package/lib/util/stream_utils.js +36 -28
- package/package.json +2 -2
package/.eslintrc.js
CHANGED
|
@@ -84,6 +84,7 @@ module.exports = {
|
|
|
84
84
|
'no-empty': ['error', {'allowEmptyCatch': true}],
|
|
85
85
|
'no-misleading-character-class': 'error',
|
|
86
86
|
'no-template-curly-in-string': 'error',
|
|
87
|
+
'no-fallthrough': ['error', {'allowEmptyCase': true}],
|
|
87
88
|
// TODO: Try to re-enable this if possible. Right now, it produces way too
|
|
88
89
|
// many false-positives with eslint 7. It worked well enough in eslint 5.
|
|
89
90
|
// 'require-atomic-updates': 'error',
|
package/dist/deps.js
CHANGED
|
@@ -77,7 +77,7 @@ goog.addDependency('../../../../lib/media/media_source_capabilities.js', ['shaka
|
|
|
77
77
|
goog.addDependency('../../../../lib/media/media_source_engine.js', ['shaka.media.MediaSourceEngine'], ['goog.asserts', 'shaka.config.CodecSwitchingStrategy', 'shaka.lcevc.Dec', 'shaka.log', 'shaka.media.Capabilities', 'shaka.media.ClosedCaptionParser', 'shaka.media.ContentWorkarounds', 'shaka.media.IClosedCaptionParser', 'shaka.media.ManifestParser', 'shaka.media.SegmentReference', 'shaka.media.TimeRangesUtils', 'shaka.text.TextEngine', 'shaka.transmuxer.TransmuxerEngine', 'shaka.util.BufferUtils', 'shaka.util.Destroyer', 'shaka.util.Error', 'shaka.util.EventManager', 'shaka.util.Functional', 'shaka.util.IDestroyable', 'shaka.util.Id3Utils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Mp4BoxParsers', 'shaka.util.Mp4Parser', 'shaka.util.Platform', 'shaka.util.PublicPromise', 'shaka.util.StreamUtils', 'shaka.util.TsParser'], {'lang': 'es8'});
|
|
78
78
|
goog.addDependency('../../../../lib/media/mp4_segment_index_parser.js', ['shaka.media.Mp4SegmentIndexParser'], ['goog.asserts', 'shaka.log', 'shaka.media.InitSegmentReference', 'shaka.media.SegmentReference', 'shaka.util.Error', 'shaka.util.Mp4Parser'], {'lang': 'es6'});
|
|
79
79
|
goog.addDependency('../../../../lib/media/play_rate_controller.js', ['shaka.media.PlayRateController'], ['goog.asserts', 'shaka.log', 'shaka.util.IReleasable', 'shaka.util.Timer'], {'lang': 'es6'});
|
|
80
|
-
goog.addDependency('../../../../lib/media/playhead.js', ['shaka.media.MediaSourcePlayhead', 'shaka.media.Playhead', 'shaka.media.SrcEqualsPlayhead'], ['goog.asserts', 'shaka.log', 'shaka.media.GapJumpingController', 'shaka.media.StallDetector', 'shaka.media.StallDetector.MediaElementImplementation', 'shaka.media.TimeRangesUtils', 'shaka.media.VideoWrapper', 'shaka.util.EventManager', 'shaka.util.IReleasable', 'shaka.util.MediaReadyState', 'shaka.util.Timer'], {'lang': 'es8'});
|
|
80
|
+
goog.addDependency('../../../../lib/media/playhead.js', ['shaka.media.MediaSourcePlayhead', 'shaka.media.Playhead', 'shaka.media.SrcEqualsPlayhead'], ['goog.asserts', 'shaka.log', 'shaka.media.GapJumpingController', 'shaka.media.StallDetector', 'shaka.media.StallDetector.MediaElementImplementation', 'shaka.media.TimeRangesUtils', 'shaka.media.VideoWrapper', 'shaka.util.EventManager', 'shaka.util.IReleasable', 'shaka.util.MediaReadyState', 'shaka.util.Platform', 'shaka.util.Timer'], {'lang': 'es8'});
|
|
81
81
|
goog.addDependency('../../../../lib/media/playhead_observer.js', ['shaka.media.IPlayheadObserver', 'shaka.media.PlayheadObserverManager'], ['shaka.util.IReleasable', 'shaka.util.Timer'], {'lang': 'es6'});
|
|
82
82
|
goog.addDependency('../../../../lib/media/preload_manager.js', ['shaka.media.PreloadManager'], ['goog.asserts', 'shaka.log', 'shaka.media.AdaptationSetCriteria', 'shaka.media.DrmEngine', 'shaka.media.ManifestFilterer', 'shaka.media.ManifestParser', 'shaka.media.PreferenceBasedCriteria', 'shaka.media.QualityObserver', 'shaka.media.RegionTimeline', 'shaka.media.SegmentPrefetch', 'shaka.media.SegmentPrefetch', 'shaka.media.StreamingEngine', 'shaka.net.NetworkingEngine', 'shaka.util.ConfigUtils', 'shaka.util.Error', 'shaka.util.FakeEvent', 'shaka.util.FakeEventTarget', 'shaka.util.IDestroyable', 'shaka.util.ObjectUtils', 'shaka.util.PlayerConfiguration', 'shaka.util.PublicPromise', 'shaka.util.Stats', 'shaka.util.StreamUtils'], {'lang': 'es8'});
|
|
83
83
|
goog.addDependency('../../../../lib/media/presentation_timeline.js', ['shaka.media.PresentationTimeline'], ['goog.asserts', 'shaka.log', 'shaka.media.SegmentReference'], {'lang': 'es6'});
|
package/dist/locales.js
CHANGED
|
@@ -732,48 +732,48 @@ shaka.ui.Locales.addTo = function(localization) {
|
|
|
732
732
|
* @const
|
|
733
733
|
*/
|
|
734
734
|
shaka.ui.Locales.Ids = {
|
|
735
|
-
VOLUME: 'VOLUME',
|
|
736
|
-
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
737
|
-
SURROUND: 'SURROUND',
|
|
738
|
-
AD_DURATION: 'AD_DURATION',
|
|
739
|
-
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
740
|
-
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
741
735
|
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
742
|
-
|
|
743
|
-
|
|
736
|
+
SURROUND: 'SURROUND',
|
|
737
|
+
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
738
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
739
|
+
REPLAY: 'REPLAY',
|
|
740
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
741
|
+
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
742
|
+
CAPTIONS: 'CAPTIONS',
|
|
743
|
+
PAUSE: 'PAUSE',
|
|
744
744
|
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
745
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
746
|
+
VOLUME: 'VOLUME',
|
|
745
747
|
STATISTICS: 'STATISTICS',
|
|
746
|
-
MUTE: 'MUTE',
|
|
747
|
-
OFF: 'OFF',
|
|
748
|
-
ON: 'ON',
|
|
749
|
-
LIVE: 'LIVE',
|
|
750
|
-
CAST: 'CAST',
|
|
751
|
-
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
752
|
-
RECENTER_VR: 'RECENTER_VR',
|
|
753
|
-
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
754
748
|
REWIND: 'REWIND',
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
UNMUTE: 'UNMUTE',
|
|
749
|
+
LIVE: 'LIVE',
|
|
750
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
751
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
752
|
+
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
760
753
|
AIRPLAY: 'AIRPLAY',
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
PAUSE: 'PAUSE',
|
|
765
|
-
AD_TIME: 'AD_TIME',
|
|
754
|
+
UNMUTE: 'UNMUTE',
|
|
755
|
+
CAST: 'CAST',
|
|
756
|
+
MUTE: 'MUTE',
|
|
766
757
|
SEEK: 'SEEK',
|
|
767
758
|
QUALITY: 'QUALITY',
|
|
759
|
+
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
760
|
+
RESOLUTION: 'RESOLUTION',
|
|
761
|
+
AD_PROGRESS: 'AD_PROGRESS',
|
|
762
|
+
RECENTER_VR: 'RECENTER_VR',
|
|
763
|
+
SKIP_AD: 'SKIP_AD',
|
|
768
764
|
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
765
|
+
LANGUAGE: 'LANGUAGE',
|
|
766
|
+
OFF: 'OFF',
|
|
767
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
768
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
769
|
+
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
770
|
+
LOOP: 'LOOP',
|
|
772
771
|
PLAY: 'PLAY',
|
|
773
|
-
|
|
772
|
+
ON: 'ON',
|
|
774
773
|
FAST_FORWARD: 'FAST_FORWARD',
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
774
|
+
AD_DURATION: 'AD_DURATION',
|
|
775
|
+
BACK: 'BACK',
|
|
776
|
+
AD_TIME: 'AD_TIME',
|
|
777
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
778
|
+
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
779
779
|
};
|
|
@@ -234,7 +234,8 @@ shaka.util.Platform.isMac=function(){return navigator.userAgentData&&navigator.u
|
|
|
234
234
|
shaka.util.Platform.isFuchsia=function(){return shaka.util.Platform.userAgentContains_("Fuchsia")};shaka.util.Platform.isSmartTV=function(){var a=shaka.util.Platform;return a.isTizen()||a.isWebOS()||a.isXboxOne()||a.isPS4()||a.isPS5()||a.isAmazonFireTV()||a.isEOS()||a.isAPL()||a.isVirginMedia()||a.isOrange()||a.isWPE()||a.isChromecast()||a.isHisense()||a.isZenterio()?!0:!1};shaka.util.Platform.userAgentContains_=function(a){return(navigator.userAgent||"").includes(a)};
|
|
235
235
|
shaka.util.Platform.anyMediaElement=function(){var a=shaka.util.Platform;if(a.cachedMediaElement_)return a.cachedMediaElement_;a.cacheExpirationTimer_||(a.cacheExpirationTimer_=new shaka.util.Timer(function(){a.cachedMediaElement_=null}));a.cachedMediaElement_=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0];a.cachedMediaElement_||(a.cachedMediaElement_=document.createElement("video"));a.cacheExpirationTimer_.tickAfter(1);return a.cachedMediaElement_};
|
|
236
236
|
shaka.util.Platform.requiresEncryptionInfoInAllInitSegments=function(){var a=shaka.util.Platform;return a.isTizen()||a.isXboxOne()||a.isOrange()};shaka.util.Platform.supportsSequenceMode=function(){var a=shaka.util.Platform;return a.isTizen3()||a.isTizen2()||a.isWebOS3()||a.isPS4()?!1:!0};
|
|
237
|
-
shaka.util.Platform.supportsSmoothCodecSwitching=function(){var a=shaka.util.Platform;return a.isTizen2()||a.isTizen3()||a.isTizen4()||a.isTizen5()||a.isTizen6()||a.isWebOS3()||a.isWebOS4()||a.isWebOS5()||a.isChromecast()&&!a.isAndroidCastDevice()&&!a.isFuchsiaCastDevice()||a.isWindows()&&a.isEdge()?!1:!0};shaka.util.Platform.
|
|
237
|
+
shaka.util.Platform.supportsSmoothCodecSwitching=function(){var a=shaka.util.Platform;return a.isTizen2()||a.isTizen3()||a.isTizen4()||a.isTizen5()||a.isTizen6()||a.isWebOS3()||a.isWebOS4()||a.isWebOS5()||a.isChromecast()&&!a.isAndroidCastDevice()&&!a.isFuchsiaCastDevice()||a.isWindows()&&a.isEdge()?!1:!0};shaka.util.Platform.isSeekingSlow=function(){var a=shaka.util.Platform;return a.isChromecast()&&!a.isAndroidCastDevice()?!0:!1};
|
|
238
|
+
shaka.util.Platform.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill?!0:!1};
|
|
238
239
|
shaka.util.Platform.detectMaxHardwareResolution=function(){var a,b,c,d,e,f,g,h,k,l,m,n,p,q,r;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){switch(t.nextAddress){case 1:a=shaka.util.Platform;b={width:Infinity,height:Infinity};if(a.isChromecast()){n=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType;b.width=1280;b.height=720;t.setCatchFinallyBlocks(15);if(!(p=n)){t.jumpTo(17);break}return t.yield(cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),
|
|
239
240
|
18)}if(a.isTizen()){b.width=1920;b.height=1080;try{webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution?(c=webapis.systeminfo.getMaxVideoResolution(),b.width=c.width,b.height=c.height):webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(b.width=7680,b.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(b.width=3840,b.height=2160)}catch(w){shaka.log.alwaysWarn("Tizen: Error detecting screen size, default screen size 1920x1080.")}t.jumpTo(3);
|
|
240
241
|
break}if(a.isXboxOne()){d=new Windows.Media.Protection.ProtectionCapabilities;e=Windows.Media.Protection.ProtectionCapabilityResult;f=null;try{do f=d.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation");while(f===e.maybe)}catch(w){f=e.notSupported}f===e.probably?(b.width=3840,b.height=2160):(b.width=1920,b.height=1080);
|
|
@@ -315,9 +316,9 @@ shaka.util.StreamUtils.meetsRestrictions=function(a,b,c){var d=function(h,k,l){r
|
|
|
315
316
|
shaka.util.StreamUtils.filterManifest=function(a,b,c){c=void 0===c?[]:c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return d.yield(shaka.util.StreamUtils.filterManifestByMediaCapabilities(a,b,0<b.offlineSessionIds.length,c),2);shaka.util.StreamUtils.filterTextStreams_(b);return d.yield(shaka.util.StreamUtils.filterImageStreams_(b),0)})};
|
|
316
317
|
shaka.util.StreamUtils.filterManifestByMediaCapabilities=function(a,b,c,d){var e,f,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){if(1==h.nextAddress)return goog.asserts.assert(navigator.mediaCapabilities,"MediaCapabilities should be valid."),h.yield(shaka.util.StreamUtils.getDecodingInfosForVariants(b.variants,c,!1,d),2);e=null;a&&(f=a.getDrmInfo())&&(e=f.keySystem);g=shaka.util.StreamUtils;b.variants=b.variants.filter(function(k){var l=g.checkVariantSupported_(k,e);l||shaka.log.debug("Dropping variant - not compatible with platform",
|
|
317
318
|
g.getVariantSummaryString_(k));return l});h.jumpToEnd()})};
|
|
318
|
-
shaka.util.StreamUtils.checkVariantSupported_=function(a,b){var c=shaka.util.ManifestParserUtils.ContentType,d=shaka.media.Capabilities,e=shaka.util.ManifestParserUtils,f=shaka.util.MimeUtils,g=shaka.util.StreamUtils,h=shaka.util.Platform.isXboxOne(),k=shaka.util.Platform.isFirefox()&&shaka.util.Platform.isAndroid(),l=a.video,m=l&&l.width||0,n=l&&l.height||0;if(h&&l&&(1920<m||1080<n)&&
|
|
319
|
-
l.codecs.split(",");h=e.guessCodecs(c.VIDEO,m);h=g.getCorrectVideoCodecs(h);e=e.guessCodecs(c.AUDIO,m);e=g.getCorrectAudioCodecs(e,l.mimeType);m=f.getFullOrConvertedType(l.mimeType,e,c.AUDIO);if(!d.isTypeSupported(m))return!1;h=[h,e].join()}e=f.getFullOrConvertedType(l.mimeType,h,c.VIDEO);if(!d.isTypeSupported(e))return!1;l.codecs=h}
|
|
320
|
-
g,c.AUDIO);if(!d.isTypeSupported(c))return!1;
|
|
319
|
+
shaka.util.StreamUtils.checkVariantSupported_=function(a,b){if(!a.decodingInfos.some(function(p){return!p.supported||b&&(p=p.keySystemAccess)&&p.keySystem!=b?!1:!0}))return!1;var c=shaka.util.ManifestParserUtils.ContentType,d=shaka.media.Capabilities,e=shaka.util.ManifestParserUtils,f=shaka.util.MimeUtils,g=shaka.util.StreamUtils,h=shaka.util.Platform.isXboxOne(),k=shaka.util.Platform.isFirefox()&&shaka.util.Platform.isAndroid(),l=a.video,m=l&&l.width||0,n=l&&l.height||0;if(h&&l&&(1920<m||1080<n)&&
|
|
320
|
+
(l.codecs.includes("avc1.")||l.codecs.includes("avc3.")))return!1;if(l){h=g.getCorrectVideoCodecs(l.codecs);if(l.codecs.includes(",")){m=l.codecs.split(",");h=e.guessCodecs(c.VIDEO,m);h=g.getCorrectVideoCodecs(h);e=e.guessCodecs(c.AUDIO,m);e=g.getCorrectAudioCodecs(e,l.mimeType);m=f.getFullOrConvertedType(l.mimeType,e,c.AUDIO);if(!d.isTypeSupported(m))return!1;h=[h,e].join()}if(l.codecs!=h){e=f.getFullOrConvertedType(l.mimeType,h,c.VIDEO);if(!d.isTypeSupported(e))return!1;l.codecs=h}}a=a.audio;if(k&&
|
|
321
|
+
a&&a.encrypted&&a.codecs.toLowerCase().includes("opus"))return!1;if(a&&(g=g.getCorrectAudioCodecs(a.codecs,a.mimeType),a.codecs!=g)){c=f.getFullOrConvertedType(a.mimeType,g,c.AUDIO);if(!d.isTypeSupported(c))return!1;a.codecs=g}return!0};
|
|
321
322
|
shaka.util.StreamUtils.alphabeticalKeyOrderStringify_=function(a){var b=[];for(c in a)b.push(c);b.sort();var c=[];b=$jscomp.makeIterator(b);for(var d=b.next();!d.done;d=b.next()){var e=d.value;d=JSON.stringify(e);e=a[e];e instanceof Object?(e=shaka.util.StreamUtils.alphabeticalKeyOrderStringify_(e),c.push(d+":"+e)):(e=JSON.stringify(e),c.push(d+":"+e))}return"{"+c.join(",")+"}"};
|
|
322
323
|
shaka.util.StreamUtils.getDecodingInfosForVariant_=function(a,b){var c,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){c=function(n,p){if(n){var q=shaka.util.ObjectUtils.shallowCloneObject(n);q.supported=n.supported&&p.supported;q.powerEfficient=n.powerEfficient&&p.powerEfficient;q.smooth=n.smooth&&p.smooth;p.keySystemAccess&&!q.keySystemAccess&&(q.keySystemAccess=p.keySystemAccess);return q}return p};d=shaka.util.StreamUtils;e=null;f=[];g={};h=$jscomp.makeIterator(b);
|
|
323
324
|
for(k=h.next();!k.done;g={$jscomp$loop$prop$cache$891:g.$jscomp$loop$prop$cache$891,$jscomp$loop$prop$cacheKey$892:g.$jscomp$loop$prop$cacheKey$892},k=h.next())l=k.value,g.$jscomp$loop$prop$cacheKey$892=d.alphabeticalKeyOrderStringify_(l),g.$jscomp$loop$prop$cache$891=d.decodingConfigCache_,g.$jscomp$loop$prop$cache$891[g.$jscomp$loop$prop$cacheKey$892]?(shaka.log.v2("Using cached results of mediaCapabilities.decodingInfo","for key",g.$jscomp$loop$prop$cacheKey$892),e=c(e,g.$jscomp$loop$prop$cache$891[g.$jscomp$loop$prop$cacheKey$892])):
|
|
@@ -756,9 +757,9 @@ shaka.media.MediaSourceEngine.prototype.isBuffered=function(a,b){if(this.reloadi
|
|
|
756
757
|
shaka.media.MediaSourceEngine.prototype.bufferedAheadOf=function(a,b){if(this.reloadingMediaSource_)return 0;if(a==shaka.util.ManifestParserUtils.ContentType.TEXT)return this.textEngine_.bufferedAheadOf(b);a=this.getBuffered_(a);return shaka.media.TimeRangesUtils.bufferedAheadOf(a,b)};
|
|
757
758
|
shaka.media.MediaSourceEngine.prototype.getBufferedInfo=function(){var a=shaka.util.ManifestParserUtils.ContentType,b=shaka.media.TimeRangesUtils;a={total:this.reloadingMediaSource_?[]:b.getBufferedInfo(this.video_.buffered),audio:this.reloadingMediaSource_?[]:b.getBufferedInfo(this.getBuffered_(a.AUDIO)),video:this.reloadingMediaSource_?[]:b.getBufferedInfo(this.getBuffered_(a.VIDEO)),text:[]};if(this.textEngine_){b=this.textEngine_.bufferStart();var c=this.textEngine_.bufferEnd();null!=b&&null!=
|
|
758
759
|
c&&a.text.push({start:b,end:c})}return a};shaka.media.MediaSourceEngine.prototype.getBuffered_=function(a){try{return this.sourceBuffers_[a].buffered}catch(b){return a in this.sourceBuffers_&&shaka.log.error("failed to get buffered range for "+a,b),null}};shaka.media.MediaSourceEngine.prototype.getCaptionParser=function(a){return new shaka.media.ClosedCaptionParser(a)};
|
|
759
|
-
shaka.media.MediaSourceEngine.prototype.getTimestampAndDispatchMetadata_=function(a,b,c,d,e){var f=null,g=shaka.util.BufferUtils.toUint8(b);if(shaka.util.MimeUtils.RAW_FORMATS.includes(d))e=shaka.util.Id3Utils.getID3Frames(g),e.length&&c&&((a=e.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&
|
|
760
|
-
c
|
|
761
|
-
|
|
760
|
+
shaka.media.MediaSourceEngine.prototype.getTimestampAndDispatchMetadata_=function(a,b,c,d,e){var f=null,g=shaka.util.BufferUtils.toUint8(b);if(shaka.util.MimeUtils.RAW_FORMATS.includes(d))e=shaka.util.Id3Utils.getID3Frames(g),e.length&&c&&((a=e.find(function(m){return"com.apple.streaming.transportStreamTimestamp"===m.description}))&&(f=Math.round(a.data)/1E3),this.onMetadata_([{cueTime:c.startTime,data:g,frames:e,dts:c.startTime,pts:c.startTime}],0,c.endTime));else if(d.includes("/mp4")&&c&&0==c.timestampOffset&&
|
|
761
|
+
c.initSegmentReference&&c.initSegmentReference.timescale){var h=c.initSegmentReference.timescale;if(!isNaN(h)){c=shaka.util.Mp4Parser;var k=0,l=!1;(new c).box("moof",c.children).box("traf",c.children).fullBox("tfdt",function(m){goog.asserts.assert(0==m.version||1==m.version,"TFDT version can only be 0 or 1");k=shaka.util.Mp4BoxParsers.parseTFDTInaccurate(m.reader,m.version).baseMediaDecodeTime/h;l=!0;m.parser.stop()}).parse(b,!0);l&&(f=k)}}else if(!d.includes("/mp4")&&!d.includes("/webm")&&shaka.util.TsParser.probe(g)&&
|
|
762
|
+
(this.tsParser_?this.tsParser_.clearData():this.tsParser_=new shaka.util.TsParser,g=this.tsParser_.parse(g),a=g.getStartTime(a),null!=a&&(f=a),g=g.getMetadata(),g.length))this.onMetadata_(g,e,c?c.endTime:null);return f};
|
|
762
763
|
shaka.media.MediaSourceEngine.prototype.appendBuffer=function(a,b,c,d,e,f,g,h,k){f=void 0===f?!1:f;g=void 0===g?!1:g;h=void 0===h?!1:h;k=void 0===k?!1:k;var l=this,m,n,p,q,r,t,w,u,v,x,z,y,A,B,E,C;return $jscomp.asyncExecutePromiseGeneratorProgram(function(F){switch(F.nextAddress){case 1:m=shaka.util.ManifestParserUtils.ContentType;if(a!=m.TEXT){F.jumpTo(2);break}if(!l.sequenceMode_){F.jumpTo(3);break}return F.yield(l.textSequenceModeOffset_,4);case 4:n=F.yieldResult,l.textEngine_.setTimestampOffset(n);
|
|
763
764
|
case 3:return F.yield(l.textEngine_.appendBuffer(b,c?c.startTime:null,c?c.endTime:null,c?c.getUris()[0]:null),5);case 5:return F.return();case 2:if(k||!l.needSplitMuxedContent_){F.jumpTo(6);break}return F.yield(l.appendBuffer(m.AUDIO,b,c,d,e,f,g,h,!0),7);case 7:return F.yield(l.appendBuffer(m.VIDEO,b,c,d,e,f,g,h,!0),8);case 8:return F.return();case 6:if(!l.sourceBuffers_[a])return shaka.log.warning("Attempted to restore a non-existent source buffer"),F.return();p=l.sourceBuffers_[a].timestampOffset;
|
|
764
765
|
q=l.sourceBufferTypes_[a];l.transmuxers_[a]&&(q=l.transmuxers_[a].getOriginalMimeType());c&&(r=l.getTimestampAndDispatchMetadata_(a,b,c,q,p),null!=r&&(t=c.startTime-r,w=Math.abs(p-t),(.001<=w||f||g)&&(!h||0<t||!p)&&(p=t,l.attemptTimestampOffsetCalculation_&&(l.enqueueOperation_(a,function(){return l.abort_(a)},null),l.enqueueOperation_(a,function(){return l.setTimestampOffset_(a,p)},null))),u=a==m.VIDEO||!(m.VIDEO in l.sourceBuffers_),l.sequenceMode_&&u&&l.textSequenceModeOffset_.resolve(p)));e&&
|
|
@@ -856,8 +857,8 @@ shaka.media.MediaSourcePlayhead.prototype.release=function(){this.videoWrapper_&
|
|
|
856
857
|
shaka.media.MediaSourcePlayhead.prototype.getTime=function(){var a=this.videoWrapper_.getTime();return 0<this.mediaElement_.readyState&&!this.mediaElement_.paused?this.clampTime_(a):a};shaka.media.MediaSourcePlayhead.prototype.getStallsDetected=function(){return this.stallDetector_?this.stallDetector_.getStallsDetected():0};shaka.media.MediaSourcePlayhead.prototype.getGapsJumped=function(){return this.gapController_.getGapsJumped()};
|
|
857
858
|
shaka.media.MediaSourcePlayhead.prototype.getStartTime_=function(a){null==a?a=Infinity>this.timeline_.getDuration()?this.timeline_.getSeekRangeStart():this.timeline_.getSeekRangeEnd():0>a&&(a=this.timeline_.getSeekRangeEnd()+a);return this.clampSeekToDuration_(this.clampTime_(a))};shaka.media.MediaSourcePlayhead.prototype.notifyOfBufferingChange=function(){this.gapController_.onSegmentAppended()};
|
|
858
859
|
shaka.media.MediaSourcePlayhead.prototype.onPollWindow_=function(){if(0!=this.mediaElement_.readyState&&!this.mediaElement_.paused){var a=this.videoWrapper_.getTime(),b=this.timeline_.getSeekRangeStart(),c=this.timeline_.getSeekRangeEnd();c-b<this.minSeekRange_&&(b=c-this.minSeekRange_);a<b&&(b=this.reposition_(a),shaka.log.info("Jumping forward "+(b-a)+" seconds to catch up with the seek range."),this.mediaElement_.currentTime=b)}};shaka.media.MediaSourcePlayhead.prototype.onStarted_=function(a){this.gapController_.onStarted(a)};
|
|
859
|
-
shaka.media.MediaSourcePlayhead.prototype.onSeeking_=function(){this.gapController_.onSeeking();var a=this.videoWrapper_.getTime(),b=this.reposition_(a);if(Math.abs(b-a)>shaka.media.GapJumpingController.BROWSER_GAP_TOLERANCE){var c=Date.now()/1E3;if(!this.lastCorrectiveSeek_||this.lastCorrectiveSeek_<
|
|
860
|
-
shaka.media.MediaSourcePlayhead.prototype.clampSeekToDuration_=function(a){var b=this.timeline_.getDuration();return a>=b?(goog.asserts.assert(0<=this.config_.durationBackoff,"Duration backoff must be non-negative!"),b-this.config_.durationBackoff):a};
|
|
860
|
+
shaka.media.MediaSourcePlayhead.prototype.onSeeking_=function(){this.gapController_.onSeeking();var a=this.videoWrapper_.getTime(),b=this.reposition_(a);if(Math.abs(b-a)>shaka.media.GapJumpingController.BROWSER_GAP_TOLERANCE){var c=!1;if(shaka.util.Platform.isSeekingSlow()){var d=Date.now()/1E3,e=shaka.util.Platform.isFuchsiaCastDevice()?3:1;if(!this.lastCorrectiveSeek_||this.lastCorrectiveSeek_<d-e)this.lastCorrectiveSeek_=d,c=!0}else c=!0;if(c){this.videoWrapper_.setTime(b);return}}shaka.log.v1("Seek to "+
|
|
861
|
+
a);this.onSeek_()};shaka.media.MediaSourcePlayhead.prototype.clampSeekToDuration_=function(a){var b=this.timeline_.getDuration();return a>=b?(goog.asserts.assert(0<=this.config_.durationBackoff,"Duration backoff must be non-negative!"),b-this.config_.durationBackoff):a};
|
|
861
862
|
shaka.media.MediaSourcePlayhead.prototype.reposition_=function(a){goog.asserts.assert(this.config_,"Cannot reposition playhead when it has beeen destroyed");var b=Math.max(this.minBufferTime_,this.config_.rebufferingGoal),c=this.config_.safeSeekOffset,d=this.timeline_.getSeekRangeStart(),e=this.timeline_.getSeekRangeEnd(),f=this.timeline_.getDuration();e-d<this.minSeekRange_&&(d=e-this.minSeekRange_);var g=this.timeline_.getSafeSeekRangeStart(b),h=this.timeline_.getSafeSeekRangeStart(c);b=this.timeline_.getSafeSeekRangeStart(b+
|
|
862
863
|
c);if(a>=f)return shaka.log.v1("Playhead past duration."),this.clampSeekToDuration_(a);if(a>e)return shaka.log.v1("Playhead past end."),e;if(a<d){if(shaka.media.TimeRangesUtils.isBuffered(this.mediaElement_.buffered,h))return shaka.log.v1("Playhead before start & start is buffered"),h;shaka.log.v1("Playhead before start & start is unbuffered");return b}if(a>=g||shaka.media.TimeRangesUtils.isBuffered(this.mediaElement_.buffered,a))return shaka.log.v1("Playhead in safe region or in buffered region."),
|
|
863
864
|
a;shaka.log.v1("Playhead outside safe region & in unbuffered region.");return b};shaka.media.MediaSourcePlayhead.prototype.clampTime_=function(a){var b=this.timeline_.getSeekRangeStart();if(a<b)return b;b=this.timeline_.getSeekRangeEnd();return a>b?b:a};
|
|
@@ -1440,7 +1441,7 @@ goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.pro
|
|
|
1440
1441
|
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);
|
|
1441
1442
|
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);
|
|
1442
1443
|
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);
|
|
1443
|
-
shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.2-
|
|
1444
|
+
shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.9.2-caf3-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_++};
|
|
1444
1445
|
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()};
|
|
1445
1446
|
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()};
|
|
1446
1447
|
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()};
|
|
@@ -2510,10 +2511,10 @@ d.jumpTo(2):2!=d.nextAddress?(c=d.yieldResult,d.return(c)):d.return(shaka.media.
|
|
|
2510
2511
|
shaka.polyfill.MediaCapabilities.checkDrmSupport_=function(a,b,c){var d,e,f,g,h,k,l,m,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){switch(p.nextAddress){case 1:d=[];e=[];c.audio&&(f={robustness:c.audio.robustness||"",contentType:b.contentType},shaka.util.Platform.isTizen()&&b.contentType.includes('codecs="ac-3"')&&(f.contentType='audio/mp4; codecs="ec-3"'),c.audio.encryptionScheme&&(f.encryptionScheme=c.audio.encryptionScheme),d.push(f));c.video&&(g={robustness:c.video.robustness||
|
|
2511
2512
|
"",contentType:a.contentType},c.video.encryptionScheme&&(g.encryptionScheme=c.video.encryptionScheme),e.push(g));h={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(h.audioCapabilities=d);e.length&&(h.videoCapabilities=e);k=a?a.contentType:"";l=b?b.contentType:"";m=c.keySystem;n=null;p.setCatchFinallyBlocks(2);if(shaka.media.DrmEngine.hasMediaKeySystemAccess(k,l,m)){n=shaka.media.DrmEngine.getMediaKeySystemAccess(k,
|
|
2512
2513
|
l,m);p.jumpTo(4);break}return p.yield(navigator.requestMediaKeySystemAccess(c.keySystem,[h]),5);case 5:n=p.yieldResult,shaka.media.DrmEngine.setMediaKeySystemAccess(k,l,m,n);case 4:p.leaveTryBlock(3);break;case 2:p.enterCatchBlock(),shaka.log.info("navigator.requestMediaKeySystemAccess failed.");case 3:return p.return(n)}})};
|
|
2513
|
-
shaka.polyfill.MediaCapabilities.canCastDisplayType_=function(a){var b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(
|
|
2514
|
-
a.height);a.framerate&&(b+="; framerate="+a.framerate);
|
|
2515
|
-
goog.exportProperty(shaka.polyfill,"MediaCapabilities",shaka.polyfill.MediaCapabilities);goog.exportProperty(shaka.polyfill.MediaCapabilities,"install",shaka.polyfill.MediaCapabilities.install);shaka.polyfill.MediaCapabilities.originalMcap=null;goog.exportProperty(shaka.polyfill.MediaCapabilities,"originalMcap",shaka.polyfill.MediaCapabilities.originalMcap);
|
|
2516
|
-
goog.exportProperty(shaka.polyfill.MediaCapabilities,"memoizedCanDisplayTypeRequests_",shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_);shaka.polyfill.register(shaka.polyfill.MediaCapabilities.install,-1);shaka.polyfill.MediaSource=function(){};
|
|
2514
|
+
shaka.polyfill.MediaCapabilities.canCastDisplayType_=function(a){var b,c,d,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){if(1==f.nextAddress){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return shaka.log.warning("Expected cast APIs to be available! Falling back to shaka.media.Capabilities.isTypeSupported() for type support."),f.return(shaka.media.Capabilities.isTypeSupported(a.contentType));b=a.contentType;a.width&&a.height&&(1280<a.width||720<a.height)&&
|
|
2515
|
+
(b+="; width="+a.width+"; height="+a.height);a.framerate&&(c=Math.round(a.framerate),24>c||30<c)&&(b+="; framerate="+a.framerate);d=a.transferFunction||"";switch(d){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;default:return f.return(!1)}e=!1;return b in shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_?(e=shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_[b],f.jumpTo(2)):f.yield(cast.__platform__.canDisplayType(b),
|
|
2516
|
+
3)}2!=f.nextAddress&&(e=f.yieldResult,shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_[b]=e);return f.return(e)})};goog.exportProperty(shaka.polyfill,"MediaCapabilities",shaka.polyfill.MediaCapabilities);goog.exportProperty(shaka.polyfill.MediaCapabilities,"install",shaka.polyfill.MediaCapabilities.install);shaka.polyfill.MediaCapabilities.originalMcap=null;goog.exportProperty(shaka.polyfill.MediaCapabilities,"originalMcap",shaka.polyfill.MediaCapabilities.originalMcap);
|
|
2517
|
+
shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_={};goog.exportProperty(shaka.polyfill.MediaCapabilities,"memoizedCanDisplayTypeRequests_",shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_);shaka.polyfill.register(shaka.polyfill.MediaCapabilities.install,-1);shaka.polyfill.MediaSource=function(){};
|
|
2517
2518
|
shaka.polyfill.MediaSource.install=function(){shaka.log.debug("MediaSource.install");var a=shaka.util.Platform.safariVersion();window.MediaSource||window.ManagedMediaSource?a?10>=a?(shaka.log.info("Blacklisting MSE on Safari <= 10."),shaka.polyfill.MediaSource.blacklist_()):12>=a?(shaka.log.info("Patching Safari 11 & 12 MSE bugs."),shaka.polyfill.MediaSource.stubAbort_(),shaka.polyfill.MediaSource.patchRemovalRange_()):15>=a&&(shaka.log.info("Patching Safari 13 & 14 & 15 MSE bugs."),shaka.polyfill.MediaSource.stubAbort_()):
|
|
2518
2519
|
shaka.util.Platform.isZenterio()?(shaka.polyfill.MediaSource.stubAbort_(),shaka.polyfill.MediaSource.patchRemovalRange_()):shaka.util.Platform.isTizen2()||shaka.util.Platform.isTizen3()||shaka.util.Platform.isTizen4()?(shaka.log.info("Rejecting Opus."),shaka.polyfill.MediaSource.rejectCodec_("opus")):shaka.log.info("Using native MSE as-is."):shaka.log.info("No MSE implementation available.");(window.MediaSource||window.ManagedMediaSource)&&shaka.polyfill.MediaSource.rejectContainer_("mp2t");window.MediaSource&&
|
|
2519
2520
|
MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&(shaka.log.info("Patching vp09 support queries."),shaka.polyfill.MediaSource.patchVp09_())};shaka.polyfill.MediaSource.blacklist_=function(){window.MediaSource=null};
|