shaka-player 4.7.6 → 4.7.7
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/AUTHORS +1 -0
- package/CONTRIBUTORS +1 -0
- package/dist/locales.js +32 -32
- 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 +22 -21
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +2 -1
- package/dist/shaka-player.compiled.js +1052 -1050
- 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 +24 -24
- package/dist/shaka-player.ui.debug.map +2 -2
- package/dist/shaka-player.ui.externs.js +3 -1
- package/dist/shaka-player.ui.js +1135 -1133
- 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 +13 -3
- package/lib/polyfill/media_capabilities.js +9 -2
- package/lib/util/ts_parser.js +7 -4
- package/package.json +1 -1
- package/ui/externs/ui.js +24 -0
- package/ui/play_button.js +3 -0
|
@@ -3003,9 +3003,12 @@ declare namespace shaka.ui {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.externs.js
|
|
3005
3005
|
declare namespace shaka.ui {
|
|
3006
|
-
class PlayButton extends shaka.ui.Element {
|
|
3006
|
+
class PlayButton extends shaka.ui.Element implements shaka.extern.IUIPlayButton {
|
|
3007
3007
|
private noStructuralTyping_shaka_ui_PlayButton : any;
|
|
3008
3008
|
constructor (parent : HTMLElement , controls : shaka.ui.Controls ) ;
|
|
3009
|
+
button : HTMLButtonElement ;
|
|
3010
|
+
isEnded ( ) : boolean ;
|
|
3011
|
+
isPaused ( ) : boolean ;
|
|
3009
3012
|
}
|
|
3010
3013
|
}
|
|
3011
3014
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.externs.js
|
|
@@ -4103,7 +4106,7 @@ declare namespace shaka.util {
|
|
|
4103
4106
|
* The code is based on hls.js
|
|
4104
4107
|
* Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
|
|
4105
4108
|
*/
|
|
4106
|
-
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null ) : shaka.extern.VideoNalu [] ;
|
|
4109
|
+
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null , lastState ? : number | null ) : shaka.extern.VideoNalu [] ;
|
|
4107
4110
|
static Timescale : number ;
|
|
4108
4111
|
/**
|
|
4109
4112
|
* Check if the passed data corresponds to an MPEG2-TS
|
|
@@ -5815,6 +5818,14 @@ declare namespace shaka.extern.IUIElement {
|
|
|
5815
5818
|
}
|
|
5816
5819
|
}
|
|
5817
5820
|
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5821
|
+
declare namespace shaka.extern {
|
|
5822
|
+
interface IUIPlayButton {
|
|
5823
|
+
button : HTMLButtonElement ;
|
|
5824
|
+
isEnded ( ) : boolean ;
|
|
5825
|
+
isPaused ( ) : boolean ;
|
|
5826
|
+
}
|
|
5827
|
+
}
|
|
5828
|
+
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5818
5829
|
declare namespace shaka.extern {
|
|
5819
5830
|
/**
|
|
5820
5831
|
* Interface for UI range elements. UI range elements should inherit from the
|
|
@@ -3003,9 +3003,12 @@ declare namespace shaka.ui {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
|
|
3005
3005
|
declare namespace shaka.ui {
|
|
3006
|
-
class PlayButton extends shaka.ui.Element {
|
|
3006
|
+
class PlayButton extends shaka.ui.Element implements shaka.extern.IUIPlayButton {
|
|
3007
3007
|
private noStructuralTyping_shaka_ui_PlayButton : any;
|
|
3008
3008
|
constructor (parent : HTMLElement , controls : shaka.ui.Controls ) ;
|
|
3009
|
+
button : HTMLButtonElement ;
|
|
3010
|
+
isEnded ( ) : boolean ;
|
|
3011
|
+
isPaused ( ) : boolean ;
|
|
3009
3012
|
}
|
|
3010
3013
|
}
|
|
3011
3014
|
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
|
|
@@ -4103,7 +4106,7 @@ declare namespace shaka.util {
|
|
|
4103
4106
|
* The code is based on hls.js
|
|
4104
4107
|
* Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
|
|
4105
4108
|
*/
|
|
4106
|
-
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null ) : shaka.extern.VideoNalu [] ;
|
|
4109
|
+
parseNalus (pes : shaka.extern.MPEG_PES , lastNalu ? : shaka.extern.VideoNalu | null , lastState ? : number | null ) : shaka.extern.VideoNalu [] ;
|
|
4107
4110
|
static Timescale : number ;
|
|
4108
4111
|
/**
|
|
4109
4112
|
* Check if the passed data corresponds to an MPEG2-TS
|
|
@@ -5815,6 +5818,14 @@ declare namespace shaka.extern.IUIElement {
|
|
|
5815
5818
|
}
|
|
5816
5819
|
}
|
|
5817
5820
|
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5821
|
+
declare namespace shaka.extern {
|
|
5822
|
+
interface IUIPlayButton {
|
|
5823
|
+
button : HTMLButtonElement ;
|
|
5824
|
+
isEnded ( ) : boolean ;
|
|
5825
|
+
isPaused ( ) : boolean ;
|
|
5826
|
+
}
|
|
5827
|
+
}
|
|
5828
|
+
// Generated from /home/runner/work/shaka-player/shaka-player/ui/externs/ui.js
|
|
5818
5829
|
declare namespace shaka.extern {
|
|
5819
5830
|
/**
|
|
5820
5831
|
* Interface for UI range elements. UI range elements should inherit from the
|
|
@@ -2354,9 +2354,10 @@ shaka.util.TsParser = class {
|
|
|
2354
2354
|
* Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
|
|
2355
2355
|
* @param {shaka.extern.MPEG_PES} pes
|
|
2356
2356
|
* @param {?shaka.extern.VideoNalu=} lastNalu
|
|
2357
|
+
* @param {?number=} lastState
|
|
2357
2358
|
* @return {!Array.<shaka.extern.VideoNalu>}
|
|
2358
2359
|
*/
|
|
2359
|
-
parseNalus(pes, lastNalu) {}
|
|
2360
|
+
parseNalus(pes, lastNalu, lastState) {}
|
|
2360
2361
|
/**
|
|
2361
2362
|
* Return the ID3 metadata
|
|
2362
2363
|
* @return {!Array.<shaka.extern.ID3Metadata>}
|
|
@@ -5607,6 +5608,7 @@ shaka.ui.AdPosition = class extends shaka.ui.Element {
|
|
|
5607
5608
|
};
|
|
5608
5609
|
/**
|
|
5609
5610
|
* @extends {shaka.ui.Element}
|
|
5611
|
+
* @implements {shaka.extern.IUIPlayButton}
|
|
5610
5612
|
*/
|
|
5611
5613
|
shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
5612
5614
|
/**
|
|
@@ -281,9 +281,8 @@ new Map([["AD_DURATION","\uad11\uace0 \uae30\uac04"],["AD_PROGRESS","\uad11\uace
|
|
|
281
281
|
"\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",
|
|
282
282
|
"\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"],
|
|
283
283
|
["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"]]))};
|
|
284
|
-
shaka.ui.Locales.Ids={
|
|
285
|
-
|
|
286
|
-
EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN"};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)};
|
|
284
|
+
shaka.ui.Locales.Ids={UNMUTE:"UNMUTE",AD_TIME:"AD_TIME",FULL_SCREEN:"FULL_SCREEN",PLAYBACK_RATE:"PLAYBACK_RATE",NOT_APPLICABLE:"NOT_APPLICABLE",PAUSE:"PAUSE",FAST_FORWARD:"FAST_FORWARD",OFF:"OFF",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",SEEK:"SEEK",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",BACK:"BACK",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",VOLUME:"VOLUME",REWIND:"REWIND",SKIP_AD:"SKIP_AD",STATISTICS:"STATISTICS",LANGUAGE:"LANGUAGE",CAST:"CAST",SKIP_TO_LIVE:"SKIP_TO_LIVE",AIRPLAY:"AIRPLAY",SUBTITLE_FORCED:"SUBTITLE_FORCED",
|
|
285
|
+
RESOLUTION:"RESOLUTION",ON:"ON",MORE_SETTINGS:"MORE_SETTINGS",AUTO_QUALITY:"AUTO_QUALITY",QUALITY:"QUALITY",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",MUTE:"MUTE",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",REPLAY:"REPLAY",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",CAPTIONS:"CAPTIONS",LIVE:"LIVE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",PLAY:"PLAY",LOOP:"LOOP",AD_DURATION:"AD_DURATION",AD_PROGRESS:"AD_PROGRESS",SURROUND:"SURROUND"};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)};
|
|
287
286
|
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)};
|
|
288
287
|
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};
|
|
289
288
|
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};
|
|
@@ -553,7 +552,7 @@ break;case 4:b=c.enterCatchBlock(),goog.asserts.assert(b instanceof Error,"Wrong
|
|
|
553
552
|
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()})};
|
|
554
553
|
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
|
|
555
554
|
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||
|
|
556
|
-
b.eventManager_.listen(b.video_,"encrypted",function(d){return b.onEncryptedEvent_(d)});c.jumpToEnd()})};
|
|
555
|
+
b.eventManager_.listen(b.video_,"encrypted",function(d){return b.onEncryptedEvent_(d)});c.jumpToEnd()})};shaka.media.DrmEngine.prototype.hasManifestInitData=function(){return!!this.manifestInitData_};
|
|
557
556
|
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],
|
|
558
557
|
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,
|
|
559
558
|
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);
|
|
@@ -716,14 +715,14 @@ shaka.util.TsParser.prototype.parsePMT_=function(a,b){var c={audio:-1,video:-1,i
|
|
|
716
715
|
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};
|
|
717
716
|
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;
|
|
718
717
|
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)};
|
|
719
|
-
shaka.util.TsParser.prototype.parseNalus=function(a,b){var
|
|
720
|
-
time:
|
|
721
|
-
shaka.util.Uint8ArrayUtils.concat(b.fullData,a));return
|
|
718
|
+
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,
|
|
719
|
+
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),
|
|
720
|
+
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};
|
|
722
721
|
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)):
|
|
723
722
|
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_};
|
|
724
723
|
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||
|
|
725
|
-
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||
|
|
726
|
-
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_}};
|
|
724
|
+
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||
|
|
725
|
+
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_}};
|
|
727
726
|
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}};
|
|
728
727
|
shaka.util.TsParser.prototype.getVideoInfo=function(){return"hvc"==this.videoCodec_?this.getHvcInfo_():this.getAvcInfo_()};
|
|
729
728
|
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();
|
|
@@ -1283,11 +1282,11 @@ a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),this.stats_.setDropped
|
|
|
1283
1282
|
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();
|
|
1284
1283
|
this.stats_.setBandwidthEstimate(b)}this.loadMode_==shaka.Player.LoadMode.SRC_EQUALS&&this.stats_.setResolution(a.videoWidth||NaN,a.videoHeight||NaN);return this.stats_.getBlob()};
|
|
1285
1284
|
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);
|
|
1286
|
-
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=
|
|
1287
|
-
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,
|
|
1288
|
-
"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,
|
|
1289
|
-
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,
|
|
1290
|
-
d);h.manifest_.textStreams.push(v);h.onTracksChanged_();return z.return(shaka.util.StreamUtils.textStreamToTrack(v))}})};
|
|
1285
|
+
"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=
|
|
1286
|
+
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,
|
|
1287
|
+
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,
|
|
1288
|
+
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,
|
|
1289
|
+
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))}})};
|
|
1291
1290
|
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);
|
|
1292
1291
|
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,
|
|
1293
1292
|
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);
|
|
@@ -1349,9 +1348,10 @@ shaka.Player.prototype.onMediaQualityChange_=function(a,b){a={bandwidth:a.bandwi
|
|
|
1349
1348
|
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)};
|
|
1350
1349
|
shaka.Player.prototype.onVideoError_=function(a){if(a=this.videoErrorToShakaError_())this.onError_(a)};
|
|
1351
1350
|
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.");
|
|
1352
|
-
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,
|
|
1353
|
-
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_())}};
|
|
1354
|
-
shaka.Player.prototype.
|
|
1351
|
+
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,
|
|
1352
|
+
(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_())}};
|
|
1353
|
+
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()};
|
|
1354
|
+
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))};
|
|
1355
1355
|
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=
|
|
1356
1356
|
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);};
|
|
1357
1357
|
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);};
|
|
@@ -1373,7 +1373,7 @@ goog.exportProperty(shaka.Player.prototype,"isInProgress",shaka.Player.prototype
|
|
|
1373
1373
|
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);
|
|
1374
1374
|
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);
|
|
1375
1375
|
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);
|
|
1376
|
-
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.7.
|
|
1376
|
+
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.7.7-debug";
|
|
1377
1377
|
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_++};
|
|
1378
1378
|
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()};
|
|
1379
1379
|
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()};
|
|
@@ -2318,8 +2318,8 @@ shaka.offline.Storage.prototype.store=function(a,b,c){var d=this;goog.asserts.as
|
|
|
2318
2318
|
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)};
|
|
2319
2319
|
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,
|
|
2320
2320
|
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,
|
|
2321
|
-
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,
|
|
2322
|
-
break}return y.yield(g.stop(),
|
|
2321
|
+
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,
|
|
2322
|
+
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;}})};
|
|
2323
2323
|
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,D,H,C,G,E;return $jscomp.asyncExecutePromiseGeneratorProgram(function(F){if(1==F.nextAddress){A={};B=$jscomp.makeIterator(y);for(D=B.next();!D.done;A={$jscomp$loop$prop$download$780$922:A.$jscomp$loop$prop$download$780$922},D=B.next())A.$jscomp$loop$prop$download$780$922=
|
|
2324
2324
|
D.value,H=A.$jscomp$loop$prop$download$780$922.makeSegmentRequest(e),C=A.$jscomp$loop$prop$download$780$922.estimateId,G=A.$jscomp$loop$prop$download$780$922.isInitSegment,E=function(I){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=I.$jscomp$loop$prop$download$780$922.ref;L=shaka.offline.DownloadInfo.idForSegmentRef(M);l[L]=K[0];m+=J.byteLength;O.jumpToEnd()})}}(A),
|
|
2325
2325
|
d.queue(A.$jscomp$loop$prop$download$780$922.groupId,H,C,G,E);return F.yield(d.waitToFinish(),2)}if(!z)return F.jumpTo(0);k.ensureNotDestroyed_();k.setManifestDrmFields_(g,c,h,e);return F.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}),
|
|
@@ -2382,10 +2382,10 @@ a);document.addEventListener("MSFullscreenError",a)}};shaka.polyfill.Fullscreen.
|
|
|
2382
2382
|
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=
|
|
2383
2383
|
{}),shaka.polyfill.MediaCapabilities.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=shaka.polyfill.MediaCapabilities.decodingInfo_)};
|
|
2384
2384
|
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):
|
|
2385
|
-
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&&(
|
|
2386
|
-
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,
|
|
2387
|
-
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,
|
|
2388
|
-
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)}})};
|
|
2385
|
+
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),
|
|
2386
|
+
!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,
|
|
2387
|
+
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,
|
|
2388
|
+
[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)}})};
|
|
2389
2389
|
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");
|
|
2390
2390
|
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);
|
|
2391
2391
|
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(){};
|