shaka-player 3.3.6 → 3.3.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.
@@ -279,8 +279,8 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
279
279
  "\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",
280
280
  "\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"],
281
281
  ["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"]]))};
282
- shaka.ui.Locales.Ids={PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",UNMUTE:"UNMUTE",AD_PROGRESS:"AD_PROGRESS",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",LIVE:"LIVE",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",SKIP_AD:"SKIP_AD",AUTO_QUALITY:"AUTO_QUALITY",FAST_FORWARD:"FAST_FORWARD",REPLAY:"REPLAY",LANGUAGE:"LANGUAGE",CAPTIONS:"CAPTIONS",OFF:"OFF",FULL_SCREEN:"FULL_SCREEN",REWIND:"REWIND",SUBTITLE_FORCED:"SUBTITLE_FORCED",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",STATISTICS:"STATISTICS",SEEK:"SEEK",VOLUME:"VOLUME",
283
- MUTE:"MUTE",PAUSE:"PAUSE",PLAY:"PLAY",SKIP_TO_LIVE:"SKIP_TO_LIVE",BACK:"BACK",AD_DURATION:"AD_DURATION",AD_TIME:"AD_TIME",CAST:"CAST",LOOP:"LOOP",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",RESOLUTION:"RESOLUTION",ON:"ON",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",PLAYBACK_RATE:"PLAYBACK_RATE",AIRPLAY:"AIRPLAY",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",NOT_APPLICABLE:"NOT_APPLICABLE",MORE_SETTINGS:"MORE_SETTINGS",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE"};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);c=b*(1-c)+c*this.estimate_;isNaN(c)||(this.estimate_=c,this.totalWeight_+=a)};
282
+ shaka.ui.Locales.Ids={AD_PROGRESS:"AD_PROGRESS",RESOLUTION:"RESOLUTION",AIRPLAY:"AIRPLAY",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",SUBTITLE_FORCED:"SUBTITLE_FORCED",LIVE:"LIVE",MORE_SETTINGS:"MORE_SETTINGS",PAUSE:"PAUSE",SEEK:"SEEK",REWIND:"REWIND",REPLAY:"REPLAY",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",AD_TIME:"AD_TIME",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",AD_DURATION:"AD_DURATION",FAST_FORWARD:"FAST_FORWARD",OFF:"OFF",ON:"ON",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",
283
+ MUTE:"MUTE",UNMUTE:"UNMUTE",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",AUTO_QUALITY:"AUTO_QUALITY",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",PLAY:"PLAY",LOOP:"LOOP",NOT_APPLICABLE:"NOT_APPLICABLE",BACK:"BACK",PLAYBACK_RATE:"PLAYBACK_RATE",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",SKIP_TO_LIVE:"SKIP_TO_LIVE",STATISTICS:"STATISTICS",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",FULL_SCREEN:"FULL_SCREEN",VOLUME:"VOLUME",LANGUAGE:"LANGUAGE",CAPTIONS:"CAPTIONS",CAST:"CAST",SKIP_AD:"SKIP_AD"};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);c=b*(1-c)+c*this.estimate_;isNaN(c)||(this.estimate_=c,this.totalWeight_+=a)};
284
284
  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)};
