shaka-player 4.8.18 → 4.8.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/locales.js +36 -36
- package/dist/shaka-player.compiled.debug.js +10 -9
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +125 -125
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.debug.js +13 -12
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +120 -120
- package/dist/shaka-player.ui.map +2 -2
- package/externs/shaka/player.js +2 -2
- package/lib/dash/mpd_utils.js +3 -3
- package/lib/media/streaming_engine.js +5 -0
- package/lib/player.js +1 -1
- package/lib/util/manifest_parser_utils.js +1 -0
- package/package.json +1 -1
|
@@ -236,7 +236,7 @@ encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(
|
|
|
236
236
|
shaka.util.ManifestParserUtils.guessCodecs=function(a,b){if(1==b.length)return b[0];a=shaka.util.ManifestParserUtils.guessCodecsSafe(a,b);if(null!=a)return a;throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,b);};
|
|
237
237
|
shaka.util.ManifestParserUtils.guessCodecsSafe=function(a,b){for(var c=$jscomp.makeIterator(shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_[a]),d=c.next();!d.done;d=c.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==shaka.util.ManifestParserUtils.ContentType.TEXT?"":null};
|
|
238
238
|
shaka.util.ManifestParserUtils.guessAllCodecsSafe=function(a,b){var c=[];a=$jscomp.makeIterator(shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_[a]);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=$jscomp.makeIterator(b),f=e.next();!f.done;f=e.next())f=f.value,d.test(f.trim())&&c.push(f.trim())}return c};shaka.util.ManifestParserUtils.ContentType={VIDEO:"video",AUDIO:"audio",TEXT:"text",IMAGE:"image",APPLICATION:"application"};
|
|
239
|
-
shaka.util.ManifestParserUtils.TextStreamKind={SUBTITLE:"subtitle",CLOSED_CAPTION:"caption"};shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS=1/15;shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_=[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/];shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_=[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/];
|
|
239
|
+
shaka.util.ManifestParserUtils.TextStreamKind={SUBTITLE:"subtitle",CLOSED_CAPTION:"caption"};shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS=1/15;shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_=[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/];shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_=[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/];
|
|
240
240
|
shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_=[/^vtt$/,/^wvtt/,/^stpp/];shaka.util.ManifestParserUtils.CODEC_REGEXPS_BY_CONTENT_TYPE_={audio:shaka.util.ManifestParserUtils.AUDIO_CODEC_REGEXPS_,video:shaka.util.ManifestParserUtils.VIDEO_CODEC_REGEXPS_,text:shaka.util.ManifestParserUtils.TEXT_CODEC_REGEXPS_};shaka.util.LanguageUtils=function(){};shaka.util.LanguageUtils.areLocaleCompatible=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);return a==b};shaka.util.LanguageUtils.areLanguageCompatible=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);a=c.disassembleLocale_(a);b=c.disassembleLocale_(b);return a[0]==b[0]};
|
|
241
241
|
shaka.util.LanguageUtils.isParentOf=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);a=c.disassembleLocale_(a);b=c.disassembleLocale_(b);return a[0]==b[0]&&1==a.length&&2==b.length};shaka.util.LanguageUtils.isSiblingOf=function(a,b){var c=shaka.util.LanguageUtils;a=c.normalize(a);b=c.normalize(b);a=c.disassembleLocale_(a);b=c.disassembleLocale_(b);return 2==a.length&&2==b.length&&a[0]==b[0]};
|
|
242
242
|
shaka.util.LanguageUtils.normalize=function(a){var b=shaka.util.LanguageUtils;a=$jscomp.makeIterator(a.split("-x-"));var c=a.next().value;c=void 0===c?"":c;a=a.next().value;a=void 0===a?"":a;var d=$jscomp.makeIterator(c.split("-"));c=d.next().value;c=void 0===c?"":c;d=d.next().value;d=void 0===d?"":d;a=a?"x-"+a:"";c=c.toLowerCase();c=b.isoMap_.get(c)||c;b=d.toUpperCase();return""+(b?c+"-"+b:c)+(a?"-"+a:"")};
|
|
@@ -325,9 +325,9 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
|
|
|
325
325
|
"\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",
|
|
326
326
|
"\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"],
|
|
327
327
|
["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"]]))};
|
|
328
|
-
shaka.ui.Locales.Ids={PLAYBACK_RATE:"PLAYBACK_RATE",
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
shaka.ui.Locales.Ids={AUTO_QUALITY:"AUTO_QUALITY",PLAYBACK_RATE:"PLAYBACK_RATE",OFF:"OFF",ON:"ON",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",FAST_FORWARD:"FAST_FORWARD",QUALITY:"QUALITY",RECENTER_VR:"RECENTER_VR",SUBTITLE_FORCED:"SUBTITLE_FORCED",PLAY:"PLAY",SKIP_AD:"SKIP_AD",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",AD_PROGRESS:"AD_PROGRESS",AD_TIME:"AD_TIME",AD_DURATION:"AD_DURATION",LIVE:"LIVE",SKIP_TO_LIVE:"SKIP_TO_LIVE",MUTE:"MUTE",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",LOOP:"LOOP",SURROUND:"SURROUND",
|
|
329
|
+
NOT_APPLICABLE:"NOT_APPLICABLE",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",FULL_SCREEN:"FULL_SCREEN",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",MORE_SETTINGS:"MORE_SETTINGS",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",AIRPLAY:"AIRPLAY",REPLAY:"REPLAY",REWIND:"REWIND",VOLUME:"VOLUME",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",CAST:"CAST",LANGUAGE:"LANGUAGE",SEEK:"SEEK",BACK:"BACK",PAUSE:"PAUSE",RESOLUTION:"RESOLUTION",STATISTICS:"STATISTICS",
|
|
330
|
+
UNMUTE:"UNMUTE",CAPTIONS:"CAPTIONS",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",AD_STATISTICS:"AD_STATISTICS"};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)};
|
|
331
331
|
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)};
|
|
332
332
|
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.util.EventManager=function(){this.bindingMap_=new shaka.util.MultiMap};shaka.util.EventManager.prototype.release=function(){this.removeAll();this.bindingMap_=null};shaka.util.EventManager.prototype.listen=function(a,b,c,d){this.bindingMap_&&(a=new shaka.util.EventManager.Binding_(a,b,c,d),this.bindingMap_.push(b,a))};shaka.util.EventManager.prototype.listenOnce=function(a,b,c,d){var e=this,f=function(g){e.unlisten(a,b,f);c(g)};this.listen(a,b,f,d)};
|
|
333
333
|
shaka.util.EventManager.prototype.unlisten=function(a,b,c){if(this.bindingMap_){var d=this.bindingMap_.get(b)||[];d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.unlisten(),this.bindingMap_.remove(b,e))}};shaka.util.EventManager.prototype.removeAll=function(){if(this.bindingMap_){var a=this.bindingMap_.getAll();a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b.value.unlisten();this.bindingMap_.clear()}};
|
|
@@ -993,11 +993,12 @@ shaka.media.QualityObserver.prototype.poll=function(a,b){b=$jscomp.makeIterator(
|
|
|
993
993
|
d],["position",a]])),this.dispatchEvent(c))}};shaka.media.QualityObserver.prototype.positionIsBuffered_=function(a,b){if((b=this.getBufferedInfo_()[b])&&0<b.length){var c=b[b.length-1].end;if(a>=b[0].start&&a<c)return!0}return!1};
|
|
994
994
|
shaka.media.QualityObserver.prototype.purgeQualityChangePositions_=function(a){var b=this.getBufferedInfo_()[a.contentType];if(b&&0<b.length){var c=b[0].start,d=b[b.length-1].end,e=a.qualityChangePositions;a.qualityChangePositions=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else a.qualityChangePositions=[]};shaka.util.Networking=function(){};shaka.util.Networking.createSegmentRequest=function(a,b,c,d,e){a=shaka.net.NetworkingEngine.makeRequest(a,d,e);if(0!=b||null!=c)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a};shaka.media.StreamingEngine=function(a,b){var c=this;this.playerInterface_=b;this.manifest_=a;this.config_=null;this.bufferingGoalScale_=1;this.currentTextStream_=this.currentVariant_=null;this.textStreamSequenceId_=0;this.parsedPrftEventRaised_=!1;this.mediaStates_=new Map;this.startupComplete_=!1;this.failureCallbackBackoff_=null;this.fatalError_=!1;this.destroyer_=new shaka.util.Destroyer(function(){return c.doDestroy_()});this.lastMediaSourceReset_=Date.now()/1E3;this.audioPrefetchMap_=new Map;
|
|
995
995
|
this.spatialVideoInfo_={projection:null,hfov:null};this.playRangeStart_=0;this.playRangeEnd_=Infinity};shaka.media.StreamingEngine.prototype.destroy=function(){return this.destroyer_.destroy()};
|
|
996
|
-
shaka.media.StreamingEngine.prototype.doDestroy_=function(){var a=this,b,c,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress){b=[];c=$jscomp.makeIterator(a.mediaStates_.values());for(d=c.next();!d.done;d=c.next())e=d.value,a.cancelUpdate_(e),b.push(a.abortOperations_(e));f=$jscomp.makeIterator(a.audioPrefetchMap_.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.clearAll();return k.yield(Promise.all(b),
|
|
997
|
-
a.playerInterface_=null;a.manifest_=null;a.config_=null;k.jumpToEnd()})};
|
|
996
|
+
shaka.media.StreamingEngine.prototype.doDestroy_=function(){var a=this,b,c,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress){b=[];c=$jscomp.makeIterator(a.mediaStates_.values());for(d=c.next();!d.done;d=c.next())e=d.value,a.cancelUpdate_(e),b.push(a.abortOperations_(e)),e.segmentPrefetch&&(e.segmentPrefetch.clearAll(),e.segmentPrefetch=null);f=$jscomp.makeIterator(a.audioPrefetchMap_.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.clearAll();return k.yield(Promise.all(b),
|
|
997
|
+
2)}a.mediaStates_.clear();a.audioPrefetchMap_.clear();a.playerInterface_=null;a.manifest_=null;a.config_=null;k.jumpToEnd()})};
|
|
998
998
|
shaka.media.StreamingEngine.prototype.configure=function(a){this.config_=a;this.failureCallbackBackoff_=new shaka.net.Backoff({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);var b=shaka.util.ManifestParserUtils.ContentType;if(a.disableAudioPrefetch){var c=this.mediaStates_.get(b.AUDIO);c&&c.segmentPrefetch&&(c.segmentPrefetch.clearAll(),
|
|
999
999
|
c.segmentPrefetch=null);c=$jscomp.makeIterator(this.audioPrefetchMap_.keys());for(var d=c.next();!d.done;d=c.next())d=d.value,this.audioPrefetchMap_.get(d).clearAll(),this.audioPrefetchMap_.delete(d)}a.disableTextPrefetch&&(c=this.mediaStates_.get(b.TEXT))&&c.segmentPrefetch&&(c.segmentPrefetch.clearAll(),c.segmentPrefetch=null);a.disableVideoPrefetch&&(b=this.mediaStates_.get(b.VIDEO))&&b.segmentPrefetch&&(b.segmentPrefetch.clearAll(),b.segmentPrefetch=null);b=$jscomp.makeIterator(this.mediaStates_.keys());
|
|
1000
|
-
for(c=b.next();!c.done;c=b.next())c=this.mediaStates_.get(c.value),c.segmentPrefetch?(c.segmentPrefetch.resetLimit(a.segmentPrefetchLimit),0<a.segmentPrefetchLimit||(c.segmentPrefetch=null)):0<a.segmentPrefetchLimit&&(c.segmentPrefetch=this.createSegmentPrefetch_(c.stream));a.disableAudioPrefetch||this.updatePrefetchMapForAudio_()};
|
|
1000
|
+
for(c=b.next();!c.done;c=b.next())c=this.mediaStates_.get(c.value),c.segmentPrefetch?(c.segmentPrefetch.resetLimit(a.segmentPrefetchLimit),0<a.segmentPrefetchLimit||(c.segmentPrefetch.clearAll(),c.segmentPrefetch=null)):0<a.segmentPrefetchLimit&&(c.segmentPrefetch=this.createSegmentPrefetch_(c.stream));a.disableAudioPrefetch||this.updatePrefetchMapForAudio_()};
|
|
1001
|
+
shaka.media.StreamingEngine.prototype.applyPlayRange=function(a,b){this.manifest_.presentationTimeline.isLive()||(this.playRangeStart_=a,this.playRangeEnd_=b)};
|
|
1001
1002
|
shaka.media.StreamingEngine.prototype.start=function(a){var b=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return goog.asserts.assert(b.config_,"StreamingEngine configure() must be called before init()!"),c.yield(b.initStreams_(a||new Map),2);b.destroyer_.ensureNotDestroyed();shaka.log.debug("init: completed initial Stream setup");b.startupComplete_=!0;c.jumpToEnd()})};shaka.media.StreamingEngine.prototype.getCurrentVariant=function(){return this.currentVariant_};
|
|
1002
1003
|
shaka.media.StreamingEngine.prototype.getCurrentTextStream=function(){return this.currentTextStream_};
|
|
1003
1004
|
shaka.media.StreamingEngine.prototype.loadNewTextStream_=function(a){var b=this,c,d,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){switch(l.nextAddress){case 1:return c=shaka.util.ManifestParserUtils.ContentType,goog.asserts.assert(!b.mediaStates_.has(c.TEXT),"Should not call loadNewTextStream_ while streaming text!"),b.textStreamSequenceId_++,d=b.textStreamSequenceId_,l.setCatchFinallyBlocks(2),l.yield(b.playerInterface_.mediaSourceEngine.clear(c.TEXT),4);case 4:l.leaveTryBlock(3);
|
|
@@ -1488,7 +1489,7 @@ goog.exportProperty(shaka.Player.prototype,"getAssetUri",shaka.Player.prototype.
|
|
|
1488
1489
|
goog.exportProperty(shaka.Player.prototype,"resetConfiguration",shaka.Player.prototype.resetConfiguration);goog.exportProperty(shaka.Player.prototype,"getBufferFullness",shaka.Player.prototype.getBufferFullness);goog.exportProperty(shaka.Player.prototype,"getConfiguration",shaka.Player.prototype.getConfiguration);goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.configure);goog.exportProperty(shaka.Player.prototype,"releaseAllMutexes",shaka.Player.prototype.releaseAllMutexes);
|
|
1489
1490
|
goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);
|
|
1490
1491
|
goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);goog.exportProperty(shaka.Player.prototype,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);
|
|
1491
|
-
goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.8.
|
|
1492
|
+
goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v4.8.19-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);
|
|
1492
1493
|
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_++};
|
|
1493
1494
|
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()};
|
|
1494
1495
|
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()};
|
|
@@ -1839,10 +1840,10 @@ shaka.dash.ContentProtection.DashIfNamespaceUri_="https://dashif.org/CPS";shaka.
|
|
|
1839
1840
|
shaka.dash.MpdUtils.fillUriTemplate=function(a,b,c,d,e,f){var g={RepresentationID:b,Number:c,SubNumber:d,Bandwidth:e,Time:f};return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(h,k,l,m){if("$$"==h)return"$";var n=g[k];goog.asserts.assert(void 0!==n,"Unrecognized identifier");if(null==n)return shaka.log.warning("URL template does not have an available substitution for ",'identifier "'+k+'":',a),h;"RepresentationID"==k&&l&&(shaka.log.warning("URL template should not contain a width specifier for identifier",
|
|
1840
1841
|
'"RepresentationID":',a),l=void 0);"Time"==k&&"bigint"!=typeof n&&(goog.asserts.assert("number"==typeof n,"Time value should be a number or bigint!"),.2<=Math.abs(n-Math.round(n))&&shaka.log.alwaysWarn("Calculated $Time$ values must be close to integers"),n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":h=n.toString();break;case "o":h=n.toString(8);break;case "x":h=n.toString(16);break;case "X":h=n.toString(16).toUpperCase();break;default:goog.asserts.assert(!1,"Unhandled format specifier"),
|
|
1841
1842
|
h=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-h.length)+1).join("0")+h})};
|
|
1842
|
-
shaka.dash.MpdUtils.createTimeline=function(a,b,c,d,e){goog.asserts.assert(0<b&&Infinity>b,"timescale must be a positive, finite integer");goog.asserts.assert(0<d,"period duration must be a positive integer");var f=shaka.util.TXml;a=f.findChildren(a,"S");for(var g=[],h=-c,k=0;k<a.length;++k){var l=a[k],m=a[k+1],n=f.parseAttr(l,"t",f.parseNonNegativeInt),p=f.parseAttr(l,"d",f.parseNonNegativeInt),q=f.parseAttr(l,"r",f.parseInt),r=f.parseAttr(l,"k",f.parseInt)||0;null!=n&&(n-=c);if(
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1843
|
+
shaka.dash.MpdUtils.createTimeline=function(a,b,c,d,e){goog.asserts.assert(0<b&&Infinity>b,"timescale must be a positive, finite integer");goog.asserts.assert(0<d,"period duration must be a positive integer");var f=shaka.util.TXml;a=f.findChildren(a,"S");for(var g=[],h=-c,k=0;k<a.length;++k){var l=a[k],m=a[k+1],n=f.parseAttr(l,"t",f.parseNonNegativeInt),p=f.parseAttr(l,"d",f.parseNonNegativeInt),q=f.parseAttr(l,"r",f.parseInt),r=f.parseAttr(l,"k",f.parseInt)||0;null!=n&&(n-=c);if(p){n=null!=n?n:h;
|
|
1844
|
+
q=q||0;if(0>q)if(m){m=f.parseAttr(m,"t",f.parseNonNegativeInt);if(null==m){shaka.log.warning('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:','ignoring the remaining "S" elements.',l);break}else if(n>=m){shaka.log.warning('An "S" element cannot have a negative repeatif its start ','time exceeds the next "S" element\'s start time:','ignoring the remaining "S" elements.',l);break}q=Math.ceil((m-n)/p)-1}else{if(Infinity==d){shaka.log.warning('The last "S" element cannot have a negative repeat',
|
|
1845
|
+
"if the Period has an infinite duration:",'ignoring the last "S" element.',l);break}else if(n/b>=d){shaka.log.warning('The last "S" element cannot have a negative repeat',"if its start time exceeds the Period's duration:",'igoring the last "S" element.',l);break}q=Math.ceil((d*b-n)/p)-1}0<g.length&&n!=h&&(Math.abs((n-h)/b)>=shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS&&shaka.log.warning("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",l),g[g.length-
|
|
1846
|
+
1].end=n/b);for(l=0;l<=q;++l)h=n+p,g.push({start:n/b,end:h/b,unscaledStart:n,partialSegments:r,segmentPosition:g.length+e}),n=h}else shaka.log.warning('"S" element must have a duration: ignoring this element.',l)}return g};
|
|
1846
1847
|
shaka.dash.MpdUtils.parseSegmentInfo=function(a,b){goog.asserts.assert(b(a.representation),"There must be at least one element of the given type.");var c=shaka.dash.MpdUtils,d=shaka.util.TXml,e=c.inheritAttribute(a,b,"timescale"),f=1;e&&(f=d.parsePositiveInt(e)||1);e=c.inheritAttribute(a,b,"duration");(e=d.parsePositiveInt(e||""))&&(e/=f);var g=c.inheritAttribute(a,b,"startNumber"),h=Number(c.inheritAttribute(a,b,"presentationTimeOffset"))||0;d=d.parseNonNegativeInt(g||"");if(null==g||null==d)d=1;
|
|
1847
1848
|
b=c.inheritChild(a,b,"SegmentTimeline");g=null;b&&(g=c.createTimeline(b,f,h,a.periodInfo.duration||Infinity,d));return{timescale:f,segmentDuration:e,startNumber:d,scaledPresentationTimeOffset:h/f||0,unscaledPresentationTimeOffset:h,timeline:g}};shaka.dash.MpdUtils.getNodes=function(a,b){var c=shaka.util.Functional;goog.asserts.assert(b(a.representation),"There must be at least one element of the given type");return[b(a.representation),b(a.adaptationSet),b(a.period)].filter(c.isNotNull)};
|
|
1848
1849
|
shaka.dash.MpdUtils.inheritAttribute=function(a,b,c){b=shaka.dash.MpdUtils.getNodes(a,b);a=null;b=$jscomp.makeIterator(b);for(var d=b.next();!d.done&&!(a=d.value.attributes[c]);d=b.next());return a};shaka.dash.MpdUtils.inheritChild=function(a,b,c){var d=shaka.dash.MpdUtils.getNodes(a,b);a=shaka.util.TXml;b=null;d=$jscomp.makeIterator(d);for(var e=d.next();!e.done&&!(b=a.findChild(e.value,c));e=d.next());return b};
|