shaka-player 4.8.8 → 4.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/locales.js +34 -34
- package/dist/shaka-player.compiled.debug.js +11 -11
- package/dist/shaka-player.compiled.debug.map +2 -2
- package/dist/shaka-player.compiled.js +916 -916
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.debug.js +14 -14
- package/dist/shaka-player.ui.debug.map +2 -2
- package/dist/shaka-player.ui.js +1089 -1089
- package/dist/shaka-player.ui.map +2 -2
- package/lib/cea/cea608_data_channel.js +9 -0
- package/lib/cea/cea_decoder.js +6 -2
- package/lib/media/manifest_filterer.js +8 -12
- package/lib/media/preload_manager.js +3 -10
- package/lib/player.js +1 -1
- package/package.json +1 -1
|
@@ -324,9 +324,9 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
|
|
|
324
324
|
"\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","\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN",
|
|
325
325
|
"\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"],["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["RESOLUTION","\u89e3\u6790\u5ea6"],
|
|
326
326
|
["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"]]))};
|
|
327
|
-
shaka.ui.Locales.Ids={
|
|
328
|
-
|
|
329
|
-
|
|
327
|
+
shaka.ui.Locales.Ids={QUALITY:"QUALITY",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",VOLUME:"VOLUME",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",LIVE:"LIVE",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",LOOP:"LOOP",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",MUTE:"MUTE",PAUSE:"PAUSE",PLAYBACK_RATE:"PLAYBACK_RATE",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",SKIP_TO_LIVE:"SKIP_TO_LIVE",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",NOT_APPLICABLE:"NOT_APPLICABLE",LANGUAGE:"LANGUAGE",SKIP_AD:"SKIP_AD",
|
|
328
|
+
UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",ON:"ON",AUTO_QUALITY:"AUTO_QUALITY",SURROUND:"SURROUND",RESOLUTION:"RESOLUTION",SEEK:"SEEK",STATISTICS:"STATISTICS",FULL_SCREEN:"FULL_SCREEN",UNMUTE:"UNMUTE",AD_DURATION:"AD_DURATION",AD_TIME:"AD_TIME",RECENTER_VR:"RECENTER_VR",BACK:"BACK",CAST:"CAST",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",MORE_SETTINGS:"MORE_SETTINGS",OFF:"OFF",PLAY:"PLAY",REPLAY:"REPLAY",REWIND:"REWIND",SUBTITLE_FORCED:"SUBTITLE_FORCED",
|
|
329
|
+
AD_PROGRESS:"AD_PROGRESS",FAST_FORWARD:"FAST_FORWARD",CAPTIONS:"CAPTIONS",AIRPLAY:"AIRPLAY"};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)};
|
|
330
330
|
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)};
|
|
331
331
|
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)};
|
|
332
332
|
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()}};
|
|
@@ -664,8 +664,8 @@ b.next();!a.done;a=b.next())a=a.value,c.set(a,d),d+=a.length;this.newInitData("c
|
|
|
664
664
|
Copyright 2023 Google LLC
|
|
665
665
|
SPDX-License-Identifier: Apache-2.0
|
|
666
666
|
*/
|
|
667
|
-
shaka.media.ManifestFilterer=function(a,b,c){goog.asserts.assert(a,"Must have config");this.config_=a;this.maxHwRes_=b;this.drmEngine_=c};shaka.media.ManifestFilterer.prototype.setDrmEngine=function(a){this.drmEngine_=a};
|
|
668
|
-
shaka.media.ManifestFilterer.prototype.
|
|
667
|
+
shaka.media.ManifestFilterer=function(a,b,c){goog.asserts.assert(a,"Must have config");this.config_=a;this.maxHwRes_=b;this.drmEngine_=c};shaka.media.ManifestFilterer.prototype.setDrmEngine=function(a){this.drmEngine_=a};
|
|
668
|
+
shaka.media.ManifestFilterer.prototype.filterManifest=function(a){var b=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(c){if(1==c.nextAddress)return goog.asserts.assert(a,"Manifest should exist!"),c.yield(shaka.util.StreamUtils.filterManifest(b.drmEngine_,a,b.config_.drm.preferredKeySystems),2);shaka.util.StreamUtils.chooseCodecsAndFilterManifest(a,b.config_.preferredVideoCodecs,b.config_.preferredAudioCodecs,b.config_.preferredDecodingAttributes);b.checkPlayableVariants_(a);return c.return(b.filterManifestWithRestrictions(a))})};
|
|
669
669
|
shaka.media.ManifestFilterer.prototype.applyRestrictions=function(a){return shaka.util.StreamUtils.applyRestrictions(a.variants,this.config_.restrictions,this.maxHwRes_)};
|
|
670
670
|
shaka.media.ManifestFilterer.prototype.filterManifestWithRestrictions=function(a){var b=this.applyRestrictions(a);if(a){var c=this.drmEngine_?this.drmEngine_.getDrmInfo():null;if(c&&this.drmEngine_.getMediaKeys())for(var d=$jscomp.makeIterator(a.variants),e=d.next();!e.done;e=d.next())e=e.value,this.processDrmInfos(c.keySystem,e.video),this.processDrmInfos(c.keySystem,e.audio);this.checkRestrictedVariants(a)}return b};
|
|
671
671
|
shaka.media.ManifestFilterer.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);};
|
|
@@ -1142,12 +1142,12 @@ shaka.media.PreloadManager.prototype.onError=function(a){a.severity===shaka.util
|
|
|
1142
1142
|
shaka.media.PreloadManager.prototype.makeEvent_=function(a,b){return new shaka.util.FakeEvent(a,b)};
|
|
1143
1143
|
shaka.media.PreloadManager.prototype.parseManifestInner_=function(){var a=this,b,c,d,e,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){if(1==g.nextAddress){a.makeStateChangeEvent_("manifest-parser");a.parser_||(a.parserFactory_=shaka.media.ManifestParser.getFactory(a.assetUri_,a.mimeType_),goog.asserts.assert(a.parserFactory_,"Must have manifest parser"),a.parser_=a.parserFactory_(),a.parser_.configure(a.config_.manifest));b=Date.now()/1E3;a.makeStateChangeEvent_("manifest");if(a.manifest_)return g.jumpTo(2);
|
|
1144
1144
|
c=a;return g.yield(a.parser_.start(a.assetUri_,a.manifestPlayerInterface_),3)}2!=g.nextAddress&&(c.manifest_=g.yieldResult);d=a.makeEvent_(shaka.util.FakeEvent.EventName.ManifestParsed);a.dispatchEvent(d);if(0==a.manifest_.variants.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.NO_VARIANTS);shaka.media.PreloadManager.filterForAVVariants_(a.manifest_);e=Date.now()/1E3;f=e-b;a.stats_.setManifestTime(f);g.jumpToEnd()})};
|
|
1145
|
-
shaka.media.PreloadManager.prototype.initializeDrmInner_=function(){var a=this,b,c,d,e,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(
|
|
1146
|
-
break}
|
|
1147
|
-
case
|
|
1145
|
+
shaka.media.PreloadManager.prototype.initializeDrmInner_=function(){var a=this,b,c,d,e,f,g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){switch(h.nextAddress){case 1:return goog.asserts.assert(a.manifest_,"The manifest should already be parsed."),a.makeStateChangeEvent_("drm-engine"),a.startTimeOfDrm_=Date.now()/1E3,a.drmEngine_=a.createDrmEngine_(),a.manifestFilterer_.setDrmEngine(a.drmEngine_),a.drmEngine_.configure(a.config_.drm),b=a.manifestFilterer_.applyRestrictions(a.manifest_),
|
|
1146
|
+
h.yield(a.manifestFilterer_.filterManifest(a.manifest_),2);case 2:c=h.yieldResult;if(!b&&!c){h.jumpTo(3);break}d=a.makeEvent_(shaka.util.FakeEvent.EventName.TracksChanged);return h.yield(Promise.resolve(),4);case 4:a.dispatchEvent(d);case 3:return e=shaka.util.StreamUtils.getPlayableVariants(a.manifest_.variants),h.yield(a.drmEngine_.initForPlayback(e,a.manifest_.offlineSessionIds),5);case 5:return h.yield(a.manifestFilterer_.filterManifest(a.manifest_),6);case 6:f=h.yieldResult;if(!f){h.jumpTo(0);
|
|
1147
|
+
break}g=a.makeEvent_(shaka.util.FakeEvent.EventName.TracksChanged);return h.yield(Promise.resolve(),8);case 8:a.dispatchEvent(g),h.jumpToEnd()}})};shaka.media.PreloadManager.prototype.reconfigure=function(a){this.config_=a};shaka.media.PreloadManager.prototype.configure=function(a,b){a=shaka.util.ConfigUtils.convertToConfigObject(a,b);shaka.util.PlayerConfiguration.mergeConfigObjects(this.config_,a)};shaka.media.PreloadManager.prototype.getConfiguration=function(){return shaka.util.ObjectUtils.cloneObject(this.config_)};
|
|
1148
1148
|
shaka.media.PreloadManager.prototype.chooseInitialVariantInner_=function(){goog.asserts.assert(this.manifest_,"The manifest should already be parsed.");this.currentAdaptationSetCriteria_||(this.currentAdaptationSetCriteria_=new shaka.media.PreferenceBasedCriteria(this.config_.preferredAudioLanguage,this.config_.preferredVariantRole,this.config_.preferredAudioChannelCount,this.config_.preferredVideoHdrLevel,this.config_.preferSpatialAudio,this.config_.preferredVideoLayout,this.config_.preferredAudioLabel,
|
|
1149
|
-
this.config_.preferredVideoLabel,this.config_.mediaSource.codecSwitchingStrategy,this.config_.manifest.dash.enableAudioGroups)
|
|
1150
|
-
|
|
1149
|
+
this.config_.preferredVideoLabel,this.config_.mediaSource.codecSwitchingStrategy,this.config_.manifest.dash.enableAudioGroups));if(this.allowMakeAbrManager_){var a=this.config_.abrFactory;this.abrManagerFactory_=a;this.abrManager_=a();this.abrManager_.configure(this.config_.abr)}if(this.allowPrefetch_){a=this.manifest_.presentationTimeline.isLive();var b=shaka.util.StreamUtils.getPlayableVariants(this.manifest_.variants);b=this.currentAdaptationSetCriteria_.create(b);this.abrManager_.configure(this.config_.abr);
|
|
1150
|
+
this.abrManager_.setVariants(Array.from(b.values()));if(b=this.abrManager_.chooseVariant(!0))this.prefetchedVariant_=b,b.video&&this.makePrefetchForStream_(b.video,a),b.audio&&this.makePrefetchForStream_(b.audio,a)}};
|
|
1151
1151
|
shaka.media.PreloadManager.prototype.makePrefetchForStream_=function(a,b){var c=this,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress)return d=c.config_.streaming.segmentPrefetchLimit||2,e=new shaka.media.SegmentPrefetch(d,a,function(l,m,n){return shaka.media.StreamingEngine.dispatchFetch(l,m,n||null,c.config_.streaming.retryParameters,c.networkingEngine_)}),c.segmentPrefetchById_.set(a.id,e),k.yield(a.createSegmentIndex(),2);f=c.startTime_||0;(h=(g=a.segmentIndex.getIteratorForTime(f))?
|
|
1152
1152
|
g.current():null)||(h=a.segmentIndex.get(0));h&&(b?h.initSegmentReference&&e.prefetchInitSegment(h.initSegmentReference):e.prefetchSegmentsByTime(h.startTime));k.jumpToEnd()})};shaka.media.PreloadManager.prototype.waitForFinish=function(){return Promise.race([this.chooseInitialVariantPromise_,this.destroyPromise_])};
|
|
1153
1153
|
shaka.media.PreloadManager.prototype.destroy=function(){var a=this,b,c,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(e){switch(e.nextAddress){case 1:a.destroyed_=!0;if(!a.parser_||a.parserEntrusted_){e.jumpTo(2);break}return e.yield(a.parser_.stop(),2);case 2:if(!a.abrManager_||a.abrManagerEntrusted_){e.jumpTo(4);break}return e.yield(a.abrManager_.stop(),4);case 4:a.regionTimeline_&&!a.regionTimelineEntrusted_&&a.regionTimeline_.release();if(!a.drmEngine_||a.drmEngineEntrusted_){e.jumpTo(6);
|
|
@@ -1486,7 +1486,7 @@ goog.exportProperty(shaka.Player.prototype,"getAssetUri",shaka.Player.prototype.
|
|
|
1486
1486
|
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);
|
|
1487
1487
|
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);
|
|
1488
1488
|
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);
|
|
1489
|
-
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.
|
|
1489
|
+
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.9-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);
|
|
1490
1490
|
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_++};
|
|
1491
1491
|
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()};
|
|
1492
1492
|
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()};
|
|
@@ -1752,7 +1752,7 @@ shaka.cea.Cea608DataChannel.prototype.handleBasicNorthAmericanChar=function(a,b)
|
|
|
1752
1752
|
shaka.cea.Cea608DataChannel.prototype.handleControlCode=function(a){var b=a.ccData1,c=a.ccData2;if(this.lastcp_===(b<<8|c))return this.lastcp_=null;this.lastcp_=b<<8|c;if(this.isPAC_(b,c))this.controlPac_(b,c);else if(this.isMidrowStyleChange_(b,c))this.controlMidrow_(c);else if(this.isBackgroundAttribute_(b,c))this.controlBackgroundAttribute_(b,c);else if(this.isSpecialNorthAmericanChar_(b,c))this.curbuf_.addChar(shaka.cea.Cea608Memory.CharSet.SPECIAL_NORTH_AMERICAN,c);else if(this.isExtendedWesternEuropeanChar_(b,
|
|
1753
1753
|
c))this.handleExtendedWesternEuropeanChar_(b,c);else if(this.isMiscellaneous_(b,c))return this.controlMiscellaneous_(a);return null};shaka.cea.Cea608DataChannel.prototype.isMiscellaneous_=function(a,b){return 20===(a&246)&&32===(b&240)};shaka.cea.Cea608DataChannel.prototype.isPAC_=function(a,b){return 16===(a&240)&&64===(b&192)};shaka.cea.Cea608DataChannel.prototype.isMidrowStyleChange_=function(a,b){return 17===(a&247)&&32===(b&240)};
|
|
1754
1754
|
shaka.cea.Cea608DataChannel.prototype.isBackgroundAttribute_=function(a,b){return 16===(a&247)&&32===(b&240)||23===(a&247)&&45===(b&255)};shaka.cea.Cea608DataChannel.prototype.isSpecialNorthAmericanChar_=function(a,b){return 17===(a&247)&&48===(b&240)};shaka.cea.Cea608DataChannel.prototype.isExtendedWesternEuropeanChar_=function(a,b){return 18===(a&246)&&32===(b&224)};shaka.cea.Cea608DataChannel.isControlCode=function(a){return 16===(a&112)};
|
|
1755
|
-
shaka.cea.Cea608DataChannel.MiscCmd_={RCL:32,BS:33,AOD:34,AON:35,DER:36,RU2:37,RU3:38,RU4:39,FON:40,RDC:41,TR:42,RTD:43,EDM:44,CR:45,ENM:46,EOC:47};shaka.cea.Cea608DataChannel.CaptionType={NONE:0,POPON:1,PAINTON:2,ROLLUP:3,TEXT:4};shaka.cea.Cea608DataChannel.BG_COLORS="black green blue cyan red yellow magenta black".split(" ");shaka.cea.Cea608DataChannel.TEXT_COLORS="white green blue cyan red yellow magenta white_italics".split(" ");shaka.cea.Cea708Window=function(a,b){this.parentService_=b;this.windowNum_=a;this.relativeToggle_=this.visible_=!1;this.colCount_=this.rowCount_=this.anchorId_=this.verticalAnchor_=this.horizontalAnchor_=0;this.justification_=shaka.cea.Cea708Window.TextJustification.CENTER;this.memory_=[];this.col_=this.row_=this.startTime_=0;this.underline_=this.italics_=!1;this.textColor_=shaka.cea.CeaUtils.DEFAULT_TXT_COLOR;this.backgroundColor_=shaka.cea.CeaUtils.DEFAULT_BG_COLOR;this.resetMemory()};
|
|
1755
|
+
shaka.cea.Cea608DataChannel.isXdsControlCode=function(a){return 1<=a&&15>=a};shaka.cea.Cea608DataChannel.MiscCmd_={RCL:32,BS:33,AOD:34,AON:35,DER:36,RU2:37,RU3:38,RU4:39,FON:40,RDC:41,TR:42,RTD:43,EDM:44,CR:45,ENM:46,EOC:47};shaka.cea.Cea608DataChannel.CaptionType={NONE:0,POPON:1,PAINTON:2,ROLLUP:3,TEXT:4};shaka.cea.Cea608DataChannel.BG_COLORS="black green blue cyan red yellow magenta black".split(" ");shaka.cea.Cea608DataChannel.TEXT_COLORS="white green blue cyan red yellow magenta white_italics".split(" ");shaka.cea.Cea708Window=function(a,b){this.parentService_=b;this.windowNum_=a;this.relativeToggle_=this.visible_=!1;this.colCount_=this.rowCount_=this.anchorId_=this.verticalAnchor_=this.horizontalAnchor_=0;this.justification_=shaka.cea.Cea708Window.TextJustification.CENTER;this.memory_=[];this.col_=this.row_=this.startTime_=0;this.underline_=this.italics_=!1;this.textColor_=shaka.cea.CeaUtils.DEFAULT_TXT_COLOR;this.backgroundColor_=shaka.cea.CeaUtils.DEFAULT_BG_COLOR;this.resetMemory()};
|
|
1756
1756
|
shaka.cea.Cea708Window.prototype.defineWindow=function(a,b,c,d,e,f,g){this.visible_=a;this.verticalAnchor_=b;this.horizontalAnchor_=c;this.anchorId_=d;this.relativeToggle_=e;this.rowCount_=f;this.colCount_=g};shaka.cea.Cea708Window.prototype.resetMemory=function(){this.memory_=[];for(var a=0;a<shaka.cea.Cea708Window.MAX_ROWS;a++)this.memory_.push(this.createNewRow_())};shaka.cea.Cea708Window.prototype.createNewRow_=function(){for(var a=[],b=0;b<shaka.cea.Cea708Window.MAX_COLS;b++)a.push(null);return a};
|
|
1757
1757
|
shaka.cea.Cea708Window.prototype.setCharacter=function(a){this.isPenInBounds_()&&(a=new shaka.cea.CeaUtils.StyledChar(a,this.underline_,this.italics_,this.backgroundColor_,this.textColor_),this.memory_[this.row_][this.col_]=a,this.col_++)};shaka.cea.Cea708Window.prototype.backspace=function(){!this.isPenInBounds_()||0>=this.col_&&0>=this.row_||(0>=this.col_?(this.col_=this.colCount_-1,this.row_--):this.col_--,this.memory_[this.row_][this.col_]=null)};
|
|
1758
1758
|
shaka.cea.Cea708Window.prototype.isPenInBounds_=function(){var a=this.col_<this.colCount_&&0<=this.col_;return this.row_<this.rowCount_&&0<=this.row_&&a};shaka.cea.Cea708Window.prototype.isVisible=function(){return this.visible_};shaka.cea.Cea708Window.prototype.moveUpRows_=function(a){for(var b=0,c=a;c<shaka.cea.Cea708Window.MAX_ROWS;c++,b++)this.memory_[b]=this.memory_[c];for(c=0;c<a;c++,b++)this.memory_[b]=this.createNewRow_()};
|
|
@@ -1792,8 +1792,8 @@ a.readUint32()===shaka.cea.CeaDecoder.ATSC1_USER_IDENTIFIER&&3===a.readUint8()&&
|
|
|
1792
1792
|
type:shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_DATA,value:h,order:this.cea708DataArray_.length})))}};
|
|
1793
1793
|
shaka.cea.CeaDecoder.prototype.decode=function(){var a=[],b=function(d,e){return d.pts-e.pts||d.order-e.order};this.cea608DataArray_.sort(b);this.cea708DataArray_.sort(b);b=$jscomp.makeIterator(this.cea608DataArray_);for(var c=b.next();!c.done;c=b.next())(c=this.decodeCea608_(c.value))&&a.push(c);b=$jscomp.makeIterator(this.cea708DataArray_);for(c=b.next();!c.done;c=b.next())this.dtvccPacketBuilder_.addByte(c.value);b=this.dtvccPacketBuilder_.getBuiltPackets();b=$jscomp.makeIterator(b);for(c=b.next();!c.done;c=
|
|
1794
1794
|
b.next())c=this.decodeCea708_(c.value),a.push.apply(a,$jscomp.arrayFromIterable(c));this.dtvccPacketBuilder_.clearBuiltPackets();this.cea608DataArray_=[];this.cea708DataArray_=[];return a};
|
|
1795
|
-
shaka.cea.CeaDecoder.prototype.decodeCea608_=function(a){var b=a.type;if(shaka.cea.Cea608DataChannel.isControlCode(a.ccData1)){var c=a.ccData1>>3&1;0===b?this.currentField1Channel_=c:this.currentField2Channel_=c}
|
|
1796
|
-
0;a.ccData1&=127;a.ccData2&=127;if(
|
|
1795
|
+
shaka.cea.CeaDecoder.prototype.decodeCea608_=function(a){var b=a.type;if(shaka.cea.Cea608DataChannel.isControlCode(a.ccData1)){var c=a.ccData1>>3&1;0===b?this.currentField1Channel_=c:this.currentField2Channel_=c}b="CC"+((b<<1|(b?this.currentField2Channel_:this.currentField1Channel_))+1);c=this.cea608ModeToStream_.get(b);if(255===a.ccData1&&255===a.ccData2||!a.ccData1&&!a.ccData2||!this.isOddParity_(a.ccData1)||!this.isOddParity_(a.ccData2))return 45<=++this.badFrames_&&this.reset(),null;this.badFrames_=
|
|
1796
|
+
0;a.ccData1&=127;a.ccData2&=127;if(shaka.cea.Cea608DataChannel.isXdsControlCode(a.ccData1)||!a.ccData1&&!a.ccData2)return null;var d=null;shaka.cea.Cea608DataChannel.isControlCode(a.ccData1)?(this.streams_.add(b),d=c.handleControlCode(a)):c.handleBasicNorthAmericanChar(a.ccData1,a.ccData2);return d};
|
|
1797
1797
|
shaka.cea.CeaDecoder.prototype.decodeCea708_=function(a){var b=[];try{for(;a.hasMoreData();){var c=a.readByte().value,d=(c&224)>>5,e=c&31;7===d&&0!=e&&(d=a.readByte().value&63);if(0!=d){this.streams_.add("svc"+d);if(!this.serviceNumberToService_.has(d)){var f=new shaka.cea.Cea708Service(d);this.serviceNumberToService_.set(d,f)}for(var g=this.serviceNumberToService_.get(d),h=a.getPosition();a.getPosition()-h<e;){var k=g.handleCea708ControlCode(a);k&&b.push(k)}}}}catch(l){if(l instanceof shaka.util.Error&&
|
|
1798
1798
|
l.code===shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS)shaka.log.warnOnce("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw l;}return b};shaka.cea.CeaDecoder.prototype.isOddParity_=function(a){for(var b=0;a;)b^=a&1,a>>=1;return 1===b};shaka.cea.CeaDecoder.prototype.getStreams=function(){return Array.from(this.streams_)};goog.exportSymbol("shaka.cea.CeaDecoder",shaka.cea.CeaDecoder);shaka.cea.CeaDecoder.ATSC_PROVIDER_CODE=49;
|
|
1799
1799
|
shaka.cea.CeaDecoder.ATSC1_USER_IDENTIFIER=1195456820;shaka.cea.CeaDecoder.NTSC_CC_FIELD_1=0;shaka.cea.CeaDecoder.NTSC_CC_FIELD_2=1;shaka.cea.CeaDecoder.USA_COUNTRY_CODE=181;shaka.cea.CeaDecoder.MIN_LENGTH=8;shaka.media.ClosedCaptionParser.registerDecoder(function(){return new shaka.cea.CeaDecoder});shaka.cea.SeiProcessor=function(){};shaka.cea.SeiProcessor.prototype.process=function(a){var b=[];a=this.removeEmu(a);for(var c=0;c<a.length;){for(var d=0;255==a[c];)d+=255,c++;d+=a[c++];for(var e=0;255==a[c];)e+=255,c++;e+=a[c++];4==d&&b.push(a.subarray(c,c+e));c+=e}return b};shaka.cea.SeiProcessor.prototype.removeEmu=function(a){for(var b=a,c=a=0;c<b.length;)2==a&&3==b[c]?(a=0,b=[].concat($jscomp.arrayFromIterable(b)),b.splice(c,1),b=new Uint8Array(b)):0==b[c]?a++:a=0,c++;return b};shaka.cea.Mp4CeaParser=function(){this.seiProcessor_=new shaka.cea.SeiProcessor;this.trackIdToTimescale_=new Map;this.defaultSampleSize_=this.defaultSampleDuration_=0;this.bitstreamFormat_=shaka.cea.Mp4CeaParser.BitstreamFormat.UNKNOWN};
|