285
285
  shaka.abr.EwmaBandwidthEstimator.prototype.sample=function(a,b){if(!(b<this.minBytes_)){var c=8E3*b/a,d=a/1E3;this.bytesSampled_+=b;this.fast_.sample(d,c);this.slow_.sample(d,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.ArrayUtils=function(){};shaka.util.ArrayUtils.defaultEquals=function(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b};shaka.util.ArrayUtils.remove=function(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)};shaka.util.ArrayUtils.count=function(a,b){for(var c=0,d=$jscomp.makeIterator(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};
286
286
  shaka.util.ArrayUtils.hasSameElements=function(a,b,c){c||(c=shaka.util.ArrayUtils.defaultEquals);if(a.length!=b.length)return!1;b=b.slice();var d={};a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;d={$jscomp$loop$prop$item$620:d.$jscomp$loop$prop$item$620},e=a.next()){d.$jscomp$loop$prop$item$620=e.value;e=b.findIndex(function(f){return function(g){return c(f.$jscomp$loop$prop$item$620,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length};
@@ -371,7 +371,7 @@ shaka.util.StreamUtils.filterManifestByCurrentVariant=function(a,b){var c=shaka.
371
371
  shaka.util.StreamUtils.filterImageStreams_=function(a){a.imageStreams=a.imageStreams.filter(function(b){var c=["image/svg+xml","image/png","image/jpeg"],d=shaka.util.Platform;(d.isWebOS()||d.isTizen()||d.isChromecast())&&c.push("image/webp");(c=c.includes(b.mimeType))||shaka.log.debug("Dropping image stream. Is not supported by the platform.",b);return c})};shaka.util.StreamUtils.areStreamsCompatible_=function(a,b){return a.mimeType!=b.mimeType||a.codecs.split(".")[0]!=b.codecs.split(".")[0]?!1:!0};
372
372
  shaka.util.StreamUtils.variantToTrack=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=[];c&&g.push(c.mimeType);b&&g.push(b.mimeType);g=g[0]||null;var h=[];b&&h.push(b.kind);c&&h.push(c.kind);h=h[0]||null;var k=new Set;if(b)for(var l=$jscomp.makeIterator(b.roles),m=l.next();!m.done;m=l.next())k.add(m.value);if(c)for(l=$jscomp.makeIterator(c.roles),m=l.next();!m.done;m=l.next())k.add(m.value);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,
373
373
  language:a.language,label:null,kind:h,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:g,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(k),audioRoles:null,forced:!1,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null};c&&(a.videoId=c.id,a.originalVideoId=c.originalId,
374
- a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.pixelAspectRatio=c.pixelAspectRatio||null,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a};
374
+ a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.pixelAspectRatio=c.pixelAspectRatio||null,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,a.label=b.label,a.audioRoles=b.roles);return a};
375
375
  shaka.util.StreamUtils.textStreamToTrack=function(a){return{id:a.id,active:!1,type:shaka.util.ManifestParserUtils.ContentType.TEXT,bandwidth:0,language:a.language,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:a.mimeType,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,forced:a.forced,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,
376
376
  audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:a.originalId,originalImageId:null}};
377
377
  shaka.util.StreamUtils.imageStreamToTrack=function(a){var b=shaka.util.ManifestParserUtils.ContentType,c=a.width||null,d=a.height||null,e=null;a.segmentIndex&&(e=a.segmentIndex.get(0));var f=a.tilesLayout;e&&(f=e.getTilesLayout()||f);f&&null!=c&&(c/=Number(f.split("x")[0]));f&&null!=d&&(d/=Number(f.split("x")[1]));return{id:a.id,active:!1,type:b.IMAGE,bandwidth:a.bandwidth||0,language:"",label:null,kind:null,width:c,height:d,frameRate:null,pixelAspectRatio:null,hdr:null,mimeType:a.mimeType,codecs:null,
@@ -1154,7 +1154,7 @@ goog.exportProperty(shaka.Player.prototype,"configure",shaka.Player.prototype.co
1154
1154
  goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);goog.exportProperty(shaka.Player.prototype,"destroy",shaka.Player.prototype.destroy);
1155
1155
  shaka.Player.EventName={AbrStatusChanged:"abrstatuschanged",Adaptation:"adaptation",Buffering:"buffering",DownloadFailed:"downloadfailed",DownloadHeadersReceived:"downloadheadersreceived",DrmSessionUpdate:"drmsessionupdate",Emsg:"emsg",Error:"error",ExpirationUpdated:"expirationupdated",LargeGap:"largegap",Loaded:"loaded",Loading:"loading",ManifestParsed:"manifestparsed",MediaQualityChanged:"mediaqualitychanged",Metadata:"metadata",OnStateChange:"onstatechange",OnStateIdle:"onstateidle",RateChange:"ratechange",
1156
1156
  SessionDataEvent:"sessiondata",Streaming:"streaming",TextChanged:"textchanged",TextTrackVisibility:"texttrackvisibility",TimelineRegionAdded:"timelineregionadded",TimelineRegionEnter:"timelineregionenter",TimelineRegionExit:"timelineregionexit",TracksChanged:"trackschanged",Unloading:"unloading",VariantChanged:"variantchanged"};shaka.Player.LoadMode={DESTROYED:0,NOT_LOADED:1,MEDIA_SOURCE:2,SRC_EQUALS:3};goog.exportProperty(shaka.Player,"LoadMode",shaka.Player.LoadMode);
1157
- shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v3.3.6-debug";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;
1157
+ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_=.5;shaka.Player.version="v3.3.7-debug";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;
1158
1158
  shaka.Player.SRC_EQUAL_EXTENSIONS_TO_MIME_TYPES_={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mpd:"application/dash+xml",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"};
1159
1159
  shaka.Player.TEXT_EXTENSIONS_TO_MIME_TYPES_={sbv:"text/x-subviewer",srt:"text/srt",vtt:"text/vtt",webvtt:"text/vtt",ttml:"application/ttml+xml",lrc:"application/x-subtitle-lrc",ssa:"text/x-ssa",ass:"text/x-ssa"};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_++};
1160
1160
  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){var c=this;this.ad_=a;this.manager_=b;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(){c.isPaused_=!0});this.eventManager_.listen(this.manager_,google.ima.AdEvent.Type.RESUMED,function(){c.isPaused_=!1})};shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};