shaka-player 4.8.12 → 4.8.14
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 +34 -34
- package/dist/shaka-player.compiled.d.ts +1 -1
- package/dist/shaka-player.compiled.debug.d.ts +1 -1
- package/dist/shaka-player.compiled.debug.js +28 -28
- package/dist/shaka-player.compiled.debug.map +2 -2
- package/dist/shaka-player.compiled.js +712 -711
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +1 -1
- package/dist/shaka-player.ui.debug.d.ts +1 -1
- package/dist/shaka-player.ui.debug.js +31 -31
- package/dist/shaka-player.ui.debug.map +2 -2
- package/dist/shaka-player.ui.js +972 -971
- package/dist/shaka-player.ui.map +3 -3
- package/externs/polyfill.js +1 -1
- package/lib/media/drm_engine.js +7 -1
- package/lib/media/media_source_engine.js +1 -1
- package/lib/media/presentation_timeline.js +1 -1
- package/lib/media/time_ranges_utils.js +18 -10
- package/lib/player.js +12 -16
- package/lib/polyfill/patchedmediakeys_apple.js +9 -2
- package/lib/polyfill/patchedmediakeys_nop.js +8 -1
- package/lib/polyfill/patchedmediakeys_webkit.js +12 -2
- package/lib/util/manifest_parser_utils.js +1 -1
- package/lib/util/platform.js +6 -5
- package/package.json +1 -1
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
|
-
PAUSE: 'PAUSE',
|
|
737
|
-
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
738
|
-
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
739
|
-
QUALITY: 'QUALITY',
|
|
740
|
-
LANGUAGE: 'LANGUAGE',
|
|
741
|
-
FULL_SCREEN: 'FULL_SCREEN',
|
|
742
|
-
BACK: 'BACK',
|
|
743
|
-
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
744
|
-
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
745
|
-
CAPTIONS: 'CAPTIONS',
|
|
746
|
-
RESOLUTION: 'RESOLUTION',
|
|
747
|
-
FAST_FORWARD: 'FAST_FORWARD',
|
|
748
735
|
AD_PROGRESS: 'AD_PROGRESS',
|
|
749
|
-
|
|
750
|
-
|
|
736
|
+
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
737
|
+
UNMUTE: 'UNMUTE',
|
|
738
|
+
QUALITY: 'QUALITY',
|
|
739
|
+
PAUSE: 'PAUSE',
|
|
740
|
+
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
751
741
|
STATISTICS: 'STATISTICS',
|
|
742
|
+
CAPTIONS: 'CAPTIONS',
|
|
743
|
+
PLAYBACK_RATE: 'PLAYBACK_RATE',
|
|
752
744
|
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
|
|
753
|
-
|
|
745
|
+
AD_DURATION: 'AD_DURATION',
|
|
746
|
+
BACK: 'BACK',
|
|
747
|
+
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
748
|
+
FULL_SCREEN: 'FULL_SCREEN',
|
|
749
|
+
AIRPLAY: 'AIRPLAY',
|
|
750
|
+
SURROUND: 'SURROUND',
|
|
751
|
+
CAST: 'CAST',
|
|
752
|
+
MUTE: 'MUTE',
|
|
753
|
+
SKIP_AD: 'SKIP_AD',
|
|
754
754
|
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
755
|
+
SKIP_TO_LIVE: 'SKIP_TO_LIVE',
|
|
756
|
+
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
|
|
757
|
+
REPLAY: 'REPLAY',
|
|
758
|
+
RESOLUTION: 'RESOLUTION',
|
|
759
|
+
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
|
|
758
760
|
AD_TIME: 'AD_TIME',
|
|
759
|
-
|
|
761
|
+
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
762
|
+
SUBTITLE_FORCED: 'SUBTITLE_FORCED',
|
|
763
|
+
RECENTER_VR: 'RECENTER_VR',
|
|
764
|
+
FAST_FORWARD: 'FAST_FORWARD',
|
|
765
|
+
OFF: 'OFF',
|
|
760
766
|
SEEK: 'SEEK',
|
|
761
|
-
|
|
767
|
+
VOLUME: 'VOLUME',
|
|
762
768
|
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
SURROUND: 'SURROUND',
|
|
766
|
-
PLAY: 'PLAY',
|
|
767
|
-
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
|
|
769
|
+
LIVE: 'LIVE',
|
|
770
|
+
LOOP: 'LOOP',
|
|
768
771
|
ON: 'ON',
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
MORE_SETTINGS: 'MORE_SETTINGS',
|
|
772
|
-
REWIND: 'REWIND',
|
|
773
|
-
AIRPLAY: 'AIRPLAY',
|
|
774
|
-
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
|
|
775
|
-
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
|
|
772
|
+
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC',
|
|
773
|
+
LANGUAGE: 'LANGUAGE',
|
|
776
774
|
NOT_APPLICABLE: 'NOT_APPLICABLE',
|
|
777
|
-
|
|
775
|
+
REWIND: 'REWIND',
|
|
778
776
|
AUTO_QUALITY: 'AUTO_QUALITY',
|
|
777
|
+
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
|
|
778
|
+
PLAY: 'PLAY',
|
|
779
779
|
};
|
|
@@ -4316,7 +4316,7 @@ declare namespace msdk.device {
|
|
|
4316
4316
|
}
|
|
4317
4317
|
// Generated from /home/runner/work/shaka-player/shaka-player/externs/polyfill.js
|
|
4318
4318
|
declare namespace window {
|
|
4319
|
-
let shakaMediaKeysPolyfill :
|
|
4319
|
+
let shakaMediaKeysPolyfill : string ;
|
|
4320
4320
|
}
|
|
4321
4321
|
// Generated from /home/runner/work/shaka-player/shaka-player/externs/prefixed_eme.js
|
|
4322
4322
|
declare namespace ಠ_ಠ.clutz {
|
|
@@ -4316,7 +4316,7 @@ declare namespace msdk.device {
|
|
|
4316
4316
|
}
|
|
4317
4317
|
// Generated from /home/runner/work/shaka-player/shaka-player/externs/polyfill.js
|
|
4318
4318
|
declare namespace window {
|
|
4319
|
-
let shakaMediaKeysPolyfill :
|
|
4319
|
+
let shakaMediaKeysPolyfill : string ;
|
|
4320
4320
|
}
|
|
4321
4321
|
// Generated from /home/runner/work/shaka-player/shaka-player/externs/prefixed_eme.js
|
|
4322
4322
|
declare namespace ಠ_ಠ.clutz {
|
|
@@ -234,7 +234,7 @@ 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.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill
|
|
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.isMediaKeysPolyfilled=function(a){return a?a===window.shakaMediaKeysPolyfill:!!window.shakaMediaKeysPolyfill};
|
|
238
238
|
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
239
|
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(x){shaka.log.alwaysWarn("Tizen: Error detecting screen size, default screen size 1920x1080.")}t.jumpTo(3);
|
|
240
240
|
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(x){f=e.notSupported}f===e.probably?(b.width=3840,b.height=2160):(b.width=1920,b.height=1080);
|
|
@@ -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(",")};
|
|
@@ -493,9 +493,9 @@ shaka.util.TXml.txmlNodeToDomElement=function(a,b,c){b=void 0===b?!0:b;c=void 0=
|
|
|
493
493
|
shaka.util.TXml.knownNameSpaces_=new Map([]);shaka.media.DrmEngine=function(a){var b=this;this.playerInterface_=a;this.supportedTypes_=new Set;this.video_=this.mediaKeys_=null;this.initializedForStorage_=this.initialized_=!1;this.licenseTimeSeconds_=0;this.currentDrmInfo_=null;this.eventManager_=new shaka.util.EventManager;this.activeSessions_=new Map;this.storedPersistentSessions_=new Map;this.allSessionsLoaded_=new shaka.util.PublicPromise;this.config_=null;this.onError_=function(c){c.severity==shaka.util.Error.Severity.CRITICAL&&b.allSessionsLoaded_.reject(c);
|
|
494
494
|
a.onError(c)};this.keyStatusByKeyId_=new Map;this.announcedKeyStatusByKeyId_=new Map;this.keyStatusTimer_=new shaka.util.Timer(function(){return b.processKeyStatusChanges_()});this.usePersistentLicenses_=!1;this.mediaKeyMessageEvents_=[];this.initialRequestsSent_=!1;this.expirationTimer_=new shaka.util.Timer(function(){b.pollExpiration_()});this.allSessionsLoaded_.catch(function(){});this.destroyer_=new shaka.util.Destroyer(function(){return b.destroyNow_()});this.srcEquals_=!1;this.manifestInitData_=
|
|
495
495
|
this.mediaKeysAttached_=null};shaka.media.DrmEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
|
|
496
|
-
shaka.media.DrmEngine.prototype.destroyNow_=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(
|
|
497
|
-
return
|
|
498
|
-
shaka.media.DrmEngine.prototype.setSrcEquals=function(a){this.srcEquals_=a};shaka.media.DrmEngine.prototype.initForStorage=function(a,b){this.initializedForStorage_=!0;this.storedPersistentSessions_=new Map;this.usePersistentLicenses_=b;return this.init_(a)};
|
|
496
|
+
shaka.media.DrmEngine.prototype.destroyNow_=function(){var a=this,b;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){switch(c.nextAddress){case 1:return a.eventManager_.release(),a.eventManager_=null,a.allSessionsLoaded_.reject(),a.expirationTimer_.stop(),a.expirationTimer_=null,a.keyStatusTimer_.stop(),a.keyStatusTimer_=null,c.yield(a.closeOpenSessions_(),2);case 2:if(!a.video_){c.jumpTo(3);break}shaka.util.Platform.isMediaKeysPolyfilled("webkit")||goog.asserts.assert(!a.video_.src,
|
|
497
|
+
"video src must be removed first!");c.setCatchFinallyBlocks(4);return c.yield(a.video_.setMediaKeys(null),6);case 6:c.leaveTryBlock(5);break;case 4:b=c.enterCatchBlock(),shaka.log.debug("DrmEngine.destroyNow_ exception",b);case 5:a.video_=null;case 3:a.currentDrmInfo_=null,a.supportedTypes_.clear(),a.mediaKeys_=null,a.storedPersistentSessions_=new Map,a.config_=null,a.onError_=function(){},a.playerInterface_=null,a.srcEquals_=!1,a.mediaKeysAttached_=null,c.jumpToEnd()}})};
|
|
498
|
+
shaka.media.DrmEngine.prototype.configure=function(a){this.config_=a;this.expirationTimer_&&this.expirationTimer_.tickEvery(this.config_.updateExpirationTime)};shaka.media.DrmEngine.prototype.setSrcEquals=function(a){this.srcEquals_=a};shaka.media.DrmEngine.prototype.initForStorage=function(a,b){this.initializedForStorage_=!0;this.storedPersistentSessions_=new Map;this.usePersistentLicenses_=b;return this.init_(a)};
|
|
499
499
|
shaka.media.DrmEngine.prototype.initForPlayback=function(a,b){this.storedPersistentSessions_=new Map;b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next())this.storedPersistentSessions_.set(c.value,{initData:null,initDataType:null});b=$jscomp.makeIterator(this.config_.persistentSessionsMetadata);for(c=b.next();!c.done;c=b.next())c=c.value,this.storedPersistentSessions_.set(c.sessionId,{initData:c.initData,initDataType:c.initDataType});this.usePersistentLicenses_=0<this.storedPersistentSessions_.size;
|
|
500
500
|
return this.init_(a)};
|
|
501
501
|
shaka.media.DrmEngine.prototype.initForRemoval=function(a,b,c,d,e){var f=new Map;d={audioCapabilities:d,videoCapabilities:e,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:a};d.drmInfos=[{keySystem:a,licenseServerUri:b,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:c,serverCertificateUri:"",initData:null,keyIds:null}];f.set(a,d);return this.queryMediaKeys_(f,[])};
|
|
@@ -630,9 +630,9 @@ goog.exportProperty(shaka.media.SegmentReference.prototype,"markAsByterangeOptim
|
|
|
630
630
|
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);
|
|
631
631
|
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);
|
|
632
632
|
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);
|
|
633
|
-
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.
|
|
634
|
-
shaka.media.TimeRangesUtils.
|
|
635
|
-
shaka.media.TimeRangesUtils.getGapIndex=function(a,b,c){var d=shaka.media.TimeRangesUtils;if(!a||!a.length||
|
|
633
|
+
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};
|
|
634
|
+
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};
|
|
635
|
+
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};
|
|
636
636
|
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};/*
|
|
637
637
|
@license
|
|
638
638
|
Shaka Player
|
|
@@ -724,7 +724,7 @@ shaka.media.MediaSourceEngine.prototype.createMediaSource=function(a){var b=this
|
|
|
724
724
|
shaka.media.MediaSourceEngine.prototype.onSourceOpen_=function(a){goog.asserts.assert(this.url_,"Must have object URL");URL.revokeObjectURL(this.url_);a.resolve()};
|
|
725
725
|
shaka.media.MediaSourceEngine.isStreamSupported=function(a,b){var c,d,e,f,g,h,k,l,m,n,p,q,r,t;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){if(1==x.nextAddress)return a.createSegmentIndex?x.yield(a.createSegmentIndex(),2):x.jumpTo(2);if(!a.segmentIndex)return x.return(!1);if(a.segmentIndex.isEmpty())return x.return(!0);c=shaka.util.MimeUtils;d=shaka.transmuxer.TransmuxerEngine;e=shaka.util.ManifestParserUtils.ContentType;f=shaka.util.StreamUtils;g=new Set;h=$jscomp.makeIterator(a.segmentIndex);
|
|
726
726
|
for(k=h.next();!k.done;k=h.next())if(l=k.value,m=l.mimeType||a.mimeType||"",n=l.codecs||a.codecs||"",p=m+":"+n,!g.has(p))if(g.add(p),b==e.TEXT){if(q=c.getFullType(m,n),!shaka.text.TextEngine.isTypeSupported(q))return x.return(!1)}else if(b==e.VIDEO?n=f.getCorrectVideoCodecs(n):b==e.AUDIO&&(n=f.getCorrectAudioCodecs(n,m)),r=c.getExtendedType(a,m,n),t=c.getFullTypeWithAllCodecs(m,n),!shaka.media.Capabilities.isTypeSupported(r)&&!d.isSupported(t,a.type))return x.return(!1);return x.return(!0)})};
|
|
727
|
-
shaka.media.MediaSourceEngine.probeSupport=function(){var a='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat($jscomp.arrayFromIterable(shaka.util.MimeUtils.RAW_FORMATS)),
|
|
727
|
+
shaka.media.MediaSourceEngine.probeSupport=function(){var a='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.01",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat($jscomp.arrayFromIterable(shaka.util.MimeUtils.RAW_FORMATS)),
|
|
728
728
|
b={};a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;shaka.text.TextEngine.isTypeSupported(c)?b[c]=!0:shaka.util.Platform.supportsMediaSource()?b[c]=shaka.media.Capabilities.isTypeSupported(c)||shaka.transmuxer.TransmuxerEngine.isSupported(c):b[c]=shaka.util.Platform.supportsMediaType(c);var d=c.split(";")[0];b[d]=b[d]||b[c]}return b};shaka.media.MediaSourceEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
|
|
729
729
|
shaka.media.MediaSourceEngine.prototype.doDestroy_=function(){var a=this,b,c,d,e,f,g,h,k,l,m;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){if(1==n.nextAddress){b=shaka.util.Functional;c=[];for(d in a.queues_)for(e=a.queues_[d],f=e[0],a.queues_[d]=e.slice(0,1),f&&c.push(f.p.catch(b.noop)),g=$jscomp.makeIterator(e.slice(1)),h=g.next();!h.done;h=g.next())k=h.value,k.p.reject(shaka.util.Destroyer.destroyedError());a.textEngine_&&c.push(a.textEngine_.destroy());a.textDisplayer_&&c.push(a.textDisplayer_.destroy());
|
|
730
730
|
for(l in a.transmuxers_)c.push(a.transmuxers_[l].destroy());return n.yield(Promise.all(c),2)}a.eventManager_&&(a.eventManager_.release(),a.eventManager_=null);a.video_&&(a.video_.removeAttribute("src"),a.video_.load(),a.video_=null);a.config_=null;a.mediaSource_=null;a.textEngine_=null;a.textDisplayer_=null;a.sourceBuffers_={};a.transmuxers_={};a.captionParser_=null;if(goog.DEBUG)for(m in a.queues_)goog.asserts.assert(0==a.queues_[m].length,m+" queue should be empty after destroy!");a.queues_={};
|
|
@@ -786,7 +786,7 @@ shaka.media.MediaSourceEngine.prototype.codecSwitchIfNecessary_=function(a,b,c,d
|
|
|
786
786
|
v=g.getBasicType(n);if(h===y&&k===v)return A.return(!1);z=!0;if(e.needSplitMuxedContent_||m&&l&&!e.transmuxers_[a])z=!1;if(z&&e.config_.codecSwitchingStrategy===shaka.config.CodecSwitchingStrategy.SMOOTH&&shaka.media.Capabilities.isChangeTypeSupported())return A.yield(e.changeType(a,n,l),3);l&&l.destroy();return A.yield(e.reset(d),3)}return A.return(!0)})};
|
|
787
787
|
shaka.media.MediaSourceEngine.prototype.isCodecSwitchNecessary_=function(a,b,c,d){if(a==shaka.util.ManifestParserUtils.ContentType.TEXT)return!1;var e=shaka.util.MimeUtils;b=e.getCodecBase(e.getCodecs(this.sourceBufferTypes_[a]));var f=e.getBasicType(this.sourceBufferTypes_[a]),g=shaka.util.MimeUtils.getFullType(c,d),h=this.config_.forceTransmux;if(!shaka.media.Capabilities.isTypeSupported(g)||!this.sequenceMode_&&shaka.util.MimeUtils.RAW_FORMATS.includes(g))h=!0;c=shaka.util.MimeUtils.getFullTypeWithAllCodecs(c,
|
|
788
788
|
d);d=shaka.transmuxer.TransmuxerEngine;h&&(h=d.findTransmuxer(c))&&(h=h(),g=h.convertCodecs(a,c),h.destroy());a=e.getCodecBase(e.getCodecs(g));e=e.getBasicType(g);return b!==a||f!==e};shaka.media.MediaSourceEngine.prototype.isResetMediaSourceNecessary=function(a,b,c,d){return this.isCodecSwitchNecessary_(a,b,c,d)?this.config_.codecSwitchingStrategy!==shaka.config.CodecSwitchingStrategy.SMOOTH||!shaka.media.Capabilities.isChangeTypeSupported()||this.needSplitMuxedContent_:!1};
|
|
789
|
-
shaka.media.MediaSourceEngine.prototype.updateLcevcDec=function(a){this.lcevcDec_=a};shaka.media.MediaSourceEngine.prototype.addExtraFeaturesToMimeType_=function(a){var b=this.config_.addExtraFeaturesToSourceBuffer(a);a+=b;shaka.log.debug("Using full mime type",a);return a};shaka.media.MediaSourceEngine.createObjectURL=window.URL.createObjectURL;shaka.media.MediaSourceEngine.SourceBufferMode_={SEQUENCE:"sequence",SEGMENTS:"segments"};shaka.media.PresentationTimeline=function(a,b,c){this.presentationStartTime_=a;this.presentationDelay_=b;this.segmentAvailabilityDuration_=this.duration_=Infinity;this.maxSegmentDuration_=1;this.maxSegmentEndTime_=this.minSegmentStartTime_=null;this.clockOffset_=0;this.static_=!0;this.userSeekStart_=0;this.autoCorrectDrift_=void 0===c?!0:c;this.availabilityTimeOffset_=0;this.startTimeLocked_=!1;this.initialProgramDateTime_=
|
|
789
|
+
shaka.media.MediaSourceEngine.prototype.updateLcevcDec=function(a){this.lcevcDec_=a};shaka.media.MediaSourceEngine.prototype.addExtraFeaturesToMimeType_=function(a){var b=this.config_.addExtraFeaturesToSourceBuffer(a);a+=b;shaka.log.debug("Using full mime type",a);return a};shaka.media.MediaSourceEngine.createObjectURL=window.URL.createObjectURL;shaka.media.MediaSourceEngine.SourceBufferMode_={SEQUENCE:"sequence",SEGMENTS:"segments"};shaka.media.PresentationTimeline=function(a,b,c){this.presentationStartTime_=a;this.presentationDelay_=b;this.segmentAvailabilityDuration_=this.duration_=Infinity;this.maxSegmentDuration_=1;this.maxSegmentEndTime_=this.minSegmentStartTime_=null;this.clockOffset_=0;this.static_=!0;this.userSeekStart_=0;this.autoCorrectDrift_=void 0===c?!0:c;this.availabilityTimeOffset_=0;this.startTimeLocked_=!1;this.initialProgramDateTime_=a};shaka.media.PresentationTimeline.prototype.getDuration=function(){return this.duration_};
|
|
790
790
|
shaka.media.PresentationTimeline.prototype.getMaxSegmentDuration=function(){return this.maxSegmentDuration_};shaka.media.PresentationTimeline.prototype.setPresentationStartTime=function(a){goog.asserts.assert(0<=a,"presentationStartTime must be >= 0");this.presentationStartTime_=a};shaka.media.PresentationTimeline.prototype.setDuration=function(a){goog.asserts.assert(0<a,"duration must be > 0");this.duration_=a};shaka.media.PresentationTimeline.prototype.getPresentationStartTime=function(){return this.presentationStartTime_};
|
|
791
791
|
shaka.media.PresentationTimeline.prototype.setClockOffset=function(a){this.clockOffset_=a};shaka.media.PresentationTimeline.prototype.setStatic=function(a){this.static_=a};shaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration=function(a){goog.asserts.assert(0<=a,"segmentAvailabilityDuration must be >= 0");this.segmentAvailabilityDuration_=a};shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration=function(){return this.segmentAvailabilityDuration_};
|
|
792
792
|
shaka.media.PresentationTimeline.prototype.setDelay=function(a){goog.asserts.assert(0<=a,"delay must be >= 0");this.presentationDelay_=a};shaka.media.PresentationTimeline.prototype.getDelay=function(){return this.presentationDelay_};
|
|
@@ -1174,8 +1174,7 @@ NaN;this.config_=this.defaultConfig_();this.maxHwRes_={width:Infinity,height:Inf
|
|
|
1174
1174
|
this.config_.preferredAudioLabel,this.config_.preferredVideoLabel,this.config_.mediaSource.codecSwitchingStrategy,this.config_.manifest.dash.enableAudioGroups);this.currentTextLanguage_=this.config_.preferredTextLanguage;this.currentTextRole_=this.config_.preferredTextRole;this.currentTextForced_=this.config_.preferForcedSubs;this.cleanupOnUnload_=[];b&&b(this);this.cmcdManager_=this.createCmcd_();this.cmsdManager_=this.createCmsd_();this.networkingEngine_=this.createNetworkingEngine();this.networkingEngine_.setForceHTTPS(this.config_.streaming.forceHTTPS);
|
|
1175
1175
|
this.adManager_=null;shaka.Player.adManagerFactory_&&(this.adManager_=shaka.Player.adManagerFactory_(),this.adManager_.configure(this.config_.ads));this.globalEventManager_.listen(window,"online",function(){c.restoreDisabledVariants_();c.retryStreaming()});this.checkVariantsTimer_=new shaka.util.Timer(function(){return c.checkVariants_()});a&&(shaka.Deprecate.deprecateFeature(5,"Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),
|
|
1176
1176
|
this.attach(a,!0))};$jscomp.inherits(shaka.Player,shaka.util.FakeEventTarget);shaka.Player.prototype.createLcevcDec_=function(a){null==this.lcevcDec_&&(this.lcevcDec_=new shaka.lcevc.Dec(this.video_,this.lcevcCanvas_,a),this.mediaSourceEngine_&&this.mediaSourceEngine_.updateLcevcDec(this.lcevcDec_))};shaka.Player.prototype.closeLcevcDec_=function(){null!=this.lcevcDec_&&(this.lcevcDec_.hideCanvas(),this.lcevcDec_.release(),this.lcevcDec_=null)};
|
|
1177
|
-
shaka.Player.prototype.setupLcevc_=function(a){
|
|
1178
|
-
shaka.Player.makeEvent_=function(a,b){return new shaka.util.FakeEvent(a,b)};
|
|
1177
|
+
shaka.Player.prototype.setupLcevc_=function(a){a.lcevc.enabled?(this.closeLcevcDec_(),this.createLcevcDec_(a.lcevc)):this.closeLcevcDec_()};shaka.Player.makeEvent_=function(a,b){return new shaka.util.FakeEvent(a,b)};
|
|
1179
1178
|
shaka.Player.prototype.destroy=function(){var a=this,b,c,d,e,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){switch(g.nextAddress){case 1:if(a.loadMode_==shaka.Player.LoadMode.DESTROYED)return g.return();a.closeLcevcDec_();b=a.detach();a.loadMode_=shaka.Player.LoadMode.DESTROYED;return g.yield(b,2);case 2:c=[];d=$jscomp.makeIterator(a.createdPreloadManagers_);for(e=d.next();!e.done;e=d.next())f=e.value,f.isDestroyed()||c.push(f.destroy());a.createdPreloadManagers_=[];return g.yield(Promise.all(c),
|
|
1180
1179
|
3);case 3:a.globalEventManager_&&(a.globalEventManager_.release(),a.globalEventManager_=null);a.attachEventManager_&&(a.attachEventManager_.release(),a.attachEventManager_=null);a.loadEventManager_&&(a.loadEventManager_.release(),a.loadEventManager_=null);a.trickPlayEventManager_&&(a.trickPlayEventManager_.release(),a.trickPlayEventManager_=null);a.abrManagerFactory_=null;a.config_=null;a.stats_=null;a.videoContainer_=null;a.cmcdManager_=null;a.cmsdManager_=null;if(!a.networkingEngine_){g.jumpTo(4);
|
|
1181
1180
|
break}return g.yield(a.networkingEngine_.destroy(),5);case 5:a.networkingEngine_=null;case 4:a.abrManager_&&(a.abrManager_.release(),a.abrManager_=null),shaka.util.FakeEventTarget.prototype.release.call(a),g.jumpToEnd()}})};shaka.Player.registerSupportPlugin=function(a,b){shaka.Player.supportPlugins_[a]=b};shaka.Player.setAdManagerFactory=function(a){shaka.Player.adManagerFactory_=a};
|
|
@@ -1189,12 +1188,13 @@ shaka.Player.prototype.atomicOperationAcquireMutex_=function(a){var b=this,c;ret
|
|
|
1189
1188
|
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()&&
|
|
1190
1189
|
(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_&&
|
|
1191
1190
|
(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_=
|
|
1192
|
-
null);if(!c.
|
|
1193
|
-
break}return p.yield(c.drmEngine_.destroy(),
|
|
1194
|
-
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)}})};
|
|
1195
|
-
shaka.Player.prototype.
|
|
1196
|
-
shaka.
|
|
1197
|
-
|
|
1191
|
+
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.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)}),
|
|
1192
|
+
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.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);
|
|
1193
|
+
for(k=m.next();!k.done;k=m.next())n=k.value,n.segmentIndex&&n.segmentIndex.release()}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)}})};
|
|
1194
|
+
shaka.Player.prototype.updateStartTime=function(a){this.startTime_=a};
|
|
1195
|
+
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,x;return $jscomp.asyncExecutePromiseGeneratorProgram(function(w){switch(w.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 w.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,
|
|
1196
|
+
shaka.util.Error.Code.NO_VIDEO_ELEMENT);if(!d.assetUri_){w.jumpTo(3);break}return w.yield(d.unload(!1),3);case 3:g=++d.operationId_;h=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){if(1==u.nextAddress)return d.operationId_==g?u.jumpTo(0):e?u.yield(e.destroy(),3):u.jumpTo(3);throw d.createAbortLoadError_();})};k=function(u,y){return $jscomp.asyncExecutePromiseGeneratorProgram(function(v){switch(v.nextAddress){case 1:return v.setFinallyBlock(2),v.yield(d.mutex_.acquire(y),
|
|
1197
|
+
4);case 4:return v.yield(h(),5);case 5:return v.yield(u(),6);case 6:return v.yield(h(),7);case 7:e&&d.config_&&e.reconfigure(d.config_);case 2:v.enterFinallyBlock(),d.mutex_.release(),v.leaveFinallyBlock(0)}})};w.setCatchFinallyBlocks(5,6);null==b&&e&&(b=e.getStartTime());d.startTime_=b;d.fullyLoaded_=!1;d.dispatchEvent(shaka.Player.makeEvent_(shaka.util.FakeEvent.EventName.Loading));if(e){c=e.getMimeType();w.jumpTo(8);break}if(c){w.jumpTo(8);break}return w.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){if(1==
|
|
1198
1198
|
u.nextAddress)return u.yield(d.guessMimeType_(f),2);c=u.yieldResult;u.jumpToEnd()})},"guessMimeType_"),8);case 8:l=!!e;if(e){e.setEventHandoffTarget(d);d.stats_=e.getStats();w.jumpTo(11);break}return w.yield(d.preloadInner_(f,b,c,!0),12);case 12:(e=w.yieldResult)?(e.setEventHandoffTarget(d),d.stats_=e.getStats(),e.start(),e.waitForFinish().catch(function(){})):d.stats_=new shaka.util.Stats;case 11:m=!e;n=e?e.getStartTimeOfLoad():Date.now()/1E3;d.stats_=e?e.getStats():new shaka.util.Stats;d.assetUri_=
|
|
1199
1199
|
f;d.mimeType_=c||null;if(m)return w.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){goog.asserts.assert(c,"We should know the mimeType by now!");return u.yield(d.initializeSrcEqualsDrmInner_(c),0)})},"initializeSrcEqualsDrmInner_"),20);if(d.mediaSourceEngine_){w.jumpTo(15);break}return w.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){return u.yield(d.initializeMediaSourceEngineInner_(),0)})},"initializeMediaSourceEngineInner_"),
|
|
1200
1200
|
15);case 15:return w.yield(k(function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){return u.yield(e.waitForFinish(),0)})},"waitForFinish"),17);case 17:d.config_=e.getConfiguration();d.manifestFilterer_=e.getManifestFilterer();d.parserFactory_=e.getParserFactory();d.parser_=e.receiveParser();d.regionTimeline_=e.receiveRegionTimeline();d.qualityObserver_=e.getQualityObserver();d.manifest_=e.getManifest();if(p=e.getCurrentAdaptationSetCriteria())d.currentAdaptationSetCriteria_=p;
|
|
@@ -1370,7 +1370,7 @@ shaka.Player.prototype.checkVariants_=function(){goog.asserts.assert(this.manife
|
|
|
1370
1370
|
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};
|
|
1371
1371
|
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)};
|
|
1372
1372
|
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)};
|
|
1373
|
-
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)
|
|
1373
|
+
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))};
|
|
1374
1374
|
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};
|
|
1375
1375
|
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,
|
|
1376
1376
|
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()};
|
|
@@ -1412,7 +1412,7 @@ goog.exportProperty(shaka.Player.prototype,"getAssetUri",shaka.Player.prototype.
|
|
|
1412
1412
|
goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.prototype.resetConfiguration);goog.exportProperty(shaka.Player.prototype,"getBufferFullness",shaka.Player.prototype.getBufferFullness);goog.exportProperty(shaka.Player.prototype,"getConfiguration",shaka.Player.prototype.getConfiguration);goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.configure);goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);
|
|
1413
1413
|
goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);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);
|
|
1414
1414
|
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);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);
|
|
1415
|
-
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);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.8.
|
|
1415
|
+
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);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.8.14-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);
|
|
1416
1416
|
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_++};
|
|
1417
1417
|
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()};
|
|
1418
1418
|
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()};
|
|
@@ -2472,9 +2472,9 @@ shaka.polyfill.Orientation.FakeOrientation.prototype.dispatchChangeEvent=functio
|
|
|
2472
2472
|
shaka.polyfill.Orientation.FakeOrientation.prototype.lock=function(a){var b=function(d){return screen.lockOrientation?screen.lockOrientation(d):screen.mozLockOrientation?screen.mozLockOrientation(d):screen.msLockOrientation?screen.msLockOrientation(d):!1},c=!1;switch(a){case "natural":c=b("default");break;case "any":c=!0;this.unlock();break;default:c=b(a)}if(c)return Promise.resolve();a=Error("screen.orientation.lock() is not available on this device");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;
|
|
2473
2473
|
return Promise.reject(a)};shaka.polyfill.Orientation.FakeOrientation.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()};shaka.polyfill.register(shaka.polyfill.Orientation.install);shaka.polyfill.PatchedMediaKeysApple=function(){};
|
|
2474
2474
|
shaka.polyfill.PatchedMediaKeysApple.install=function(a){var b=shaka.polyfill.PatchedMediaKeysApple;if(window.HTMLVideoElement&&window.WebKitMediaKeys){if(void 0===a?0:a)b.enableUninstall=!0,b.originalHTMLMediaElementPrototypeMediaKeys=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),b.originalHTMLMediaElementPrototypeSetMediaKeys=HTMLMediaElement.prototype.setMediaKeys,b.originalWindowMediaKeys=window.MediaKeys,b.originalWindowMediaKeySystemAccess=window.MediaKeySystemAccess,
|
|
2475
|
-
b.originalNavigatorRequestMediaKeySystemAccess=navigator.requestMediaKeySystemAccess;shaka.log.info("Using Apple-prefixed EME");delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=b.setMediaKeys;window.MediaKeys=b.MediaKeys;window.MediaKeySystemAccess=b.MediaKeySystemAccess;navigator.requestMediaKeySystemAccess=b.requestMediaKeySystemAccess;window.shakaMediaKeysPolyfill
|
|
2475
|
+
b.originalNavigatorRequestMediaKeySystemAccess=navigator.requestMediaKeySystemAccess;shaka.log.info("Using Apple-prefixed EME");delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=b.setMediaKeys;window.MediaKeys=b.MediaKeys;window.MediaKeySystemAccess=b.MediaKeySystemAccess;navigator.requestMediaKeySystemAccess=b.requestMediaKeySystemAccess;window.shakaMediaKeysPolyfill=b.apiName_}};
|
|
2476
2476
|
shaka.polyfill.PatchedMediaKeysApple.uninstall=function(){var a=shaka.polyfill.PatchedMediaKeysApple;a.enableUninstall&&(shaka.log.info("Un-installing Apple-prefixed EME"),a.enableUninstall=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",a.originalHTMLMediaElementPrototypeMediaKeys),HTMLMediaElement.prototype.setMediaKeys=a.originalHTMLMediaElementPrototypeSetMediaKeys,window.MediaKeys=a.originalWindowMediaKeys,window.MediaKeySystemAccess=a.originalWindowMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=
|
|
2477
|
-
a.originalNavigatorRequestMediaKeySystemAccess,a.originalWindowMediaKeys=null,a.originalWindowMediaKeySystemAccess=null,a.originalHTMLMediaElementPrototypeSetMediaKeys=null,a.originalNavigatorRequestMediaKeySystemAccess=null,a.originalHTMLMediaElementPrototypeMediaKeys=null,window.shakaMediaKeysPolyfill
|
|
2477
|
+
a.originalNavigatorRequestMediaKeySystemAccess,a.originalWindowMediaKeys=null,a.originalWindowMediaKeySystemAccess=null,a.originalHTMLMediaElementPrototypeSetMediaKeys=null,a.originalNavigatorRequestMediaKeySystemAccess=null,a.originalHTMLMediaElementPrototypeMediaKeys=null,window.shakaMediaKeysPolyfill="")};
|
|
2478
2478
|
shaka.polyfill.PatchedMediaKeysApple.requestMediaKeySystemAccess=function(a,b){shaka.log.debug("PatchedMediaKeysApple.requestMediaKeySystemAccess");goog.asserts.assert(this==navigator,'bad "this" for requestMediaKeySystemAccess');var c=shaka.polyfill.PatchedMediaKeysApple;try{var d=new c.MediaKeySystemAccess(a,b);return Promise.resolve(d)}catch(e){return Promise.reject(e)}};
|
|
2479
2479
|
shaka.polyfill.PatchedMediaKeysApple.setMediaKeys=function(a){shaka.log.debug("PatchedMediaKeysApple.setMediaKeys");goog.asserts.assert(this instanceof HTMLMediaElement,'bad "this" for setMediaKeys');var b=shaka.polyfill.PatchedMediaKeysApple,c=this.mediaKeys;c&&c!=a&&(goog.asserts.assert(c instanceof b.MediaKeys,"non-polyfill instance of oldMediaKeys"),c.setMedia(null));delete this.mediaKeys;return(this.mediaKeys=a)?(goog.asserts.assert(a instanceof b.MediaKeys,"non-polyfill instance of newMediaKeys"),
|
|
2480
2480
|
a.setMedia(this)):Promise.resolve()};
|
|
@@ -2501,16 +2501,16 @@ shaka.polyfill.PatchedMediaKeysApple.MediaKeySession.prototype.onWebkitKeyError_
|
|
|
2501
2501
|
break;default:this.updateKeyStatus_("internal-error")}};shaka.polyfill.PatchedMediaKeysApple.MediaKeySession.prototype.updateKeyStatus_=function(a){this.keyStatuses.setStatus(a);a=new shaka.util.FakeEvent("keystatuseschange");this.dispatchEvent(a)};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap=function(){this.size=0;this.status_=void 0};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.setStatus=function(a){this.size=void 0==a?0:1;this.status_=a};
|
|
2502
2502
|
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.getStatus=function(){return this.status_};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.forEach=function(a){this.status_&&a(this.status_,shaka.media.DrmEngine.DUMMY_KEY_ID.value())};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.get=function(a){if(this.has(a))return this.status_};
|
|
2503
2503
|
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.has=function(a){var b=shaka.media.DrmEngine.DUMMY_KEY_ID.value();return this.status_&&shaka.util.BufferUtils.equal(a,b)?!0:!1};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.entries=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.keys=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};
|
|
2504
|
-
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};shaka.polyfill.PatchedMediaKeysCert=function(){};shaka.polyfill.PatchedMediaKeysCert.install=function(){!window.MediaKeys||MediaKeys.prototype.setServerCertificate&&!shaka.polyfill.PatchedMediaKeysCert.hasInvalidImplementation_()||(shaka.log.info("Patching MediaKeys.setServerCertificate"),MediaKeys.prototype.setServerCertificate=shaka.polyfill.PatchedMediaKeysCert.setServerCertificate_)};
|
|
2504
|
+
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};shaka.polyfill.PatchedMediaKeysApple.apiName_="apple";shaka.polyfill.PatchedMediaKeysCert=function(){};shaka.polyfill.PatchedMediaKeysCert.install=function(){!window.MediaKeys||MediaKeys.prototype.setServerCertificate&&!shaka.polyfill.PatchedMediaKeysCert.hasInvalidImplementation_()||(shaka.log.info("Patching MediaKeys.setServerCertificate"),MediaKeys.prototype.setServerCertificate=shaka.polyfill.PatchedMediaKeysCert.setServerCertificate_)};
|
|
2505
2505
|
shaka.polyfill.PatchedMediaKeysCert.setServerCertificate_=function(a){shaka.log.debug("PatchedMediaKeysCert.setServerCertificate");return Promise.resolve(!1)};shaka.polyfill.PatchedMediaKeysCert.hasInvalidImplementation_=function(){return shaka.util.Platform.isTizen3()||shaka.util.Platform.isTizen4()||shaka.util.Platform.isTizen5_0()||shaka.util.Platform.isWebOS3()};goog.exportProperty(shaka.polyfill,"PatchedMediaKeysCert",shaka.polyfill.PatchedMediaKeysCert);
|
|
2506
2506
|
goog.exportProperty(shaka.polyfill.PatchedMediaKeysCert,"install",shaka.polyfill.PatchedMediaKeysCert.install);shaka.polyfill.register(shaka.polyfill.PatchedMediaKeysCert.install);shaka.polyfill.PatchedMediaKeysNop=function(){};
|
|
2507
2507
|
shaka.polyfill.PatchedMediaKeysNop.install=function(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){shaka.log.info("EME not available.");var a=shaka.polyfill.PatchedMediaKeysNop;navigator.requestMediaKeySystemAccess=a.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=a.setMediaKeys;window.MediaKeys=a.MediaKeys;window.MediaKeySystemAccess=
|
|
2508
|
-
a.MediaKeySystemAccess;window.shakaMediaKeysPolyfill
|
|
2508
|
+
a.MediaKeySystemAccess;window.shakaMediaKeysPolyfill=a.apiName_}};shaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess=function(a,b){shaka.log.debug("PatchedMediaKeysNop.requestMediaKeySystemAccess");goog.asserts.assert(this==navigator,'bad "this" for requestMediaKeySystemAccess');return Promise.reject(Error("The key system specified is not supported."))};
|
|
2509
2509
|
shaka.polyfill.PatchedMediaKeysNop.setMediaKeys=function(a){shaka.log.debug("PatchedMediaKeysNop.setMediaKeys");goog.asserts.assert(this instanceof HTMLMediaElement,'bad "this" for setMediaKeys');return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))};goog.exportProperty(shaka.polyfill,"PatchedMediaKeysNop",shaka.polyfill.PatchedMediaKeysNop);goog.exportProperty(shaka.polyfill.PatchedMediaKeysNop,"install",shaka.polyfill.PatchedMediaKeysNop.install);
|
|
2510
2510
|
shaka.polyfill.PatchedMediaKeysNop.MediaKeys=function(){throw new TypeError("Illegal constructor.");};shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession=function(){};shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate=function(){};shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.getStatusForPolicy=function(a){return Promise.resolve("usable")};
|
|
2511
|
-
shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess=function(){this.keySystem="";throw new TypeError("Illegal constructor.");};shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.getConfiguration=function(){};shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.createMediaKeys=function(){};shaka.polyfill.register(shaka.polyfill.PatchedMediaKeysNop.install,-10);shaka.polyfill.PatchedMediaKeysWebkit=function(){};
|
|
2511
|
+
shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess=function(){this.keySystem="";throw new TypeError("Illegal constructor.");};shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.getConfiguration=function(){};shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.createMediaKeys=function(){};shaka.polyfill.PatchedMediaKeysNop.apiName_="nop";shaka.polyfill.register(shaka.polyfill.PatchedMediaKeysNop.install,-10);shaka.polyfill.PatchedMediaKeysWebkit=function(){};
|
|
2512
2512
|
shaka.polyfill.PatchedMediaKeysWebkit.install=function(){var a=shaka.polyfill.PatchedMediaKeysWebkit;if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)shaka.log.info("Using webkit-prefixed EME v0.1b"),a.prefix_="webkit";else if(HTMLMediaElement.prototype.generateKeyRequest)shaka.log.info("Using nonprefixed EME v0.1b");else return;goog.asserts.assert(HTMLMediaElement.prototype[a.prefixApi_("generateKeyRequest")],
|
|
2513
|
-
"PatchedMediaKeysWebkit APIs not available!");navigator.requestMediaKeySystemAccess=a.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=a.setMediaKeys;window.MediaKeys=a.MediaKeys;window.MediaKeySystemAccess=a.MediaKeySystemAccess;window.shakaMediaKeysPolyfill
|
|
2513
|
+
"PatchedMediaKeysWebkit APIs not available!");navigator.requestMediaKeySystemAccess=a.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=a.setMediaKeys;window.MediaKeys=a.MediaKeys;window.MediaKeySystemAccess=a.MediaKeySystemAccess;window.shakaMediaKeysPolyfill=a.apiName_}};
|
|
2514
2514
|
shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_=function(a){var b=shaka.polyfill.PatchedMediaKeysWebkit.prefix_;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a};shaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess=function(a,b){shaka.log.debug("PatchedMediaKeysWebkit.requestMediaKeySystemAccess");goog.asserts.assert(this==navigator,'bad "this" for requestMediaKeySystemAccess');var c=shaka.polyfill.PatchedMediaKeysWebkit;try{var d=new c.MediaKeySystemAccess(a,b);return Promise.resolve(d)}catch(e){return Promise.reject(e)}};
|
|
2515
2515
|
shaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys=function(a){shaka.log.debug("PatchedMediaKeysWebkit.setMediaKeys");goog.asserts.assert(this instanceof HTMLMediaElement,'bad "this" for setMediaKeys');var b=shaka.polyfill.PatchedMediaKeysWebkit,c=this.mediaKeys;c&&c!=a&&(goog.asserts.assert(c instanceof b.MediaKeys,"non-polyfill instance of oldMediaKeys"),c.setMedia(null));delete this.mediaKeys;if(this.mediaKeys=a)goog.asserts.assert(a instanceof b.MediaKeys,"non-polyfill instance of newMediaKeys"),
|
|
2516
2516
|
a.setMedia(this);return Promise.resolve()};shaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_=function(){var a=document.getElementsByTagName("video");return a.length?a[0]:document.createElement("video")};goog.exportProperty(shaka.polyfill,"PatchedMediaKeysWebkit",shaka.polyfill.PatchedMediaKeysWebkit);goog.exportProperty(shaka.polyfill.PatchedMediaKeysWebkit,"install",shaka.polyfill.PatchedMediaKeysWebkit.install);
|
|
@@ -2539,11 +2539,11 @@ shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_=function
|
|
|
2539
2539
|
this.updatePromise_=null);f=e.fromBase64(g.keys[0].k);e=e.fromBase64(g.keys[0].kid)}else f=shaka.util.BufferUtils.toUint8(b),e=null;d=d.prefixApi_("addKey");try{this.media_[d](this.keySystem_,f,e,this.sessionId)}catch(h){this.updatePromise_.reject(h),this.updatePromise_=null}}};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.updateKeyStatus_=function(a){this.keyStatuses.setStatus(a);a=new shaka.util.FakeEvent("keystatuseschange");this.dispatchEvent(a)};
|
|
2540
2540
|
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generateRequest=function(a,b){shaka.log.debug("PatchedMediaKeysWebkit.MediaKeySession.generateRequest");return this.generate_(b,null)};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load=function(a){shaka.log.debug("PatchedMediaKeysWebkit.MediaKeySession.load");return"persistent-license"==this.type_?this.generate_(null,a):Promise.reject(Error("Not a persistent session."))};
|
|
2541
2541
|
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update=function(a){shaka.log.debug("PatchedMediaKeysWebkit.MediaKeySession.update",a);goog.asserts.assert(this.sessionId,"update without session ID");var b=new shaka.util.PublicPromise;this.update_(b,a);return b};
|
|
2542
|
-
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close=function(){var a=shaka.polyfill.PatchedMediaKeysWebkit;shaka.log.debug("PatchedMediaKeysWebkit.MediaKeySession.close");if("persistent-license"!=this.type_){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;a=a.prefixApi_("cancelKeyRequest");try{this.media_[a](this.keySystem_,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed};
|
|
2542
|
+
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close=function(){var a=shaka.polyfill.PatchedMediaKeysWebkit;shaka.log.debug("PatchedMediaKeysWebkit.MediaKeySession.close");if("persistent-license"!=this.type_){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;a=a.prefixApi_("cancelKeyRequest");try{this.media_[a](this.keySystem_,this.sessionId)}catch(b){shaka.log.debug(a+" exception",b)}}this.closed.resolve();return this.closed};
|
|
2543
2543
|
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove=function(){shaka.log.debug("PatchedMediaKeysWebkit.MediaKeySession.remove");return"persistent-license"!=this.type_?Promise.reject(Error("Not a persistent session.")):this.close()};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap=function(){this.size=0;this.status_=void 0};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus=function(a){this.size=void 0==a?0:1;this.status_=a};
|
|
2544
2544
|
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus=function(){return this.status_};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach=function(a){this.status_&&a(this.status_,shaka.media.DrmEngine.DUMMY_KEY_ID.value())};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get=function(a){if(this.has(a))return this.status_};
|
|
2545
2545
|
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has=function(a){var b=shaka.media.DrmEngine.DUMMY_KEY_ID.value();return this.status_&&shaka.util.BufferUtils.equal(a,b)?!0:!1};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.entries=function(){goog.asserts.assert(!1,"Not used! Provided only for compiler.")};shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.keys=function(){goog.asserts.assert(!1,"Not used! Provided only for compiler.")};
|
|
2546
|
-
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for compiler.")};shaka.polyfill.PatchedMediaKeysWebkit.prefix_="";shaka.polyfill.register(shaka.polyfill.PatchedMediaKeysWebkit.install);shaka.polyfill.PiPWebkit=function(){};
|
|
2546
|
+
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for compiler.")};shaka.polyfill.PatchedMediaKeysWebkit.prefix_="";shaka.polyfill.PatchedMediaKeysWebkit.apiName_="webkit";shaka.polyfill.register(shaka.polyfill.PatchedMediaKeysWebkit.install);shaka.polyfill.PiPWebkit=function(){};
|
|
2547
2547
|
shaka.polyfill.PiPWebkit.install=function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;if((!a.requestPictureInPicture||!document.exitPictureInPicture)&&a.webkitSupportsPresentationMode){var b=shaka.polyfill.PiPWebkit;shaka.log.debug("PiPWebkit.install");document.pictureInPictureEnabled=!0;document.pictureInPictureElement=null;a.requestPictureInPicture=b.requestPictureInPicture_;Object.defineProperty(a,"disablePictureInPicture",{get:b.getDisablePictureInPicture_,set:b.setDisablePictureInPicture_,
|
|
2548
2548
|
enumerable:!0,configurable:!0});document.exitPictureInPicture=b.exitPictureInPicture_;document.addEventListener("webkitpresentationmodechanged",b.proxyEvent_,!0)}}};
|
|
2549
2549
|
shaka.polyfill.PiPWebkit.proxyEvent_=function(a){a=a.target;if(a.webkitPresentationMode==shaka.polyfill.PiPWebkit.PIP_MODE_){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement==a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)};
|