shaka-player 4.6.9 → 4.6.11
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/.github/ISSUE_TEMPLATE/question.md +7 -0
- package/AUTHORS +1 -0
- package/CHANGELOG.md +20 -0
- package/CONTRIBUTORS +1 -0
- package/demo/config.js +1 -1
- package/dist/demo.compiled.debug.js +1 -1
- package/dist/demo.compiled.js +1 -1
- package/dist/locales.js +30 -30
- 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.externs.js +2 -1
- package/dist/shaka-player.compiled.debug.js +31 -30
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +2 -1
- package/dist/shaka-player.compiled.js +1047 -1045
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +13 -2
- package/dist/shaka-player.ui.debug.d.ts +13 -2
- package/dist/shaka-player.ui.debug.externs.js +3 -1
- package/dist/shaka-player.ui.debug.js +39 -39
- package/dist/shaka-player.ui.debug.map +2 -2
- package/dist/shaka-player.ui.externs.js +3 -1
- package/dist/shaka-player.ui.js +1160 -1158
- package/dist/shaka-player.ui.map +3 -3
- package/lib/media/drm_engine.js +9 -0
- package/lib/offline/storage.js +4 -0
- package/lib/player.js +18 -5
- package/lib/polyfill/media_capabilities.js +9 -2
- package/lib/util/platform.js +18 -0
- package/lib/util/stream_utils.js +14 -0
- package/lib/util/ts_parser.js +7 -4
- package/package.json +1 -1
- package/test/player_unit.js +19 -4
- package/test/polyfill/media_capabilities_unit.js +12 -6
- package/test/test/util/fake_drm_engine.js +7 -0
- package/ui/controls.js +3 -0
- package/ui/externs/ui.js +24 -0
- package/ui/pip_button.js +5 -21
- package/ui/play_button.js +3 -0
- /package/.github/{config.yml → ISSUE_TEMPLATE/config.yml} +0 -0
|
@@ -2980,9 +2980,12 @@ declare namespace shaka.ui {
|
|
|
2980
2980
|
}
|
|
2981
2981
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.externs.js
|
|
2982
2982
|
declare namespace shaka.ui {
|
|
2983
|
-
class PlayButton extends shaka.ui.Element {
|
|
2983
|
+
class PlayButton extends shaka.ui.Element implements shaka.extern.IUIPlayButton {
|
|
2984
2984
|
private noStructuralTyping_shaka_ui_PlayButton : any;
|
|
2985
2985
|
constructor (parent : HTMLElement , controls : shaka.ui.Controls ) ;
|
|
2986
|
+
button : HTMLButtonElement ;
|
|
2987
|
+
isEnded ( ) : boolean ;
|
|
2988
|
+
isPaused ( ) : boolean ;
|
|
2986
2989
|
}
|
|
2987
2990
|
}
|
|
2988
2991
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.externs.js
|
|
@@ -4049,7 +4052,7 @@ declare namespace shaka.util {
|
|
|
4049
4052
|
* The code is based on hls.js
|
|
4050
4053
|
* Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
|
|
4051
4054
|
*/
|
|
4052
|
-
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null ) : shaka.extern.VideoNalu [] ;
|
|
4055
|
+
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null , lastState ? : number | null ) : shaka.extern.VideoNalu [] ;
|
|
4053
4056
|
static Timescale : number ;
|
|
4054
4057
|
/**
|
|
4055
4058
|
* Check if the passed data corresponds to an MPEG2-TS
|
|
@@ -5744,6 +5747,14 @@ declare namespace shaka.extern.IUIElement {
|
|
|
5744
5747
|
}
|
|
5745
5748
|
}
|
|
5746
5749
|
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5750
|
+
declare namespace shaka.extern {
|
|
5751
|
+
interface IUIPlayButton {
|
|
5752
|
+
button : HTMLButtonElement ;
|
|
5753
|
+
isEnded ( ) : boolean ;
|
|
5754
|
+
isPaused ( ) : boolean ;
|
|
5755
|
+
}
|
|
5756
|
+
}
|
|
5757
|
+
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5747
5758
|
declare namespace shaka.extern {
|
|
5748
5759
|
/**
|
|
5749
5760
|
* Interface for UI range elements. UI range elements should inherit from the
|
|
@@ -2980,9 +2980,12 @@ declare namespace shaka.ui {
|
|
|
2980
2980
|
}
|
|
2981
2981
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
|
|
2982
2982
|
declare namespace shaka.ui {
|
|
2983
|
-
class PlayButton extends shaka.ui.Element {
|
|
2983
|
+
class PlayButton extends shaka.ui.Element implements shaka.extern.IUIPlayButton {
|
|
2984
2984
|
private noStructuralTyping_shaka_ui_PlayButton : any;
|
|
2985
2985
|
constructor (parent : HTMLElement , controls : shaka.ui.Controls ) ;
|
|
2986
|
+
button : HTMLButtonElement ;
|
|
2987
|
+
isEnded ( ) : boolean ;
|
|
2988
|
+
isPaused ( ) : boolean ;
|
|
2986
2989
|
}
|
|
2987
2990
|
}
|
|
2988
2991
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
|
|
@@ -4049,7 +4052,7 @@ declare namespace shaka.util {
|
|
|
4049
4052
|
* The code is based on hls.js
|
|
4050
4053
|
* Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
|
|
4051
4054
|
*/
|
|
4052
|
-
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null ) : shaka.extern.VideoNalu [] ;
|
|
4055
|
+
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null , lastState ? : number | null ) : shaka.extern.VideoNalu [] ;
|
|
4053
4056
|
static Timescale : number ;
|
|
4054
4057
|
/**
|
|
4055
4058
|
* Check if the passed data corresponds to an MPEG2-TS
|
|
@@ -5744,6 +5747,14 @@ declare namespace shaka.extern.IUIElement {
|
|
|
5744
5747
|
}
|
|
5745
5748
|
}
|
|
5746
5749
|
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5750
|
+
declare namespace shaka.extern {
|
|
5751
|
+
interface IUIPlayButton {
|
|
5752
|
+
button : HTMLButtonElement ;
|
|
5753
|
+
isEnded ( ) : boolean ;
|
|
5754
|
+
isPaused ( ) : boolean ;
|
|
5755
|
+
}
|
|
5756
|
+
}
|
|
5757
|
+
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5747
5758
|
declare namespace shaka.extern {
|
|
5748
5759
|
/**
|
|
5749
5760
|
* Interface for UI range elements. UI range elements should inherit from the
|
|
@@ -2346,9 +2346,10 @@ shaka.util.TsParser = class {
|
|
|
2346
2346
|
* Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
|
|
2347
2347
|
* @param {shaka.extern.MPEG_PES} pes
|
|
2348
2348
|
* @param {?shaka.extern.VideoNalu=} lastNalu
|
|
2349
|
+
* @param {?number=} lastState
|
|
2349
2350
|
* @return {!Array.<shaka.extern.VideoNalu>}
|
|
2350
2351
|
*/
|
|
2351
|
-
parseNalus(pes, lastNalu) {}
|
|
2352
|
+
parseNalus(pes, lastNalu, lastState) {}
|
|
2352
2353
|
/**
|
|
2353
2354
|
* Return the ID3 metadata
|
|
2354
2355
|
* @return {!Array.<shaka.extern.ID3Metadata>}
|
|
@@ -5558,6 +5559,7 @@ shaka.ui.AdPosition = class extends shaka.ui.Element {
|
|
|
5558
5559
|
};
|
|
5559
5560
|
/**
|
|
5560
5561
|
* @extends {shaka.ui.Element}
|
|
5562
|
+
* @implements {shaka.extern.IUIPlayButton}
|
|
5561
5563
|
*/
|
|
5562
5564
|
shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
5563
5565
|
/**
|
|
@@ -282,9 +282,9 @@ new Map([["AD_DURATION","\uad11\uace0 \uae30\uac04"],["AD_PROGRESS","\uad11\uace
|
|
|
282
282
|
"\u5ee3\u544a [AD_ON]/[NUM_ADS]"],["AD_TIME","\u5ee3\u544a\uff1a[AD_TIME]"],["AUTO_QUALITY","\u81ea\u52d5"],["BACK","\u8fd4\u56de"],["CAPTIONS","\u5b57\u5e55"],["CAST","\u6295\u653e..."],["ENTER_LOOP_MODE","\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["ENTER_PICTURE_IN_PICTURE","\u9032\u5165\u5b50\u6bcd\u756b\u9762"],["EXIT_FULL_SCREEN","\u9000\u51fa\u5168\u87a2\u5e55\u6a21\u5f0f"],["EXIT_LOOP_MODE","\u505c\u6b62\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["EXIT_PICTURE_IN_PICTURE",
|
|
283
283
|
"\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN","\u5168\u87a2\u5e55"],["LANGUAGE","\u8a9e\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u74b0\u64ad\u653e"],["MORE_SETTINGS","\u986f\u793a\u66f4\u591a\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u7a2e\u8a9e\u8a00"],["MUTE","\u975c\u97f3"],["NOT_APPLICABLE","\u4e0d\u9069\u7528"],["OFF","\u95dc\u9589"],["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],
|
|
284
284
|
["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["RESOLUTION","\u89e3\u6790\u5ea6"],["REWIND","\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]))};
|
|
285
|
-
shaka.ui.Locales.Ids={SURROUND:"SURROUND",
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
shaka.ui.Locales.Ids={SURROUND:"SURROUND",FAST_FORWARD:"FAST_FORWARD",ON:"ON",LIVE:"LIVE",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",PLAY:"PLAY",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",NOT_APPLICABLE:"NOT_APPLICABLE",SKIP_AD:"SKIP_AD",MORE_SETTINGS:"MORE_SETTINGS",MUTE:"MUTE",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",AUTO_QUALITY:"AUTO_QUALITY",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",BACK:"BACK",PAUSE:"PAUSE",REWIND:"REWIND",LANGUAGE:"LANGUAGE",
|
|
286
|
+
SKIP_TO_LIVE:"SKIP_TO_LIVE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",OFF:"OFF",AD_TIME:"AD_TIME",SEEK:"SEEK",FULL_SCREEN:"FULL_SCREEN",CAST:"CAST",AD_PROGRESS:"AD_PROGRESS",CAPTIONS:"CAPTIONS",VOLUME:"VOLUME",RESOLUTION:"RESOLUTION",UNMUTE:"UNMUTE",AIRPLAY:"AIRPLAY",STATISTICS:"STATISTICS",QUALITY:"QUALITY",REPLAY:"REPLAY",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",AD_DURATION:"AD_DURATION",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",SUBTITLE_FORCED:"SUBTITLE_FORCED",PLAYBACK_RATE:"PLAYBACK_RATE",
|
|
287
|
+
LOOP:"LOOP"};shaka.abr={};shaka.abr.Ewma=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a);this.totalWeight_=this.estimate_=0};shaka.abr.Ewma.prototype.updateAlpha=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a)};shaka.abr.Ewma.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);b=b*(1-c)+c*this.estimate_;isNaN(b)||(this.estimate_=b,this.totalWeight_+=a)};
|
|
288
288
|
shaka.abr.Ewma.prototype.getEstimate=function(){return this.estimate_/(1-Math.pow(this.alpha_,this.totalWeight_))};shaka.abr.EwmaBandwidthEstimator=function(){this.fast_=new shaka.abr.Ewma(2);this.slow_=new shaka.abr.Ewma(5);this.bytesSampled_=0;this.minTotalBytes_=128E3;this.minBytes_=16E3};shaka.abr.EwmaBandwidthEstimator.prototype.configure=function(a){this.minTotalBytes_=a.minTotalBytes;this.minBytes_=a.minBytes;this.fast_.updateAlpha(a.fastHalfLife);this.slow_.updateAlpha(a.slowHalfLife)};
|
|
289
289
|
shaka.abr.EwmaBandwidthEstimator.prototype.sample=function(a,b){if(!(b<this.minBytes_)){var c=8E3*b/a;a/=1E3;this.bytesSampled_+=b;this.fast_.sample(a,c);this.slow_.sample(a,c)}};shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate=function(a){return this.bytesSampled_<this.minTotalBytes_?a:Math.min(this.fast_.getEstimate(),this.slow_.getEstimate())};shaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate=function(){return this.bytesSampled_>=this.minTotalBytes_};shaka.media={};shaka.media.Capabilities=function(){};shaka.media.Capabilities.isTypeSupported=function(a){var b=shaka.media.Capabilities.MediaSourceTypeSupportMap;if(b.has(a))return b.get(a);if(window.ManagedMediaSource){var c=ManagedMediaSource.isTypeSupported(a);b.set(a,c);return c}return window.MediaSource?(c=MediaSource.isTypeSupported(a),b.set(a,c),c):!1};shaka.media.Capabilities.isChangeTypeSupported=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};
|
|
290
290
|
shaka.media.Capabilities.MediaSourceTypeSupportMap=new Map;shaka.cea={};shaka.cea.DummyCaptionDecoder=function(){};shaka.cea.DummyCaptionDecoder.prototype.extract=function(a,b){};shaka.cea.DummyCaptionDecoder.prototype.decode=function(){return[]};shaka.cea.DummyCaptionDecoder.prototype.clear=function(){};shaka.cea.DummyCaptionDecoder.prototype.getStreams=function(){return[]};shaka.cea.DummyCeaParser=function(){};shaka.cea.DummyCeaParser.prototype.init=function(a){};shaka.cea.DummyCeaParser.prototype.parse=function(a){return[]};shaka.util.BufferUtils=function(){};shaka.util.BufferUtils.equal=function(a,b){var c=shaka.util.BufferUtils;if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(c.unsafeGetArrayBuffer_(a)==c.unsafeGetArrayBuffer_(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;c=shaka.util.BufferUtils.toUint8(a);b=shaka.util.BufferUtils.toUint8(b);for(var d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0};
|
|
@@ -342,12 +342,12 @@ shaka.util.Timer.prototype.tickEvery=function(a){var b=this;this.stop();goog.DEB
|
|
|
342
342
|
goog.exportProperty(shaka.util.Timer.prototype,"stop",shaka.util.Timer.prototype.stop);goog.exportProperty(shaka.util.Timer.prototype,"tickEvery",shaka.util.Timer.prototype.tickEvery);goog.exportProperty(shaka.util.Timer.prototype,"tickAfter",shaka.util.Timer.prototype.tickAfter);goog.exportProperty(shaka.util.Timer.prototype,"tickNow",shaka.util.Timer.prototype.tickNow);goog.DEBUG&&(shaka.util.Timer.activeTimers=new Map);shaka.util.Platform=function(){};shaka.util.Platform.supportsMediaSource=function(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1};shaka.util.Platform.supportsMediaType=function(a){return""!=shaka.util.Platform.anyMediaElement().canPlayType(a)};shaka.util.Platform.isEdge=function(){return navigator.userAgent.match(/Edge?\//)?!0:!1};shaka.util.Platform.isLegacyEdge=function(){return navigator.userAgent.match(/Edge\//)?!0:!1};shaka.util.Platform.isIE=function(){return shaka.util.Platform.userAgentContains_("Trident/")};
|
|
343
343
|
shaka.util.Platform.isXboxOne=function(){return shaka.util.Platform.userAgentContains_("Xbox One")};shaka.util.Platform.isTizen=function(){return shaka.util.Platform.userAgentContains_("Tizen")};shaka.util.Platform.isTizen4=function(){return shaka.util.Platform.userAgentContains_("Tizen 4")};shaka.util.Platform.isTizen3=function(){return shaka.util.Platform.userAgentContains_("Tizen 3")};shaka.util.Platform.isTizen2=function(){return shaka.util.Platform.userAgentContains_("Tizen 2")};
|
|
344
344
|
shaka.util.Platform.isWebOS=function(){return shaka.util.Platform.userAgentContains_("Web0S")};shaka.util.Platform.isWebOS3=function(){return shaka.util.Platform.userAgentContains_("Web0S")&&shaka.util.Platform.userAgentContains_("Chrome/38.0.2125.122 Safari/537.36")};shaka.util.Platform.isWebOS4=function(){return!!navigator.userAgent.match(/webOS\/4/i)};shaka.util.Platform.isWebOS5=function(){return!!navigator.userAgent.match(/webOS\/5/i)};shaka.util.Platform.isChromecast=function(){return shaka.util.Platform.userAgentContains_("CrKey")};
|
|
345
|
-
shaka.util.Platform.chromeVersion=function(){if(!shaka.util.Platform.isChrome())return null;var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null};shaka.util.Platform.isChrome=function(){return shaka.util.Platform.userAgentContains_("Chrome")&&!shaka.util.Platform.isLegacyEdge()};
|
|
345
|
+
shaka.util.Platform.chromeVersion=function(){if(!shaka.util.Platform.isChrome())return null;var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null};shaka.util.Platform.isChrome=function(){return shaka.util.Platform.userAgentContains_("Chrome")&&!shaka.util.Platform.isLegacyEdge()};shaka.util.Platform.isFirefox=function(){return shaka.util.Platform.userAgentContains_("Firefox")};
|
|
346
346
|
shaka.util.Platform.isApple=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!shaka.util.Platform.isTizen()&&!shaka.util.Platform.isEOS()&&!shaka.util.Platform.isAPL()&&!shaka.util.Platform.isVirginMedia()&&!shaka.util.Platform.isOrange()&&!shaka.util.Platform.isPS4()&&!shaka.util.Platform.isAmazonFireTV()&&!shaka.util.Platform.isWPE()};shaka.util.Platform.isPS5=function(){return shaka.util.Platform.userAgentContains_("PlayStation 5")};shaka.util.Platform.isPS4=function(){return shaka.util.Platform.userAgentContains_("PlayStation 4")};
|
|
347
347
|
shaka.util.Platform.isHisense=function(){return shaka.util.Platform.userAgentContains_("Hisense")||shaka.util.Platform.userAgentContains_("VIDAA")};shaka.util.Platform.isVirginMedia=function(){return shaka.util.Platform.userAgentContains_("VirginMedia")};shaka.util.Platform.isOrange=function(){return shaka.util.Platform.userAgentContains_("SOPOpenBrowser")};shaka.util.Platform.isAmazonFireTV=function(){return shaka.util.Platform.userAgentContains_("AFT")};shaka.util.Platform.isWPE=function(){return shaka.util.Platform.userAgentContains_("WPE")};
|
|
348
348
|
shaka.util.Platform.safariVersion=function(){if(!shaka.util.Platform.isApple())return null;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null};shaka.util.Platform.isSafari=function(){return!!shaka.util.Platform.safariVersion()};shaka.util.Platform.isEOS=function(){return shaka.util.Platform.userAgentContains_("PC=EOS")};shaka.util.Platform.isAPL=function(){return shaka.util.Platform.userAgentContains_("PC=APL")};
|
|
349
349
|
shaka.util.Platform.isMobile=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:shaka.util.Platform.isApple()&&1<navigator.maxTouchPoints};shaka.util.Platform.isMac=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"macos"==navigator.userAgentData.platform.toLowerCase():navigator.platform.toLowerCase().includes("mac")};
|
|
350
|
-
shaka.util.Platform.isWindows=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():navigator.platform.toLowerCase().includes("windows")};shaka.util.Platform.userAgentContains_=function(a){return(navigator.userAgent||"").includes(a)};
|
|
350
|
+
shaka.util.Platform.isWindows=function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():navigator.platform.toLowerCase().includes("windows")};shaka.util.Platform.isAndroid=function(){return shaka.util.Platform.userAgentContains_("Android")};shaka.util.Platform.userAgentContains_=function(a){return(navigator.userAgent||"").includes(a)};
|
|
351
351
|
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_};
|
|
352
352
|
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};shaka.util.Platform.supportsSmoothCodecSwitching=function(){var a=shaka.util.Platform;return a.isTizen2()||a.isTizen3()||a.isTizen4()||a.isWebOS3()||a.isWebOS4()||a.isWebOS5()?!1:!0};
|
|
353
353
|
shaka.util.Platform.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill?!0:!1};shaka.util.Platform.cacheExpirationTimer_=null;shaka.util.Platform.cachedMediaElement_=null;shaka.util.StreamUtils=function(){};
|
|
@@ -361,10 +361,10 @@ b=c.next())if(d.$jscomp$loop$prop$audioCodec$840=b.value,b=a.filter(function(f){
|
|
|
361
361
|
shaka.util.StreamUtils.meetsRestrictions=function(a,b,c){var d=function(f,g,h){return f>=g&&f<=h},e=a.video;return e&&e.width&&e.height&&(!d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))||!d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))||a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0};
|
|
362
362
|
shaka.util.StreamUtils.applyRestrictions=function(a,b,c){var d=!1;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=shaka.util.StreamUtils.meetsRestrictions(e,b,c);f!=e.allowedByApplication&&(d=!0)}return d};
|
|
363
363
|
shaka.util.StreamUtils.filterManifest=function(a,b){return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return c.yield(shaka.util.StreamUtils.filterManifestByMediaCapabilities(a,b,0<b.offlineSessionIds.length),2);shaka.util.StreamUtils.filterTextStreams_(b);return c.yield(shaka.util.StreamUtils.filterImageStreams_(b),0)})};
|
|
364
|
-
shaka.util.StreamUtils.filterManifestByMediaCapabilities=function(a,b,c){var d,e,f,g,h,k,l,m;return $jscomp.asyncExecutePromiseGeneratorProgram(function(
|
|
365
|
-
k=shaka.util.MimeUtils;l=shaka.util.StreamUtils;m=shaka.util.Platform.isXboxOne();b.variants=b.variants.filter(function(
|
|
366
|
-
t=h.guessCodecs(f.
|
|
367
|
-
shaka.log.debug("Dropping variant - not compatible with platform",l.getVariantSummaryString_(
|
|
364
|
+
shaka.util.StreamUtils.filterManifestByMediaCapabilities=function(a,b,c){var d,e,f,g,h,k,l,m,n;return $jscomp.asyncExecutePromiseGeneratorProgram(function(p){if(1==p.nextAddress)return goog.asserts.assert(navigator.mediaCapabilities,"MediaCapabilities should be valid."),p.yield(shaka.util.StreamUtils.getDecodingInfosForVariants(b.variants,c,!1,[]),2);d=null;a&&(e=a.getDrmInfo())&&(d=e.keySystem);f=shaka.util.ManifestParserUtils.ContentType;g=shaka.media.Capabilities;h=shaka.util.ManifestParserUtils;
|
|
365
|
+
k=shaka.util.MimeUtils;l=shaka.util.StreamUtils;m=shaka.util.Platform.isXboxOne();n=shaka.util.Platform.isFirefox()&&shaka.util.Platform.isAndroid();b.variants=b.variants.filter(function(q){var r=q.video,t=r&&r.width||0,w=r&&r.height||0;if(m&&r&&(1920<t||1080<w)&&(r.codecs.includes("avc1.")||r.codecs.includes("avc3.")))return shaka.log.debug("Dropping variant - not compatible with platform",l.getVariantSummaryString_(q)),!1;if(r){t=l.getCorrectVideoCodecs_(r.codecs);if(r.codecs.includes(",")){w=r.codecs.split(",");
|
|
366
|
+
t=h.guessCodecs(f.VIDEO,w);t=l.getCorrectVideoCodecs_(t);w=h.guessCodecs(f.AUDIO,w);w=l.getCorrectAudioCodecs_(w);var u=k.getFullOrConvertedType(r.mimeType,w,f.AUDIO);if(!g.isTypeSupported(u))return!1;t=[t,w].join()}w=k.getFullOrConvertedType(r.mimeType,t,f.VIDEO);if(!g.isTypeSupported(w))return!1;r.codecs=t}r=q.audio;if(n&&r&&r.encrypted&&r.codecs.toLowerCase().includes("opus"))return shaka.log.debug("Dropping variant - not compatible with platform",l.getVariantSummaryString_(q)),!1;if(r){t=l.getCorrectAudioCodecs_(r.codecs);
|
|
367
|
+
w=k.getFullOrConvertedType(r.mimeType,t,f.AUDIO);if(!g.isTypeSupported(w))return!1;r.codecs=t}(r=q.decodingInfos.some(function(v){return!v.supported||d&&(v=v.keySystemAccess)&&v.keySystem!=d?!1:!0}))||shaka.log.debug("Dropping variant - not compatible with platform",l.getVariantSummaryString_(q));return r});p.jumpToEnd()})};
|
|
368
368
|
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(",")+"}"};
|
|
369
369
|
shaka.util.StreamUtils.getDecodingInfosForVariant_=function(a,b){var c,d,e,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){switch(g.nextAddress){case 1:c=shaka.util.StreamUtils.alphabeticalKeyOrderStringify_(b);g.setCatchFinallyBlocks(2);d=shaka.util.StreamUtils.decodingConfigCache_;if(d[c]){shaka.log.v2("Using cached results of mediaCapabilities.decodingInfo","for key",c);a.decodingInfos.push(d[c]);g.jumpTo(4);break}return g.yield(navigator.mediaCapabilities.decodingInfo(b),5);case 5:e=
|
|
370
370
|
g.yieldResult,d[c]=e,a.decodingInfos.push(e);case 4:g.leaveTryBlock(0);break;case 2:f=g.enterCatchBlock(),shaka.log.info("MediaCapabilities.decodingInfo() failed.",JSON.stringify(b),f),g.jumpToEnd()}})};
|
|
@@ -549,7 +549,7 @@ break;case 4:b=c.enterCatchBlock(),goog.asserts.assert(b instanceof Error,"Wrong
|
|
|
549
549
|
shaka.media.DrmEngine.prototype.onEncryptedEvent_=function(a){var b=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return c.yield(b.attachMediaKeys_(),2);b.newInitData(a.initDataType,shaka.util.BufferUtils.toUint8(a.initData));c.jumpToEnd()})};
|
|
550
550
|
shaka.media.DrmEngine.prototype.attach=function(a){var b=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress){if(!b.mediaKeys_)return b.eventManager_.listenOnce(a,"encrypted",function(d){b.onError_(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO))}),c.return();b.video_=a;b.eventManager_.listenOnce(b.video_,"play",function(){return b.onPlay_()});"webkitCurrentPlaybackTargetIsWireless"in
|
|
551
551
|
b.video_&&b.eventManager_.listen(b.video_,"webkitcurrentplaybacktargetiswirelesschanged",function(){return b.closeOpenSessions_()});b.manifestInitData_=b.currentDrmInfo_?b.currentDrmInfo_.initData.find(function(d){return 0<d.initData.length})||null:null;return b.manifestInitData_||"com.apple.fps"!==b.currentDrmInfo_.keySystem||b.storedPersistentSessions_.size?c.yield(b.attachMediaKeys_(),2):c.jumpTo(2)}b.createOrLoad().catch(function(){});b.manifestInitData_||b.storedPersistentSessions_.size||b.config_.parseInbandPsshEnabled||
|
|
552
|
-
b.eventManager_.listen(b.video_,"encrypted",function(d){return b.onEncryptedEvent_(d)});c.jumpToEnd()})};
|
|
552
|
+
b.eventManager_.listen(b.video_,"encrypted",function(d){return b.onEncryptedEvent_(d)});c.jumpToEnd()})};shaka.media.DrmEngine.prototype.hasManifestInitData=function(){return!!this.manifestInitData_};
|
|
553
553
|
shaka.media.DrmEngine.prototype.setServerCertificate=function(){var a=this,b,c,d,e,f,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){switch(h.nextAddress){case 1:goog.asserts.assert(a.initialized_,"Must call init() before setServerCertificate");if(!a.mediaKeys_||!a.currentDrmInfo_)return h.return();if(!a.currentDrmInfo_.serverCertificateUri||a.currentDrmInfo_.serverCertificate&&a.currentDrmInfo_.serverCertificate.length){h.jumpTo(2);break}b=shaka.net.NetworkingEngine.makeRequest([a.currentDrmInfo_.serverCertificateUri],
|
|
554
554
|
a.config_.retryParameters);h.setCatchFinallyBlocks(3);c=a.playerInterface_.netEngine.request(shaka.net.NetworkingEngine.RequestType.SERVER_CERTIFICATE,b);return h.yield(c.promise,5);case 5:d=h.yieldResult;a.currentDrmInfo_.serverCertificate=shaka.util.BufferUtils.toUint8(d.data);h.leaveTryBlock(4);break;case 3:throw e=h.enterCatchBlock(),goog.asserts.assert(e instanceof shaka.util.Error,"Wrong NetworkingEngine error type!"),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.DRM,
|
|
555
555
|
shaka.util.Error.Code.SERVER_CERTIFICATE_REQUEST_FAILED,e);case 4:if(a.destroyer_.destroyed())return h.return();case 2:if(!a.currentDrmInfo_.serverCertificate||!a.currentDrmInfo_.serverCertificate.length)return h.return();h.setCatchFinallyBlocks(6);return h.yield(a.mediaKeys_.setServerCertificate(a.currentDrmInfo_.serverCertificate),8);case 8:(f=h.yieldResult)||shaka.log.warning("Server certificates are not supported by the key system. The server certificate has been ignored.");h.leaveTryBlock(0);
|
|
@@ -712,14 +712,14 @@ shaka.util.TsParser.prototype.parsePMT_=function(a,b){var c={audio:-1,video:-1,i
|
|
|
712
712
|
c.id3&&(c.id3=e);break;case 27:-1==c.video&&(c.video=e,c.videoCodec="avc");break;case 3:case 4:-1==c.audio&&(c.audio=e,c.audioCodec="mp3");break;case 36:-1==c.video&&(c.video=e,c.videoCodec="hvc");break;case 129:-1==c.audio&&(c.audio=e,c.audioCodec="ac3");break;case 132:case 135:-1==c.audio&&(c.audio=e,c.audioCodec="ec3")}b+=f+5}return c};
|
|
713
713
|
shaka.util.TsParser.prototype.parsePES_=function(a){if(1!==(a[0]<<16|a[1]<<8|a[2]))return null;var b={data:new Uint8Array(0),packetLength:a[4]<<8|a[5],pts:null,dts:null,nalus:[]};if(b.packetLength&&b.packetLength>a.byteLength-6)return null;var c=a[7];c&192&&(b.pts=536870912*(a[9]&14)+4194304*(a[10]&255)+16384*(a[11]&254)+128*(a[12]&255)+(a[13]&254)/2,b.dts=b.pts,c&64&&(b.dts=536870912*(a[14]&14)+4194304*(a[15]&255)+16384*(a[16]&254)+128*(a[17]&255)+(a[18]&254)/2));c=a[8]+9;if(a.byteLength<=c)return null;
|
|
714
714
|
b.data=a.subarray(c);return b};shaka.util.TsParser.prototype.parseAvcNalus=function(a,b){shaka.Deprecate.deprecateFeature(5,"TsParser","Please use parseNalus function instead.");return this.parseNalus(a)};
|
|
715
|
-
shaka.util.TsParser.prototype.parseNalus=function(a,b){var
|
|
716
|
-
time:
|
|
717
|
-
shaka.util.Uint8ArrayUtils.concat(b.fullData,a));return
|
|
715
|
+
shaka.util.TsParser.prototype.parseNalus=function(a,b,c){var d=shaka.util.TsParser.Timescale;d=a.pts?a.pts/d:null;a=a.data;var e=a.byteLength,f=1;"hvc"==this.videoCodec_&&(f=2);for(var g=c||0,h=[],k=-1,l=0,m,n=0;n<e;++n){var p=a[n];if(p){if(2<=g&&1==p){b&&!h.length&&-1==k&&(p=n-(3<g?3:g),c&&0!=p&&(p=a.subarray(0,p),b.data=shaka.util.Uint8ArrayUtils.concat(b.data,p),b.fullData=shaka.util.Uint8ArrayUtils.concat(b.fullData,p)));0<=k?(g=n-((3<g?3:g)+1),k={data:a.subarray(k+f,g+1),fullData:a.subarray(k,
|
|
716
|
+
g+1),type:l,time:d},h.push(k)):b&&!h.length&&(k=n-g,0<k&&(k=a.subarray(0,k),b.data=shaka.util.Uint8ArrayUtils.concat(b.data,k),b.fullData=shaka.util.Uint8ArrayUtils.concat(b.fullData,k)));if(n>=e-f)return shaka.log.warning("Malformed TS, incomplete NALU, ignoring."),h;n++;k=n;l="hvc"==this.videoCodec_?a[n]>>1&63:a[n]&31}g=0}else g++;n>=e-1&&0<=k&&0<=g&&(m={data:a.subarray(k+f,e),fullData:a.subarray(k,e),type:l,time:d})}m&&h.push(m);!h.length&&b&&(b.data=shaka.util.Uint8ArrayUtils.concat(b.data,a),
|
|
717
|
+
b.fullData=shaka.util.Uint8ArrayUtils.concat(b.fullData,a));return h};shaka.util.TsParser.prototype.getMetadata=function(){for(var a=shaka.util.TsParser.Timescale,b=[],c=$jscomp.makeIterator(this.id3Data_),d=c.next();!d.done;d=c.next())d=shaka.util.Uint8ArrayUtils.concat.apply(shaka.util.Uint8ArrayUtils,$jscomp.arrayFromIterable(d.value)),(d=this.parsePES_(d))&&b.push({cueTime:d.pts?d.pts/a:null,data:d.data,frames:shaka.util.Id3Utils.getID3Frames(d.data),dts:d.dts,pts:d.pts});return b};
|
|
718
718
|
shaka.util.TsParser.prototype.getAudioData=function(){if(this.audioData_.length&&!this.audioPes_.length){for(var a=!1,b=$jscomp.makeIterator(this.audioData_),c=b.next();!c.done;c=b.next()){var d=shaka.util.Uint8ArrayUtils.concat.apply(shaka.util.Uint8ArrayUtils,$jscomp.arrayFromIterable(c.value)),e=this.parsePES_(d);c=this.audioPes_.length?this.audioPes_[this.audioPes_.length-1]:null;e&&null!=e.pts&&null!=e.dts&&(!c||c.pts!=e.pts&&c.dts!=e.dts)?(this.audioPes_.length&&e.dts<(c.dts||0)&&(a=!0),this.audioPes_.push(e)):
|
|
719
719
|
this.audioPes_.length&&(d=e?e.data:d)&&(c=this.audioPes_.pop(),c.data=shaka.util.Uint8ArrayUtils.concat(c.data,d),this.audioPes_.push(c))}a&&(this.audioPes_=this.audioPes_.sort(function(f,g){var h=(f.pts||0)-(g.pts||0);return(f.dts||0)-(g.dts||0)||h}))}return this.audioPes_};
|
|
720
720
|
shaka.util.TsParser.prototype.getVideoData=function(a){a=void 0===a?!0:a;if(this.videoData_.length&&!this.videoPes_.length){for(var b=!1,c=$jscomp.makeIterator(this.videoData_),d=c.next();!d.done;d=c.next()){var e=shaka.util.Uint8ArrayUtils.concat.apply(shaka.util.Uint8ArrayUtils,$jscomp.arrayFromIterable(d.value)),f=this.parsePES_(e);d=this.videoPes_.length?this.videoPes_[this.videoPes_.length-1]:null;f&&null!=f.pts&&null!=f.dts&&(!d||d.pts!=f.pts&&d.dts!=f.dts)?(this.videoPes_.length&&f.dts<(d.dts||
|
|
721
|
-
0)&&(b=!0),this.videoPes_.push(f)):this.videoPes_.length&&(e=f?f.data:e)&&(d=this.videoPes_.pop(),d.data=shaka.util.Uint8ArrayUtils.concat(d.data,e),this.videoPes_.push(d))}if(a){var g;c=$jscomp.makeIterator(this.videoPes_);for(d=c.next();!d.done;d=c.next())d=d.value,d.nalus=this.parseNalus(d,g),d.nalus.length&&(g=d.nalus[d.nalus.length-1]);this.videoPes_=this.videoPes_.filter(function(h){return h.nalus.length})}b&&(this.videoPes_=this.videoPes_.sort(function(h,k){var l=(h.pts||0)-(k.pts||
|
|
722
|
-
0)-(k.dts||0)||l}))}return a?this.videoPes_:(a=this.videoPes_,this.videoPes_=[],a)};shaka.util.TsParser.prototype.getStartTime=function(a){var b=shaka.util.TsParser.Timescale;if("audio"==a){a=null;var c=this.getAudioData();c.length&&(a=c[0],a=Math.min(a.dts,a.pts)/b);return a}return"video"==a?(a=null,c=this.getVideoData(!1),c.length&&(a=c[0],a=Math.min(a.dts,a.pts)/b),a):null};shaka.util.TsParser.prototype.getCodecs=function(){return{audio:this.audioCodec_,video:this.videoCodec_}};
|
|
721
|
+
0)&&(b=!0),this.videoPes_.push(f)):this.videoPes_.length&&(e=f?f.data:e)&&(d=this.videoPes_.pop(),d.data=shaka.util.Uint8ArrayUtils.concat(d.data,e),this.videoPes_.push(d))}if(a){var g;c=$jscomp.makeIterator(this.videoPes_);for(d=c.next();!d.done;d=c.next())d=d.value,d.nalus=this.parseNalus(d,g,void 0),d.nalus.length&&(g=d.nalus[d.nalus.length-1]);this.videoPes_=this.videoPes_.filter(function(h){return h.nalus.length})}b&&(this.videoPes_=this.videoPes_.sort(function(h,k){var l=(h.pts||0)-(k.pts||
|
|
722
|
+
0);return(h.dts||0)-(k.dts||0)||l}))}return a?this.videoPes_:(a=this.videoPes_,this.videoPes_=[],a)};shaka.util.TsParser.prototype.getStartTime=function(a){var b=shaka.util.TsParser.Timescale;if("audio"==a){a=null;var c=this.getAudioData();c.length&&(a=c[0],a=Math.min(a.dts,a.pts)/b);return a}return"video"==a?(a=null,c=this.getVideoData(!1),c.length&&(a=c[0],a=Math.min(a.dts,a.pts)/b),a):null};shaka.util.TsParser.prototype.getCodecs=function(){return{audio:this.audioCodec_,video:this.videoCodec_}};
|
|
723
723
|
shaka.util.TsParser.prototype.getVideoNalus=function(){for(var a=[],b=$jscomp.makeIterator(this.getVideoData()),c=b.next();!c.done;c=b.next())a.push.apply(a,$jscomp.arrayFromIterable(c.value.nalus));return a};shaka.util.TsParser.prototype.getVideoResolution=function(){shaka.Deprecate.deprecateFeature(5,"TsParser","Please use getVideoInfo function instead.");var a=this.getVideoInfo();return{height:a.height,width:a.width}};
|
|
724
724
|
shaka.util.TsParser.prototype.getVideoInfo=function(){return"hvc"==this.videoCodec_?this.getHvcInfo_():this.getAvcInfo_()};
|
|
725
725
|
shaka.util.TsParser.prototype.getAvcInfo_=function(){var a=shaka.util.TsParser,b={height:null,width:null,codec:null},c=this.getVideoNalus();if(!c.length)return b;c=c.find(function(q){return q.type==a.H264_NALU_TYPE_SPS_});if(!c)return b;c=new shaka.util.ExpGolomb(c.data);var d=c.readUnsignedByte(),e=c.readUnsignedByte(),f=c.readUnsignedByte();c.skipExpGolomb();if(a.PROFILES_WITH_OPTIONAL_SPS_DATA_.includes(d)){var g=c.readUnsignedExpGolomb();3===g&&c.skipBits(1);c.skipExpGolomb();c.skipExpGolomb();
|
|
@@ -1255,15 +1255,15 @@ null):new Date(b.getTime()+1E3*a);shaka.log.warning("No way to get playhead time
|
|
|
1255
1255
|
shaka.Player.prototype.getPresentationStartTimeAsDate=function(){if(!this.isLive())return shaka.log.warning("getPresentationStartTimeAsDate is for live streams!"),null;if(this.manifest_){var a=this.manifest_.presentationTimeline.getPresentationStartTime();goog.asserts.assert(null!=a,"Presentation start time should not be null!");return new Date(1E3*a)}if(this.video_&&this.video_.getStartDate)return a=this.video_.getStartDate(),isNaN(a.getTime())?(shaka.log.warning("EXT-X-PROGRAM-DATETIME required to get presentation start time as Date!"),
|
|
1256
1256
|
null):a;shaka.log.warning("No way to get presentation start time as Date!");return null};shaka.Player.prototype.getBufferedInfo=function(){if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE)return this.mediaSourceEngine_.getBufferedInfo();var a={total:[],audio:[],video:[],text:[]};this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&(a.total=shaka.media.TimeRangesUtils.getBufferedInfo(this.video_.buffered));return a};
|
|
1257
1257
|
shaka.Player.prototype.getStats=function(){if(this.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&this.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)return shaka.util.Stats.getEmptyBlob();this.updateStateHistory_();goog.asserts.assert(this.video_,"If we have stats, we should have video_");var a=this.video_,b=a.currentTime/a.duration;isNaN(b)||this.stats_.setCompletionPercent(Math.round(100*b));this.playhead_&&(this.stats_.setGapsJumped(this.playhead_.getGapsJumped()),this.stats_.setStallsDetected(this.playhead_.getStallsDetected()));
|
|
1258
|
-
a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),this.stats_.setDroppedFrames(Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.stats_.setCorruptedFrames(Number(b.corruptedVideoFrames)));b=this.drmEngine_?this.drmEngine_.getLicenseTime():NaN;this.stats_.setLicenseTime(b);if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE){
|
|
1259
|
-
b.video&&this.stats_.setResolution(b.video.width||NaN,b.video.height||NaN);this.isLive()&&(b=this.getPresentationStartTimeAsDate().valueOf()+1E3*a.currentTime,b=(Date.now()-b)/1E3,this.stats_.setLiveLatency(b));this.manifest_&&this.manifest_.presentationTimeline&&(b=this.manifest_.presentationTimeline.getMaxSegmentDuration(),this.stats_.setMaxSegmentDuration(b));b=this.abrManager_.getBandwidthEstimate();
|
|
1260
|
-
NaN,a.videoHeight||NaN);return this.stats_.getBlob()};
|
|
1258
|
+
a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),this.stats_.setDroppedFrames(Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.stats_.setCorruptedFrames(Number(b.corruptedVideoFrames)));b=this.drmEngine_?this.drmEngine_.getLicenseTime():NaN;this.stats_.setLicenseTime(b);if(this.loadMode_==shaka.Player.LoadMode.MEDIA_SOURCE){b=this.streamingEngine_.getCurrentVariant();var c=this.streamingEngine_.getCurrentTextStream();if(b){var d=this.playRateController_?this.playRateController_.getRealRate():
|
|
1259
|
+
1,e=d*b.bandwidth;c&&c.bandwidth&&(e+=d*c.bandwidth);this.stats_.setCurrentStreamBandwidth(e)}b&&b.video&&this.stats_.setResolution(b.video.width||NaN,b.video.height||NaN);this.isLive()&&(b=this.getPresentationStartTimeAsDate().valueOf()+1E3*a.currentTime,b=(Date.now()-b)/1E3,this.stats_.setLiveLatency(b));this.manifest_&&this.manifest_.presentationTimeline&&(b=this.manifest_.presentationTimeline.getMaxSegmentDuration(),this.stats_.setMaxSegmentDuration(b));b=this.abrManager_.getBandwidthEstimate();
|
|
1260
|
+
this.stats_.setBandwidthEstimate(b)}this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&this.stats_.setResolution(a.videoWidth||NaN,a.videoHeight||NaN);return this.stats_.getBlob()};
|
|
1261
1261
|
shaka.Player.prototype.addTextTrackAsync=function(a,b,c,d,e,f,g){g=void 0===g?!1:g;var h=this,k,l,m,n,p,q,r,t,w,u,v,x,y;return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){switch(z.nextAddress){case 1:if(h.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&h.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)throw shaka.log.error("Must call load() and wait for it to resolve before adding text tracks."),new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.CONTENT_NOT_LOADED);
|
|
1262
|
-
if(d){z.jumpTo(2);break}return z.yield(h.getTextMimetype_(a),3);case 3:d=z.yieldResult;case 2:k=[];h.adManager_&&(k=h.adManager_.getCuePoints());if(h.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS){z.jumpTo(4);break}g&&(c="forced");return z.yield(h.addSrcTrackElement_(a,b,c,d,f||"",k),5);case 5:l=shaka.util.LanguageUtils;m=l.normalize(b);n=h.getTextTracks();if(p=
|
|
1263
|
-
throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS);case 4:q=shaka.util.ManifestParserUtils.ContentType;r=h.video_.duration;h.manifest_&&(r=h.manifest_.presentationTimeline.getDuration());if(Infinity==r)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,
|
|
1264
|
-
"Need networking engine.");return z.yield(h.getTextData_(a,h.networkingEngine_,h.config_.streaming.retryParameters),7);case 7:t=z.yieldResult,w=h.convertToWebVTT_(t,d,k),u=new Blob([w],{type:"text/vtt"}),a=shaka.media.MediaSourceEngine.createObjectURL(u),d="text/vtt";case 6:v={id:h.nextExternalStreamId_++,originalId:null,groupId:null,
|
|
1265
|
-
drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:q.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1};x=shaka.util.MimeUtils.getFullType(v.mimeType,
|
|
1266
|
-
d);h.manifest_.textStreams.push(v);h.onTracksChanged_();return z.return(shaka.util.StreamUtils.textStreamToTrack(v))}})};
|
|
1262
|
+
"subtitles"!=c&&"captions"!=c&&shaka.log.alwaysWarn("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");if(d){z.jumpTo(2);break}return z.yield(h.getTextMimetype_(a),3);case 3:d=z.yieldResult;case 2:k=[];h.adManager_&&(k=h.adManager_.getCuePoints());if(h.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS){z.jumpTo(4);break}g&&(c="forced");return z.yield(h.addSrcTrackElement_(a,b,c,d,f||"",k),5);case 5:l=shaka.util.LanguageUtils;m=l.normalize(b);n=h.getTextTracks();if(p=
|
|
1263
|
+
n.find(function(A){return l.normalize(A.language)==m&&A.label==(f||"")&&A.kind==c}))return h.onTracksChanged_(),z.return(p);shaka.log.error("Cannot add this text when loaded with src=");throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS);case 4:q=shaka.util.ManifestParserUtils.ContentType;r=h.video_.duration;h.manifest_&&(r=h.manifest_.presentationTimeline.getDuration());if(Infinity==r)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,
|
|
1264
|
+
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM);if(!k.length){z.jumpTo(6);break}goog.asserts.assert(h.networkingEngine_,"Need networking engine.");return z.yield(h.getTextData_(a,h.networkingEngine_,h.config_.streaming.retryParameters),7);case 7:t=z.yieldResult,w=h.convertToWebVTT_(t,d,k),u=new Blob([w],{type:"text/vtt"}),a=shaka.media.MediaSourceEngine.createObjectURL(u),d="text/vtt";case 6:v={id:h.nextExternalStreamId_++,originalId:null,groupId:null,
|
|
1265
|
+
createSegmentIndex:function(){return Promise.resolve()},segmentIndex:shaka.media.SegmentIndex.forSingleSegment(0,r,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:q.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1};x=shaka.util.MimeUtils.getFullType(v.mimeType,
|
|
1266
|
+
v.codecs);y=shaka.text.TextEngine.isTypeSupported(x);if(!y)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.MISSING_TEXT_PLUGIN,d);h.manifest_.textStreams.push(v);h.onTracksChanged_();return z.return(shaka.util.StreamUtils.textStreamToTrack(v))}})};
|
|
1267
1267
|
shaka.Player.prototype.addThumbnailsTrack=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,t,w,u,v;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){switch(x.nextAddress){case 1:if(c.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&c.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)throw shaka.log.error("Must call load() and wait for it to resolve before adding image tracks."),new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.CONTENT_NOT_LOADED);
|
|
1268
1268
|
if(b){x.jumpTo(2);break}return x.yield(c.getTextMimetype_(a),3);case 3:b=x.yieldResult;case 2:if("text/vtt"!=b)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.UNSUPPORTED_EXTERNAL_THUMBNAILS_URI,a);d=shaka.util.ManifestParserUtils.ContentType;e=c.video_.duration;c.manifest_&&(e=c.manifest_.presentationTimeline.getDuration());if(Infinity==e)throw new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.MANIFEST,
|
|
1269
1269
|
shaka.util.Error.Code.CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM);goog.asserts.assert(c.networkingEngine_,"Need networking engine.");return x.yield(c.getTextData_(a,c.networkingEngine_,c.config_.streaming.retryParameters),4);case 4:f=x.yieldResult;g=shaka.text.TextEngine.findParser(b);if(!g)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.TEXT,shaka.util.Error.Code.MISSING_TEXT_PLUGIN,b);h=g();k={periodStart:0,segmentStart:0,segmentEnd:e,vttOffset:0};l=shaka.util.BufferUtils.toUint8(f);
|
|
@@ -1324,9 +1324,10 @@ shaka.Player.prototype.onMediaQualityChange_=function(a,b){a={bandwidth:a.bandwi
|
|
|
1324
1324
|
shaka.Player.prototype.videoErrorToShakaError_=function(){goog.asserts.assert(this.video_.error,"Video error expected, but missing!");if(!this.video_.error)return null;var a=this.video_.error.code;if(1==a)return null;var b=this.video_.error.msExtendedCode;b&&(0>b&&(b+=Math.pow(2,32)),b=b.toString(16));return new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MEDIA,shaka.util.Error.Code.VIDEO_ERROR,a,b,this.video_.error.message)};
|
|
1325
1325
|
shaka.Player.prototype.onVideoError_=function(a){if(a=this.videoErrorToShakaError_())this.onError_(a)};
|
|
1326
1326
|
shaka.Player.prototype.onKeyStatus_=function(a){if(this.streamingEngine_){var b=this.makeEvent_(shaka.util.FakeEvent.EventName.KeyStatusChanged);this.dispatchEvent(b);var c=Object.keys(a);0==c.length&&shaka.log.warning("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");(b=1==c.length&&"00"==c[0])&&shaka.log.warning("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");
|
|
1327
|
-
var d=shaka.Player.restrictedStatuses_,e=!1;if(c.length){c=$jscomp.makeIterator(this.manifest_.variants);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=shaka.util.StreamUtils.getVariantStreams(f);g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next()){var k=h.value;h=f.allowedByKeySystem;if(k.keyIds.size){f.allowedByKeySystem=!0;k=$jscomp.makeIterator(k.keyIds);for(var l=k.next();!l.done;l=k.next())l=l.value,
|
|
1328
|
-
f.allowedByKeySystem&&(e=!0)}}}if(e&&(this.onTracksChanged_(),!this.updateAbrManagerVariants_()))return;(a=this.streamingEngine_.getCurrentVariant())&&!a.allowedByKeySystem&&(shaka.log.debug("Choosing new streams after key status changed"),this.chooseVariantAndSwitch_())}};
|
|
1329
|
-
shaka.Player.prototype.
|
|
1327
|
+
var d=shaka.Player.restrictedStatuses_,e=!1;goog.asserts.assert(this.drmEngine_,"drmEngine should be non-null here.");if(c.length){c=$jscomp.makeIterator(this.manifest_.variants);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=shaka.util.StreamUtils.getVariantStreams(f);g=$jscomp.makeIterator(g);for(var h=g.next();!h.done;h=g.next()){var k=h.value;h=f.allowedByKeySystem;if(k.keyIds.size){f.allowedByKeySystem=!0;k=$jscomp.makeIterator(k.keyIds);for(var l=k.next();!l.done;l=k.next())if(l=l.value,
|
|
1328
|
+
(l=a[b?"00":l])||this.drmEngine_.hasManifestInitData())f.allowedByKeySystem=f.allowedByKeySystem&&!!l&&!d.includes(l)}h!=f.allowedByKeySystem&&(e=!0)}}}if(e&&(this.onTracksChanged_(),!this.updateAbrManagerVariants_()))return;(a=this.streamingEngine_.getCurrentVariant())&&!a.allowedByKeySystem&&(shaka.log.debug("Choosing new streams after key status changed"),this.chooseVariantAndSwitch_())}};
|
|
1329
|
+
shaka.Player.prototype.onExpirationUpdated_=function(a,b){if(this.parser_&&this.parser_.onExpirationUpdated)this.parser_.onExpirationUpdated(a,b);a=this.makeEvent_(shaka.util.FakeEvent.EventName.ExpirationUpdated);this.dispatchEvent(a)};shaka.Player.prototype.shouldStreamText_=function(){return this.config_.streaming.alwaysStreamText||this.isTextTrackVisible()};
|
|
1330
|
+
shaka.Player.applyPlayRange_=function(a,b,c){0<b&&(a.isLive()?shaka.log.warning("|playRangeStart| has been configured for live content. Ignoring the setting."):a.setUserSeekStart(b));b=a.getDuration();c<b&&(a.isLive()?shaka.log.warning("|playRangeEnd| has been configured for live content. Ignoring the setting."):a.setDuration(c))};
|
|
1330
1331
|
shaka.Player.prototype.checkRestrictedVariants_=function(a){var b=shaka.Player.restrictedStatuses_,c=this.drmEngine_?this.drmEngine_.getKeyStatuses():{},d=Object.keys(c);d=d.length&&"00"==d[0];var e=!1,f=!1,g=new Set,h=new Set;a=$jscomp.makeIterator(a.variants);for(var k=a.next();!k.done;k=a.next()){k=k.value;var l=[];k.audio&&l.push(k.audio);k.video&&l.push(k.video);l=$jscomp.makeIterator(l);for(var m=l.next();!m.done;m=l.next())if(m=m.value,m.keyIds.size){m=$jscomp.makeIterator(m.keyIds);for(var n=
|
|
1331
1332
|
m.next();!n.done;n=m.next()){n=n.value;var p=c[d?"00":n];p?b.includes(p)&&h.add(p):g.add(n)}}k.allowedByApplication?k.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw b={hasAppRestrictions:f,missingKeys:Array.from(g),restrictedKeyStatuses:Array.from(h)},new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET,b);};
|
|
1332
1333
|
shaka.Player.prototype.checkPlayableVariants_=function(a){if(!a.variants.some(shaka.util.StreamUtils.isPlayable))throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.CONTENT_UNSUPPORTED_BY_BROWSER);};
|
|
@@ -1348,7 +1349,7 @@ goog.exportProperty(shaka.Player.prototype,"isInProgress",shaka.Player.prototype
|
|
|
1348
1349
|
goog.exportProperty(shaka.Player.prototype,"getMediaElement",shaka.Player.prototype.getMediaElement);goog.exportProperty(shaka.Player.prototype,"getManifestType",shaka.Player.prototype.getManifestType);goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.getLoadMode);goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.prototype.resetConfiguration);goog.exportProperty(shaka.Player.prototype,"getBufferFullness",shaka.Player.prototype.getBufferFullness);
|
|
1349
1350
|
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);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);
|
|
1350
1351
|
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);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);
|
|
1351
|
-
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);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.6.
|
|
1352
|
+
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);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.6.11-debug";
|
|
1352
1353
|
goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.restrictedStatuses_=["output-restricted","internal-error"];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_++};
|
|
1353
1354
|
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()};
|
|
1354
1355
|
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()};
|
|
@@ -2286,8 +2287,8 @@ shaka.offline.Storage.prototype.store=function(a,b,c){var d=this;goog.asserts.as
|
|
|
2286
2287
|
h.yield(shaka.net.NetworkingUtils.getMimeType(a,d.networkingEngine_,e.manifest.retryParameters),3);2!=h.nextAddress&&(c=h.yieldResult);g=shaka.media.ManifestParser.getFactory(a,c||null);return h.return(g())})},e,f);b=new shaka.util.AbortableOperation(b,function(){return f.abortAll()});b.finally(function(){shaka.util.ArrayUtils.remove(d.openDownloadManagers_,f)});return this.startAbortableOperation_(b)};
|
|
2287
2288
|
shaka.offline.Storage.prototype.store_=function(a,b,c,d,e){var f=this,g,h,k,l,m,n,p,q,r,t,w,u,v,x;return $jscomp.asyncExecutePromiseGeneratorProgram(function(y){switch(y.nextAddress){case 1:return f.requireSupport_(),h=g=null,k=new shaka.offline.StorageMuxer,n=m=l=null,y.setCatchFinallyBlocks(2,3),y.yield(c(),5);case 5:return g=y.yieldResult,y.yield(f.parseManifest(a,g,d),6);case 6:p=y.yieldResult;f.ensureNotDestroyed_();q=!p.presentationTimeline.isLive()&&!p.presentationTimeline.isInProgress();if(!q)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
2288
2289
|
shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE,a);return y.yield(f.createDrmEngine(p,function(z){n=n||z},d),7);case 7:h=y.yieldResult;f.ensureNotDestroyed_();if(n)throw n;return y.yield(f.filterManifest_(p,h,d),8);case 8:return y.yield(k.init(),9);case 9:return f.ensureNotDestroyed_(),y.yield(k.getActive(),10);case 10:return l=y.yieldResult,f.ensureNotDestroyed_(),goog.asserts.assert(h,"drmEngine should be non-null here."),r=f.makeManifestDB_(h,p,a,b,d,e),t=r.manifestDB,
|
|
2289
|
-
w=r.toDownload,y.yield(l.cell.addManifests([t]),11);case 11:u=y.yieldResult;f.ensureNotDestroyed_();m=u[0];goog.asserts.assert(h,"drmEngine should be non-null here.");f.ensureNotDestroyed_();if(n)throw n;return y.yield(f.downloadSegments_(w,m,t,e,d,l.cell,p,h),12);case 12:return f.ensureNotDestroyed_(),v=shaka.offline.OfflineUri.manifest(l.path.mechanism,l.path.cell,m),y.return(shaka.offline.StoredContentUtils.fromManifestDB(v,
|
|
2290
|
-
break}return y.yield(g.stop(),
|
|
2290
|
+
w=r.toDownload,y.yield(l.cell.addManifests([t]),11);case 11:u=y.yieldResult;f.ensureNotDestroyed_();m=u[0];goog.asserts.assert(h,"drmEngine should be non-null here.");f.ensureNotDestroyed_();if(n)throw n;return y.yield(f.downloadSegments_(w,m,t,e,d,l.cell,p,h),12);case 12:return f.ensureNotDestroyed_(),f.setManifestDrmFields_(p,t,h,d),y.yield(l.cell.updateManifest(m,t),13);case 13:return f.ensureNotDestroyed_(),v=shaka.offline.OfflineUri.manifest(l.path.mechanism,l.path.cell,m),y.return(shaka.offline.StoredContentUtils.fromManifestDB(v,
|
|
2291
|
+
t));case 3:return y.enterFinallyBlock(),y.yield(k.destroy(),14);case 14:if(!g){y.jumpTo(15);break}return y.yield(g.stop(),15);case 15:if(!h){y.jumpTo(17);break}return y.yield(h.destroy(),17);case 17:y.leaveFinallyBlock(0);break;case 2:x=y.enterCatchBlock();if(null==m){y.jumpTo(19);break}return y.yield(shaka.offline.Storage.cleanStoredManifest(m),19);case 19:throw n||x;}})};
|
|
2291
2292
|
shaka.offline.Storage.prototype.downloadSegments_=function(a,b,c,d,e,f,g,h){var k=this,l,m,n,p,q,r,t,w,u,v;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){switch(x.nextAddress){case 1:l={};m=0;n=function(y,z){var A,B,C,I,D,F,E;return $jscomp.asyncExecutePromiseGeneratorProgram(function(G){if(1==G.nextAddress){A={};B=$jscomp.makeIterator(y);for(C=B.next();!C.done;A={$jscomp$loop$prop$download$760$900:A.$jscomp$loop$prop$download$760$900},C=B.next())A.$jscomp$loop$prop$download$760$900=
|
|
2292
2293
|
C.value,I=A.$jscomp$loop$prop$download$760$900.makeSegmentRequest(e),D=A.$jscomp$loop$prop$download$760$900.estimateId,F=A.$jscomp$loop$prop$download$760$900.isInitSegment,E=function(H){return function(J){var K,M,L;return $jscomp.asyncExecutePromiseGeneratorProgram(function(O){if(1==O.nextAddress)return O.yield(f.addSegments([{data:J}]),2);K=O.yieldResult;k.ensureNotDestroyed_();M=H.$jscomp$loop$prop$download$760$900.ref;L=shaka.offline.DownloadInfo.idForSegmentRef(M);l[L]=K[0];m+=J.byteLength;O.jumpToEnd()})}}(A),
|
|
2293
2294
|
d.queue(A.$jscomp$loop$prop$download$760$900.groupId,I,D,F,E);return G.yield(d.waitToFinish(),2)}if(!z)return G.jumpTo(0);k.ensureNotDestroyed_();k.setManifestDrmFields_(g,c,h,e);return G.yield(f.updateManifest(b,c),0)})};p=!1;x.setCatchFinallyBlocks(2);if(!k.getManifestIsEncrypted_(g)||!p||k.getManifestIncludesInitData_(g)){x.jumpTo(4);break}return x.yield(n(a.filter(function(y){return y.isInitSegment}),!0),5);case 5:return k.ensureNotDestroyed_(),a=a.filter(function(y){return!y.isInitSegment}),
|
|
@@ -2350,10 +2351,10 @@ a);document.addEventListener("MSFullscreenError",a)}};shaka.polyfill.Fullscreen.
|
|
|
2350
2351
|
shaka.polyfill.MediaCapabilities.install=function(){var a=!0;if(shaka.util.Platform.isApple()||shaka.util.Platform.isPS5()||shaka.util.Platform.isPS4()||shaka.util.Platform.isWebOS()||shaka.util.Platform.isTizen()||shaka.util.Platform.isChromecast()||shaka.util.Platform.isEOS()||shaka.util.Platform.isHisense())a=!1;a&&navigator.mediaCapabilities?shaka.log.info("MediaCapabilities: Native mediaCapabilities support found."):(shaka.log.info("MediaCapabilities: install"),navigator.mediaCapabilities||(navigator.mediaCapabilities=
|
|
2351
2352
|
{}),shaka.polyfill.MediaCapabilities.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=shaka.polyfill.MediaCapabilities.decodingInfo_)};
|
|
2352
2353
|
shaka.polyfill.MediaCapabilities.decodingInfo_=function(a){var b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,w,u,v,x,y;return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){switch(z.nextAddress){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};if(!a)return z.return(b);c=a.video;d=a.audio;e=shaka.media.Capabilities;if("media-source"==a.type){if(!shaka.util.Platform.supportsMediaSource()||c&&(shaka.util.Platform.isChromecast()?f=shaka.polyfill.MediaCapabilities.canCastDisplayType_(c):
|
|
2353
|
-
shaka.util.Platform.isTizen()?(g=c.contentType,c.width&&c.height&&(g+="; width="+c.width,g+="; height="+c.height),c.framerate&&(g+="; framerate="+c.framerate),c.bitrate&&(g+="; bitrate="+c.bitrate),f=e.isTypeSupported(g)):f=e.isTypeSupported(c.contentType),!f)||d&&(
|
|
2354
|
-
if(!a.keySystemConfiguration)return b.supported=!0,z.return(Promise.resolve(b));q=a.keySystemConfiguration;r=[];t=[];q.audio&&(w={robustness:q.audio.robustness||"",contentType:a.audio.contentType},r.push(w));q.video&&(u={robustness:q.video.robustness||"",contentType:a.video.contentType},t.push(u));v={initDataTypes:[q.initDataType],distinctiveIdentifier:q.distinctiveIdentifier,persistentState:q.persistentState,
|
|
2355
|
-
t);x=shaka.polyfill.MediaCapabilities.generateKeySystemCacheKey_(a.video?a.video.contentType:"",a.audio?a.audio.contentType:"",a.keySystemConfiguration.keySystem);z.setCatchFinallyBlocks(3);if(x in shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_){y=shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_[x];z.jumpTo(5);break}return z.yield(navigator.requestMediaKeySystemAccess(q.keySystem,
|
|
2356
|
-
y;case 5:z.leaveTryBlock(4);break;case 3:z.enterCatchBlock(),shaka.log.info("navigator.requestMediaKeySystemAccess failed.");case 4:y&&(b.supported=!0,b.keySystemAccess=y);case 2:return z.return(b)}})};
|
|
2354
|
+
shaka.util.Platform.isTizen()?(g=c.contentType,c.width&&c.height&&(g+="; width="+c.width,g+="; height="+c.height),c.framerate&&(g+="; framerate="+c.framerate),c.bitrate&&(g+="; bitrate="+c.bitrate),f=e.isTypeSupported(g)):f=e.isTypeSupported(c.contentType),!f)||d&&(shaka.util.Platform.isChromecast()&&d.spatialRendering?(k=d.contentType+"; spatialRendering=true",h=e.isTypeSupported(k)):h=e.isTypeSupported(d.contentType),!h))return z.return(b)}else if("file"==a.type){if(c&&(l=c.contentType,m=shaka.util.Platform.supportsMediaType(l),
|
|
2355
|
+
!m)||d&&(n=d.contentType,p=shaka.util.Platform.supportsMediaType(n),!p))return z.return(b)}else return z.return(b);if(!a.keySystemConfiguration)return b.supported=!0,z.return(Promise.resolve(b));q=a.keySystemConfiguration;r=[];t=[];q.audio&&(w={robustness:q.audio.robustness||"",contentType:a.audio.contentType},r.push(w));q.video&&(u={robustness:q.video.robustness||"",contentType:a.video.contentType},t.push(u));v={initDataTypes:[q.initDataType],distinctiveIdentifier:q.distinctiveIdentifier,persistentState:q.persistentState,
|
|
2356
|
+
sessionTypes:q.sessionTypes};r.length&&(v.audioCapabilities=r);t.length&&(v.videoCapabilities=t);x=shaka.polyfill.MediaCapabilities.generateKeySystemCacheKey_(a.video?a.video.contentType:"",a.audio?a.audio.contentType:"",a.keySystemConfiguration.keySystem);z.setCatchFinallyBlocks(3);if(x in shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_){y=shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_[x];z.jumpTo(5);break}return z.yield(navigator.requestMediaKeySystemAccess(q.keySystem,
|
|
2357
|
+
[v]),6);case 6:y=z.yieldResult,shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_[x]=y;case 5:z.leaveTryBlock(4);break;case 3:z.enterCatchBlock(),shaka.log.info("navigator.requestMediaKeySystemAccess failed.");case 4:y&&(b.supported=!0,b.keySystemAccess=y);case 2:return z.return(b)}})};
|
|
2357
2358
|
shaka.polyfill.MediaCapabilities.canCastDisplayType_=function(a){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."),shaka.media.Capabilities.isTypeSupported(a.contentType);var b=a.contentType;a.width&&a.height&&(b+="; width="+a.width+"; height="+a.height);a.framerate&&(b+="; framerate="+a.framerate);"pq"===a.transferFunction&&(b+="; eotf=smpte2084");
|
|
2358
2359
|
return cast.__platform__.canDisplayType(b)};shaka.polyfill.MediaCapabilities.generateKeySystemCacheKey_=function(a,b,c){return a+"#"+b+"#"+c};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);
|
|
2359
2360
|
shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_={};goog.exportProperty(shaka.polyfill.MediaCapabilities,"memoizedMediaKeySystemAccessRequests_",shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_);shaka.polyfill.register(shaka.polyfill.MediaCapabilities.install,-1);shaka.polyfill.MediaSource=function(){};
|
|
@@ -2837,7 +2838,7 @@ shaka.ui.Controls.prototype.isFullScreenSupported=function(){return document.ful
|
|
|
2837
2838
|
shaka.ui.Controls.prototype.enterFullScreen_=function(){var a=this,b,c,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){switch(e.nextAddress){case 1:e.setCatchFinallyBlocks(2);if(!document.fullscreenEnabled){b=a.localVideo_;b.webkitSupportsFullscreen&&b.webkitEnterFullscreen();e.jumpTo(4);break}if(!document.pictureInPictureElement){e.jumpTo(5);break}return e.yield(document.exitPictureInPicture(),5);case 5:return c=a.config_.fullScreenElement,e.yield(c.requestFullscreen({navigationUI:"hide"}),
|
|
2838
2839
|
7);case 7:if(!a.config_.forceLandscapeOnFullscreen||!screen.orientation){e.jumpTo(4);break}e.setCatchFinallyBlocks(9);return e.yield(screen.orientation.lock("landscape"),11);case 11:e.leaveTryBlock(4,2);break;case 9:e.enterCatchBlock(2);case 4:e.leaveTryBlock(0);break;case 2:d=e.enterCatchBlock(),a.dispatchEvent(new shaka.util.FakeEvent("error",(new Map).set("detail",d))),e.jumpToEnd()}})};
|
|
2839
2840
|
shaka.ui.Controls.prototype.exitFullScreen_=function(){var a=this,b;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(!document.fullscreenEnabled)return b=a.localVideo_,b.webkitSupportsFullscreen&&b.webkitExitFullscreen(),c.jumpTo(0);screen.orientation&&screen.orientation.unlock();return c.yield(document.exitFullscreen(),0)})};
|
|
2840
|
-
shaka.ui.Controls.prototype.toggleFullScreen=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){return a.isFullScreenEnabled()?b.yield(a.exitFullScreen_(),0):b.yield(a.enterFullScreen_(),0)})};shaka.ui.Controls.prototype.isPiPAllowed=function(){return"documentPictureInPicture"in window&&this.config_.preferDocumentPictureInPicture||document.pictureInPictureEnabled?!this.localVideo_.disablePictureInPicture:!1};
|
|
2841
|
+
shaka.ui.Controls.prototype.toggleFullScreen=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){return a.isFullScreenEnabled()?b.yield(a.exitFullScreen_(),0):b.yield(a.enterFullScreen_(),0)})};shaka.ui.Controls.prototype.isPiPAllowed=function(){return this.castProxy_.isCasting()?!1:"documentPictureInPicture"in window&&this.config_.preferDocumentPictureInPicture||document.pictureInPictureEnabled?!this.localVideo_.disablePictureInPicture:!1};
|
|
2841
2842
|
shaka.ui.Controls.prototype.isPiPEnabled=function(){return"documentPictureInPicture"in window&&this.config_.preferDocumentPictureInPicture?!!window.documentPictureInPicture.window:!!document.pictureInPictureElement};
|
|
2842
2843
|
shaka.ui.Controls.prototype.togglePiP=function(){var a=this,b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress)return d.setCatchFinallyBlocks(2),"documentPictureInPicture"in window&&a.config_.preferDocumentPictureInPicture?d.yield(a.toggleDocumentPictureInPicture_(),5):document.pictureInPictureElement?d.yield(document.exitPictureInPicture(),5):(document.fullscreenElement&&document.exitFullscreen(),b=a.localVideo_,d.yield(b.requestPictureInPicture(),5));if(2!=d.nextAddress)return d.leaveTryBlock(0);
|
|
2843
2844
|
c=d.enterCatchBlock();a.dispatchEvent(new shaka.util.FakeEvent("error",(new Map).set("detail",c)));d.jumpToEnd()})};
|
|
@@ -2961,13 +2962,12 @@ function(){c.updateAriaLabel_();c.updateIcon_()});this.eventManager.listen(this.
|
|
|
2961
2962
|
shaka.ui.MuteButton.prototype.updateIcon_=function(){var a=shaka.ui.Enums.MaterialDesignIcons;a=this.ad?this.ad.isMuted()?a.UNMUTE:a.MUTE:this.video.muted?a.UNMUTE:a.MUTE;this.button_.textContent=a};goog.exportSymbol("shaka.ui.MuteButton",shaka.ui.MuteButton);shaka.ui.MuteButton.Factory=function(){};shaka.ui.MuteButton.Factory.prototype.create=function(a,b){return new shaka.ui.MuteButton(a,b)};shaka.ui.Controls.registerElement("mute",new shaka.ui.MuteButton.Factory);shaka.ui.PipButton=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.localVideo_=this.controls.getLocalVideo();this.videoContainer_=this.controls.getVideoContainer();a=shaka.ui.Locales.Ids;this.pipButton_=shaka.util.Dom.createButton();this.pipButton_.classList.add("shaka-pip-button");this.pipButton_.classList.add("shaka-tooltip");this.pipIcon_=shaka.util.Dom.createHTMLElement("i");this.pipIcon_.classList.add("material-icons-round");this.pipIcon_.textContent=shaka.ui.Enums.MaterialDesignIcons.PIP;
|
|
2962
2963
|
this.pipButton_.appendChild(this.pipIcon_);b=shaka.util.Dom.createHTMLElement("label");b.classList.add("shaka-overflow-button-label");b.classList.add("shaka-overflow-menu-only");this.pipNameSpan_=shaka.util.Dom.createHTMLElement("span");this.pipNameSpan_.textContent=this.localization.resolve(a.PICTURE_IN_PICTURE);b.appendChild(this.pipNameSpan_);this.currentPipState_=shaka.util.Dom.createHTMLElement("span");this.currentPipState_.classList.add("shaka-current-selection-span");b.appendChild(this.currentPipState_);
|
|
2963
2964
|
this.pipButton_.appendChild(b);this.updateLocalizedStrings_();this.parent.appendChild(this.pipButton_);this.controls.isPiPAllowed()||shaka.ui.Utils.setDisplay(this.pipButton_,!1);this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,function(){c.updateLocalizedStrings_()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,function(){c.updateLocalizedStrings_()});this.eventManager.listen(this.pipButton_,"click",function(){c.controls.togglePiP()});
|
|
2964
|
-
this.eventManager.listen(this.localVideo_,"enterpictureinpicture",function(){c.onEnterPictureInPicture_()});this.eventManager.listen(this.localVideo_,"leavepictureinpicture",function(){c.onLeavePictureInPicture_()});this.eventManager.listen(this.controls,"caststatuschanged",function(
|
|
2965
|
-
|
|
2965
|
+
this.eventManager.listen(this.localVideo_,"enterpictureinpicture",function(){c.onEnterPictureInPicture_()});this.eventManager.listen(this.localVideo_,"leavepictureinpicture",function(){c.onLeavePictureInPicture_()});this.eventManager.listen(this.controls,"caststatuschanged",function(){c.onTracksChanged_()});this.eventManager.listen(this.player,"trackschanged",function(){c.onTracksChanged_()});"documentPictureInPicture"in window&&this.eventManager.listen(window.documentPictureInPicture,"enter",function(d){c.onEnterPictureInPicture_();
|
|
2966
|
+
c.eventManager.listenOnce(d.window,"pagehide",function(){c.onLeavePictureInPicture_()})})};$jscomp.inherits(shaka.ui.PipButton,shaka.ui.Element);shaka.ui.PipButton.prototype.onEnterPictureInPicture_=function(){var a=shaka.ui.Locales.Ids;this.pipIcon_.textContent=shaka.ui.Enums.MaterialDesignIcons.EXIT_PIP;this.pipButton_.ariaLabel=this.localization.resolve(a.EXIT_PICTURE_IN_PICTURE);this.currentPipState_.textContent=this.localization.resolve(a.ON)};
|
|
2966
2967
|
shaka.ui.PipButton.prototype.onLeavePictureInPicture_=function(){var a=shaka.ui.Locales.Ids;this.pipIcon_.textContent=shaka.ui.Enums.MaterialDesignIcons.PIP;this.pipButton_.ariaLabel=this.localization.resolve(a.ENTER_PICTURE_IN_PICTURE);this.currentPipState_.textContent=this.localization.resolve(a.OFF)};
|
|
2967
2968
|
shaka.ui.PipButton.prototype.updateLocalizedStrings_=function(){var a=shaka.ui.Locales.Ids;this.pipNameSpan_.textContent=this.localization.resolve(a.PICTURE_IN_PICTURE);var b=this.controls.isPiPEnabled();this.pipButton_.ariaLabel=this.localization.resolve(b?a.EXIT_PICTURE_IN_PICTURE:a.ENTER_PICTURE_IN_PICTURE);this.currentPipState_.textContent=this.localization.resolve(b?a.ON:a.OFF)};
|
|
2968
|
-
shaka.ui.PipButton.prototype.
|
|
2969
|
-
shaka.ui.PipButton.
|
|
2970
|
-
shaka.ui.PipButton.Factory=function(){};shaka.ui.PipButton.Factory.prototype.create=function(a,b){return new shaka.ui.PipButton(a,b)};shaka.ui.OverflowMenu.registerElement("picture_in_picture",new shaka.ui.PipButton.Factory);shaka.ui.Controls.registerElement("picture_in_picture",new shaka.ui.PipButton.Factory);shaka.ui.ContextMenu.registerElement("picture_in_picture",new shaka.ui.PipButton.Factory);shaka.ui.PlaybackRateSelection=function(a,b){shaka.ui.SettingsMenu.call(this,a,b,shaka.ui.Enums.MaterialDesignIcons.PLAYBACK_RATE);var c=this;this.button.classList.add("shaka-playbackrate-button");this.menu.classList.add("shaka-playback-rates");this.button.classList.add("shaka-tooltip-status");this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,function(){c.updateLocalizedStrings_()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,function(){c.updateLocalizedStrings_()});
|
|
2969
|
+
shaka.ui.PipButton.prototype.onTracksChanged_=function(){var a=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(b){if(!a.controls.isPiPAllowed())return shaka.ui.Utils.setDisplay(a.pipButton_,!1),a.controls.isPiPEnabled()?b.yield(a.controls.togglePiP(),0):b.jumpTo(0);if(!a.player||!a.player.isAudioOnly())return shaka.ui.Utils.setDisplay(a.pipButton_,!0),b.jumpTo(0);shaka.ui.Utils.setDisplay(a.pipButton_,!1);return a.controls.isPiPEnabled()?b.yield(a.controls.togglePiP(),0):b.jumpTo(0)})};
|
|
2970
|
+
goog.exportSymbol("shaka.ui.PipButton",shaka.ui.PipButton);shaka.ui.PipButton.Factory=function(){};shaka.ui.PipButton.Factory.prototype.create=function(a,b){return new shaka.ui.PipButton(a,b)};shaka.ui.OverflowMenu.registerElement("picture_in_picture",new shaka.ui.PipButton.Factory);shaka.ui.Controls.registerElement("picture_in_picture",new shaka.ui.PipButton.Factory);shaka.ui.ContextMenu.registerElement("picture_in_picture",new shaka.ui.PipButton.Factory);shaka.ui.PlaybackRateSelection=function(a,b){shaka.ui.SettingsMenu.call(this,a,b,shaka.ui.Enums.MaterialDesignIcons.PLAYBACK_RATE);var c=this;this.button.classList.add("shaka-playbackrate-button");this.menu.classList.add("shaka-playback-rates");this.button.classList.add("shaka-tooltip-status");this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,function(){c.updateLocalizedStrings_()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,function(){c.updateLocalizedStrings_()});
|
|
2971
2971
|
this.eventManager.listen(this.player,"loaded",function(){c.updatePlaybackRateSelection_(c.player.getPlaybackRate())});this.eventManager.listen(this.player,"ratechange",function(){c.updatePlaybackRateSelection_(c.player.getPlaybackRate())});this.playbackRates_=new Map(this.controls.getConfig().playbackRates.map(function(d){return[d+"x",d]}));this.updateLocalizedStrings_();this.addPlaybackRates_();this.updatePlaybackRateSelection_(this.player.getPlaybackRate())};
|
|
2972
2972
|
$jscomp.inherits(shaka.ui.PlaybackRateSelection,shaka.ui.SettingsMenu);shaka.ui.PlaybackRateSelection.prototype.updateLocalizedStrings_=function(){var a=shaka.ui.Locales.Ids;this.backButton.ariaLabel=this.localization.resolve(a.BACK);this.button.ariaLabel=this.localization.resolve(a.PLAYBACK_RATE);this.nameSpan.textContent=this.localization.resolve(a.PLAYBACK_RATE);this.backSpan.textContent=this.localization.resolve(a.PLAYBACK_RATE)};
|
|
2973
2973
|
shaka.ui.PlaybackRateSelection.prototype.updatePlaybackRateSelection_=function(a){var b=this,c=shaka.ui.Utils.getDescendantIfExists(this.menu,"material-icons-round shaka-chosen-item");if(c){var d=c.parentElement;d.removeAttribute("aria-selected");d.getElementsByTagName("span")[0].classList.remove("shaka-chosen-item");d.removeChild(c)}if(c=Array.from(this.menu.querySelectorAll("span")).find(function(e){return b.playbackRates_.get(e.textContent)==a}))d=c.parentElement,d.appendChild(shaka.ui.Utils.checkmarkIcon()),
|