shaka-player 4.7.3 → 4.7.4
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/README.md +3 -1
- package/dist/locales.js +34 -34
- package/dist/shaka-player.compiled.d.ts +4 -0
- package/dist/shaka-player.compiled.debug.d.ts +4 -0
- package/dist/shaka-player.compiled.debug.externs.js +5 -0
- package/dist/shaka-player.compiled.debug.js +72 -71
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +5 -0
- package/dist/shaka-player.compiled.js +674 -674
- package/dist/shaka-player.compiled.map +2 -2
- package/dist/shaka-player.ui.d.ts +4 -0
- package/dist/shaka-player.ui.debug.d.ts +4 -0
- package/dist/shaka-player.ui.debug.externs.js +5 -0
- package/dist/shaka-player.ui.debug.js +92 -90
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +5 -0
- package/dist/shaka-player.ui.js +795 -795
- package/dist/shaka-player.ui.map +2 -2
- package/lib/ads/client_side_ad.js +4 -2
- package/lib/ads/client_side_ad_manager.js +5 -3
- package/lib/cea/cea608_memory.js +1 -1
- package/lib/cea/cea_decoder.js +1 -1
- package/lib/hls/hls_parser.js +16 -0
- package/lib/media/media_source_engine.js +3 -3
- package/lib/media/presentation_timeline.js +11 -0
- package/lib/offline/session_deleter.js +0 -8
- package/lib/player.js +12 -6
- package/lib/polyfill/patchedmediakeys_apple.js +0 -6
- package/lib/text/vtt_text_parser.js +5 -0
- package/package.json +1 -1
- package/ui/play_button.js +17 -0
- package/ui/small_play_button.js +2 -2
|
@@ -281,9 +281,9 @@ 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
|
-
CAPTIONS:"CAPTIONS",
|
|
286
|
-
|
|
284
|
+
shaka.ui.Locales.Ids={ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",STATISTICS:"STATISTICS",QUALITY:"QUALITY",ENTER_LOOP_MODE:"ENTER_LOOP_MODE",UNMUTE:"UNMUTE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",AD_DURATION:"AD_DURATION",AD_PROGRESS:"AD_PROGRESS",FULL_SCREEN:"FULL_SCREEN",MORE_SETTINGS:"MORE_SETTINGS",SURROUND:"SURROUND",AUTO_QUALITY:"AUTO_QUALITY",LIVE:"LIVE",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",RESOLUTION:"RESOLUTION",UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",SEEK:"SEEK",
|
|
285
|
+
EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",EXIT_LOOP_MODE:"EXIT_LOOP_MODE",MUTE:"MUTE",PAUSE:"PAUSE",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",CAPTIONS:"CAPTIONS",ON:"ON",SKIP_TO_LIVE:"SKIP_TO_LIVE",NOT_APPLICABLE:"NOT_APPLICABLE",PLAYBACK_RATE:"PLAYBACK_RATE",AIRPLAY:"AIRPLAY",OFF:"OFF",PLAY:"PLAY",CAST:"CAST",LANGUAGE:"LANGUAGE",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",REWIND:"REWIND",AD_TIME:"AD_TIME",SUBTITLE_FORCED:"SUBTITLE_FORCED",LOOP:"LOOP",BACK:"BACK",REPLAY:"REPLAY",VOLUME:"VOLUME",FAST_FORWARD:"FAST_FORWARD",
|
|
286
|
+
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);b=b*(1-c)+c*this.estimate_;isNaN(b)||(this.estimate_=b,this.totalWeight_+=a)};
|
|
287
287
|
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
288
|
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
289
|
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};
|
|
@@ -351,8 +351,8 @@ shaka.util.Platform.isWindows=function(){return navigator.userAgentData&&navigat
|
|
|
351
351
|
shaka.util.Platform.anyMediaElement=function(){var a=shaka.util.Platform;if(a.cachedMediaElement_)return a.cachedMediaElement_;a.cacheExpirationTimer_||(a.cacheExpirationTimer_=new shaka.util.Timer(function(){a.cachedMediaElement_=null}));a.cachedMediaElement_=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0];a.cachedMediaElement_||(a.cachedMediaElement_=document.createElement("video"));a.cacheExpirationTimer_.tickAfter(1);return a.cachedMediaElement_};
|
|
352
352
|
shaka.util.Platform.requiresEncryptionInfoInAllInitSegments=function(){var a=shaka.util.Platform;return a.isTizen()||a.isXboxOne()||a.isOrange()};shaka.util.Platform.supportsSequenceMode=function(){var a=shaka.util.Platform;return a.isTizen3()||a.isTizen2()||a.isWebOS3()||a.isPS4()?!1:!0};shaka.util.Platform.supportsSmoothCodecSwitching=function(){var a=shaka.util.Platform;return a.isTizen2()||a.isTizen3()||a.isTizen4()||a.isWebOS3()||a.isWebOS4()||a.isWebOS5()?!1:!0};
|
|
353
353
|
shaka.util.Platform.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill?!0:!1};shaka.util.Platform.cacheExpirationTimer_=null;shaka.util.Platform.cachedMediaElement_=null;shaka.util.StreamUtils=function(){};
|
|
354
|
-
shaka.util.StreamUtils.chooseCodecsAndFilterManifest=function(a,b,c,d){var e=shaka.util.StreamUtils,f=shaka.util.MimeUtils,g=a.variants;if(b.length||c.length)g=e.choosePreferredCodecs(g,b,c);if(d.length){b=new shaka.util.MultiMap;c=$jscomp.makeIterator(g);for(g=c.next();!g.done;g=c.next())g=g.value,b.push(String(g.video.width||0),g);var h=[];b.forEach(function(t,w){t=0;var u=[],v={};w=$jscomp.makeIterator(w);for(var x=w.next();!x.done;v={$jscomp$loop$prop$variant$
|
|
355
|
-
w.next())v.$jscomp$loop$prop$variant$
|
|
354
|
+
shaka.util.StreamUtils.chooseCodecsAndFilterManifest=function(a,b,c,d){var e=shaka.util.StreamUtils,f=shaka.util.MimeUtils,g=a.variants;if(b.length||c.length)g=e.choosePreferredCodecs(g,b,c);if(d.length){b=new shaka.util.MultiMap;c=$jscomp.makeIterator(g);for(g=c.next();!g.done;g=c.next())g=g.value,b.push(String(g.video.width||0),g);var h=[];b.forEach(function(t,w){t=0;var u=[],v={};w=$jscomp.makeIterator(w);for(var x=w.next();!x.done;v={$jscomp$loop$prop$variant$547$855:v.$jscomp$loop$prop$variant$547$855},x=
|
|
355
|
+
w.next())v.$jscomp$loop$prop$variant$547$855=x.value,x=d.filter(function(y){return function(z){return y.$jscomp$loop$prop$variant$547$855.decodingInfos[0][z]}}(v)).length,x>t?(t=x,u=[v.$jscomp$loop$prop$variant$547$855]):x==t&&u.push(v.$jscomp$loop$prop$variant$547$855);h.push.apply(h,$jscomp.arrayFromIterable(u))});g=h}c=new Set;b=new Set;e=$jscomp.makeIterator(g);for(g=e.next();!g.done;g=e.next())g=g.value,g.audio&&c.add(g.audio),g.video&&b.add(g.video);c=Array.from(c).sort(function(t,w){return t.bandwidth-
|
|
356
356
|
w.bandwidth});var k=[];g=new Map;c=$jscomp.makeIterator(c);for(e=c.next();!e.done;e=c.next()){e=e.value;var l=e.language+(e.channelsCount||0)+(e.audioSamplingRate||0)+e.roles.join(",")+e.label+e.groupId+e.fastSwitching,m=g.get(l)||[];if(m.length){var n=m[m.length-1],p=f.getNormalizedCodec(n.codecs),q=f.getNormalizedCodec(e.codecs);p==q&&e.bandwidth>n.bandwidth&&(m.push(e),k.push(e.id))}else m.push(e),k.push(e.id);g.set(l,m)}c=Array.from(b).sort(function(t,w){return t.bandwidth&&w.bandwidth?t.bandwidth-
|
|
357
357
|
w.bandwidth:t.width-w.width});b=shaka.media.Capabilities.isChangeTypeSupported();var r=[];g=new Map;c=$jscomp.makeIterator(c);for(e=c.next();!e.done;e=c.next()){e=e.value;l=Math.round(e.frameRate||0)+(e.hdr||"")+e.fastSwitching;m=g.get(l)||[];if(m.length){n=m[m.length-1];if(!b&&(p=f.getNormalizedCodec(n.codecs),q=f.getNormalizedCodec(e.codecs),p!==q))continue;e.width>n.width||e.height>n.height?(m.push(e),r.push(e.id)):e.width==n.width&&e.height==n.height&&(p=f.getNormalizedCodec(n.codecs),q=f.getNormalizedCodec(e.codecs),
|
|
358
358
|
p==q&&e.bandwidth<n.bandwidth&&(m.push(e),r.push(e.id)))}else m.push(e),r.push(e.id);g.set(l,m)}a.variants=a.variants.filter(function(t){var w=t.audio,u=t.video;return w&&!k.includes(w.id)||u&&!r.includes(u.id)?(shaka.log.debug("Dropping Variant (better codec available)",t),!1):!0})};
|
|
@@ -526,7 +526,7 @@ shaka.util.Pssh.prototype.parsePsshBox_=function(a){goog.asserts.assert(null!=a.
|
|
|
526
526
|
if(0<a.version){b=a.reader.readUint32();for(var c=0;c<b;c++){var d=shaka.util.Uint8ArrayUtils.toHex(a.reader.readBytes(16));this.cencKeyIds.push(d)}}}};
|
|
527
527
|
shaka.util.Pssh.createPssh=function(a,b,c,d){goog.asserts.assert(16==b.byteLength,"Invalid system ID length");var e=a.length,f=12+b.length+4+e;0<d&&(f+=4+16*c.size);var g=new Uint8Array(f),h=shaka.util.BufferUtils.toDataView(g),k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;1>d?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(0<d)for(h.setUint32(k,c.size),k+=4,b=shaka.util.Uint8ArrayUtils,c=$jscomp.makeIterator(c),d=c.next();!d.done;d=c.next())d=b.fromHex(d.value),
|
|
528
528
|
g.set(d,k),k+=d.length;h.setUint32(k,e);k+=4;g.set(a,k);goog.asserts.assert(k+e===f,"PSSH invalid length.");return g};
|
|
529
|
-
shaka.util.Pssh.normaliseInitData=function(a){if(!a)return a;var b=new shaka.util.Pssh(a);if(1>=b.data.length)return a;a=[];var c={};b=$jscomp.makeIterator(b.data);for(var d=b.next();!d.done;c={$jscomp$loop$prop$initData$
|
|
529
|
+
shaka.util.Pssh.normaliseInitData=function(a){if(!a)return a;var b=new shaka.util.Pssh(a);if(1>=b.data.length)return a;a=[];var c={};b=$jscomp.makeIterator(b.data);for(var d=b.next();!d.done;c={$jscomp$loop$prop$initData$571$869:c.$jscomp$loop$prop$initData$571$869},d=b.next())c.$jscomp$loop$prop$initData$571$869=d.value,a.some(function(e){return function(f){return shaka.util.BufferUtils.equal(f,e.$jscomp$loop$prop$initData$571$869)}}(c))||a.push(c.$jscomp$loop$prop$initData$571$869);return shaka.util.Uint8ArrayUtils.concat.apply(shaka.util.Uint8ArrayUtils,
|
|
530
530
|
$jscomp.arrayFromIterable(a))};shaka.util.XmlUtils=function(){};shaka.util.XmlUtils.findChild=function(a,b){a=shaka.util.XmlUtils.findChildren(a,b);return 1!=a.length?null:a[0]};shaka.util.XmlUtils.findChildNS=function(a,b,c){a=shaka.util.XmlUtils.findChildrenNS(a,b,c);return 1!=a.length?null:a[0]};shaka.util.XmlUtils.findChildren=function(a,b){var c=[];a=$jscomp.makeIterator(a.childNodes);for(var d=a.next();!d.done;d=a.next())d=d.value,d instanceof Element&&d.tagName==b&&c.push(d);return c};
|
|
531
531
|
shaka.util.XmlUtils.getChildren=function(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})};shaka.util.XmlUtils.findChildrenNS=function(a,b,c){var d=[];a=$jscomp.makeIterator(a.childNodes);for(var e=a.next();!e.done;e=a.next())e=e.value,e instanceof Element&&e.localName==c&&e.namespaceURI==b&&d.push(e);return d};shaka.util.XmlUtils.getAttributeNS=function(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null};
|
|
532
532
|
shaka.util.XmlUtils.getAttributeNSList=function(a,b,c){b=$jscomp.makeIterator(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,a.hasAttributeNS(d,c))return a.getAttributeNS(d,c);return null};shaka.util.XmlUtils.getContents=function(a){var b=shaka.util.XmlUtils;return Array.from(a.childNodes).every(b.isText)?a.textContent.trim():null};shaka.util.XmlUtils.isText=function(a){return a.nodeType==Node.TEXT_NODE||a.nodeType==Node.CDATA_SECTION_NODE};
|
|
@@ -744,7 +744,7 @@ typeof this.lcevcLib_.SupportObject)return shaka.log.alwaysWarn("Could not find
|
|
|
744
744
|
shaka.lcevc.Dec.prototype.updateVariant=function(a,b){var c=shaka.lcevc.Dec.ContainerFormat.MPEG2_TS,d=shaka.lcevc.Dec.StreamingFormat.OTHER;switch(a.mimeType){case "video/webm":c=shaka.lcevc.Dec.ContainerFormat.WEBM;break;case "video/mp4":c=shaka.lcevc.Dec.ContainerFormat.MP4}switch(b){case "DASH":d=shaka.lcevc.Dec.StreamingFormat.DASH;break;case "HLS":d=shaka.lcevc.Dec.StreamingFormat.HLS}this.dec_&&(this.variantId_=a.id,this.dec_.setLevelSwitching(a.id,!0),this.dec_.setContainerFormat(c),this.toBeDeprecated_||
|
|
745
745
|
this.dec_.setStreamingFormat(d))};goog.exportSymbol("shaka.lcevc.Dec",shaka.lcevc.Dec);goog.exportProperty(shaka.lcevc.Dec.prototype,"release",shaka.lcevc.Dec.prototype.release);shaka.lcevc.Dec.ContainerFormat={MPEG2_TS:0,WEBM:1,MP4:2};shaka.lcevc.Dec.StreamingFormat={HLS:0,DASH:1,OTHER:-1};shaka.media.MediaSourceEngine=function(a,b,c,d){var e=this;this.video_=a;this.config_=null;this.textDisplayer_=b;this.sourceBuffers_={};this.sourceBufferTypes_={};this.expectedEncryption_={};this.textEngine_=null;this.segmentRelativeVttTiming_=!1;a=function(f,g,h){};this.onMetadata_=c||a;this.lcevcDec_=d||null;this.queues_={};this.eventManager_=new shaka.util.EventManager;this.transmuxers_={};this.captionParser_=null;this.mediaSourceOpen_=new shaka.util.PublicPromise;this.url_="";this.playbackHasBegun_=
|
|
746
746
|
!1;this.mediaSource_=this.createMediaSource(this.mediaSourceOpen_);this.reloadingMediaSource_=!1;this.destroyer_=new shaka.util.Destroyer(function(){return e.doDestroy_()});this.sequenceMode_=!1;this.manifestType_=shaka.media.ManifestParser.UNKNOWN;this.attemptTimestampOffsetCalculation_=this.ignoreManifestTimestampsInSegmentsMode_=!1;this.textSequenceModeOffset_=new shaka.util.PublicPromise;this.needSplitMuxedContent_=!1;this.streamingAllowed_=!0;this.lastDuration_=null};
|
|
747
|
-
shaka.media.MediaSourceEngine.prototype.createMediaSource=function(a){var b=this;if(window.ManagedMediaSource){this.video_.disableRemotePlayback=!0;var c=new ManagedMediaSource;this.eventManager_.
|
|
747
|
+
shaka.media.MediaSourceEngine.prototype.createMediaSource=function(a){var b=this;if(window.ManagedMediaSource){this.video_.disableRemotePlayback=!0;var c=new ManagedMediaSource;this.eventManager_.listen(c,"startstreaming",function(){b.streamingAllowed_=!0});this.eventManager_.listen(c,"endstreaming",function(){b.streamingAllowed_=!1});this.eventManager_.listenOnce(c,"sourceopen",function(){return b.onSourceOpen_(a)});this.eventManager_.listenOnce(this.video_,"playing",function(){b.playbackHasBegun_=
|
|
748
748
|
!0});this.url_=shaka.media.MediaSourceEngine.createObjectURL(c);this.video_.src=this.url_;return c}c=new MediaSource;this.eventManager_.listenOnce(c,"sourceopen",function(){return b.onSourceOpen_(a)});this.eventManager_.listenOnce(this.video_,"playing",function(){b.playbackHasBegun_=!0});this.url_=shaka.media.MediaSourceEngine.createObjectURL(c);this.video_.src=this.url_;return c};
|
|
749
749
|
shaka.media.MediaSourceEngine.prototype.onSourceOpen_=function(a){goog.asserts.assert(this.url_,"Must have object URL");URL.revokeObjectURL(this.url_);a.resolve()};
|
|
750
750
|
shaka.media.MediaSourceEngine.isStreamSupported=function(a){var b=shaka.util.MimeUtils,c=b.getFullType(a.mimeType,a.codecs),d=b.getExtendedType(a);b=b.getFullTypeWithAllCodecs(a.mimeType,a.codecs);var e=shaka.transmuxer.TransmuxerEngine;return shaka.text.TextEngine.isTypeSupported(c)||shaka.media.Capabilities.isTypeSupported(d)||e.isSupported(b,a.type)};
|
|
@@ -817,9 +817,9 @@ shaka.media.PresentationTimeline.prototype.getDelay=function(){return this.prese
|
|
|
817
817
|
shaka.media.PresentationTimeline.prototype.notifyTimeRange=function(a,b){if(0!=a.length){var c=a[a.length-1].end+b;this.notifyMinSegmentStartTime(a[0].start+b);this.maxSegmentDuration_=a.reduce(function(d,e){return Math.max(d,e.end-e.start)},this.maxSegmentDuration_);this.maxSegmentEndTime_=Math.max(this.maxSegmentEndTime_,c);null!=this.presentationStartTime_&&this.autoCorrectDrift_&&!this.startTimeLocked_&&(this.presentationStartTime_=(Date.now()+this.clockOffset_)/1E3-this.maxSegmentEndTime_-this.maxSegmentDuration_);
|
|
818
818
|
shaka.log.v1("notifySegments:","maxSegmentDuration="+this.maxSegmentDuration_)}};
|
|
819
819
|
shaka.media.PresentationTimeline.prototype.notifySegments=function(a){if(0!=a.length){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.clockOffset_)/1E3;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next())e=e.value,d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.maxSegmentDuration_=Math.max(this.maxSegmentDuration_,e.endTime-e.startTime));this.notifyMinSegmentStartTime(b);this.maxSegmentEndTime_=Math.max(this.maxSegmentEndTime_,c);null!=this.presentationStartTime_&&
|
|
820
|
-
this.autoCorrectDrift_&&!this.startTimeLocked_&&(this.presentationStartTime_=d-this.maxSegmentEndTime_-this.maxSegmentDuration_);shaka.log.v1("notifySegments:","maxSegmentDuration="+this.maxSegmentDuration_)}};shaka.media.PresentationTimeline.prototype.lockStartTime=function(){this.startTimeLocked_=!0};shaka.media.PresentationTimeline.prototype.
|
|
821
|
-
shaka.media.PresentationTimeline.prototype.
|
|
822
|
-
shaka.media.PresentationTimeline.prototype.isLive=function(){return Infinity==this.duration_&&!this.static_};shaka.media.PresentationTimeline.prototype.isInProgress=function(){return Infinity!=this.duration_&&!this.static_};
|
|
820
|
+
this.autoCorrectDrift_&&!this.startTimeLocked_&&(this.presentationStartTime_=d-this.maxSegmentEndTime_-this.maxSegmentDuration_);shaka.log.v1("notifySegments:","maxSegmentDuration="+this.maxSegmentDuration_)}};shaka.media.PresentationTimeline.prototype.lockStartTime=function(){this.startTimeLocked_=!0};shaka.media.PresentationTimeline.prototype.isStartTimeLocked=function(){return this.startTimeLocked_};
|
|
821
|
+
shaka.media.PresentationTimeline.prototype.notifyMinSegmentStartTime=function(a){this.minSegmentStartTime_=null==this.minSegmentStartTime_?a:Math.min(this.minSegmentStartTime_,a)};shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration=function(a){this.maxSegmentDuration_=Math.max(this.maxSegmentDuration_,a);shaka.log.v1("notifyNewSegmentDuration:","maxSegmentDuration="+this.maxSegmentDuration_)};
|
|
822
|
+
shaka.media.PresentationTimeline.prototype.offset=function(a){null!=this.minSegmentStartTime_&&(this.minSegmentStartTime_+=a);null!=this.maxSegmentEndTime_&&(this.maxSegmentEndTime_+=a)};shaka.media.PresentationTimeline.prototype.isLive=function(){return Infinity==this.duration_&&!this.static_};shaka.media.PresentationTimeline.prototype.isInProgress=function(){return Infinity!=this.duration_&&!this.static_};
|
|
823
823
|
shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart=function(){goog.asserts.assert(0<=this.segmentAvailabilityDuration_,"The availability duration should be positive");var a=this.getSegmentAvailabilityEnd()-this.segmentAvailabilityDuration_;return Math.max(this.userSeekStart_,a)};shaka.media.PresentationTimeline.prototype.setUserSeekStart=function(a){this.userSeekStart_=a};
|
|
824
824
|
shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd=function(){return this.isLive()||this.isInProgress()?Math.min(this.getLiveEdge_()+this.availabilityTimeOffset_,this.duration_):this.maxSegmentEndTime_?Math.min(this.maxSegmentEndTime_,this.duration_):this.duration_};
|
|
825
825
|
shaka.media.PresentationTimeline.prototype.getSafeSeekRangeStart=function(a){var b=Math.max(this.minSegmentStartTime_,this.userSeekStart_);if(Infinity==this.segmentAvailabilityDuration_)return Math.ceil(1E3*b)/1E3;var c=this.getSegmentAvailabilityEnd()-this.segmentAvailabilityDuration_;a=Math.min(c+a,this.getSeekRangeEnd());return Math.max(b,a)};shaka.media.PresentationTimeline.prototype.getSeekRangeStart=function(){return this.getSafeSeekRangeStart(0)};
|
|
@@ -830,11 +830,11 @@ shaka.media.PresentationTimeline.prototype.assertIsValid=function(){goog.DEBUG&&
|
|
|
830
830
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSeekRangeEnd",shaka.media.PresentationTimeline.prototype.getSeekRangeEnd);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSeekRangeStart",shaka.media.PresentationTimeline.prototype.getSeekRangeStart);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSafeSeekRangeStart",shaka.media.PresentationTimeline.prototype.getSafeSeekRangeStart);
|
|
831
831
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSegmentAvailabilityEnd",shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setUserSeekStart",shaka.media.PresentationTimeline.prototype.setUserSeekStart);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getSegmentAvailabilityStart",shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart);
|
|
832
832
|
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"isInProgress",shaka.media.PresentationTimeline.prototype.isInProgress);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"isLive",shaka.media.PresentationTimeline.prototype.isLive);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"offset",shaka.media.PresentationTimeline.prototype.offset);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyMaxSegmentDuration",shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration);
|
|
833
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyMinSegmentStartTime",shaka.media.PresentationTimeline.prototype.notifyMinSegmentStartTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
834
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
835
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
836
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
837
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getDuration",shaka.media.PresentationTimeline.prototype.getDuration);shaka.media.StallDetector=function(a,b,c){this.onEvent_=c;this.implementation_=a;this.wasMakingProgress_=a.shouldBeMakingProgress();this.value_=a.getPresentationSeconds();this.lastUpdateSeconds_=a.getWallSeconds();this.didJump_=!1;this.stallsDetected_=0;this.stallThresholdSeconds_=b;this.onStall_=function(){}};shaka.media.StallDetector.prototype.release=function(){this.onEvent_=this.implementation_=null;this.onStall_=function(){}};
|
|
833
|
+
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyMinSegmentStartTime",shaka.media.PresentationTimeline.prototype.notifyMinSegmentStartTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"isStartTimeLocked",shaka.media.PresentationTimeline.prototype.isStartTimeLocked);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"lockStartTime",shaka.media.PresentationTimeline.prototype.lockStartTime);
|
|
834
|
+
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifySegments",shaka.media.PresentationTimeline.prototype.notifySegments);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyTimeRange",shaka.media.PresentationTimeline.prototype.notifyTimeRange);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getDelay",shaka.media.PresentationTimeline.prototype.getDelay);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setDelay",shaka.media.PresentationTimeline.prototype.setDelay);
|
|
835
|
+
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setSegmentAvailabilityDuration",shaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setStatic",shaka.media.PresentationTimeline.prototype.setStatic);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setClockOffset",shaka.media.PresentationTimeline.prototype.setClockOffset);
|
|
836
|
+
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getPresentationStartTime",shaka.media.PresentationTimeline.prototype.getPresentationStartTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setDuration",shaka.media.PresentationTimeline.prototype.setDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"setPresentationStartTime",shaka.media.PresentationTimeline.prototype.setPresentationStartTime);
|
|
837
|
+
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getMaxSegmentDuration",shaka.media.PresentationTimeline.prototype.getMaxSegmentDuration);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"getDuration",shaka.media.PresentationTimeline.prototype.getDuration);shaka.media.StallDetector=function(a,b,c){this.onEvent_=c;this.implementation_=a;this.wasMakingProgress_=a.shouldBeMakingProgress();this.value_=a.getPresentationSeconds();this.lastUpdateSeconds_=a.getWallSeconds();this.didJump_=!1;this.stallsDetected_=0;this.stallThresholdSeconds_=b;this.onStall_=function(){}};shaka.media.StallDetector.prototype.release=function(){this.onEvent_=this.implementation_=null;this.onStall_=function(){}};
|
|
838
838
|
shaka.media.StallDetector.prototype.onStall=function(a){this.onStall_=a};shaka.media.StallDetector.prototype.getStallsDetected=function(){return this.stallsDetected_};
|
|
839
839
|
shaka.media.StallDetector.prototype.poll=function(){var a=this.implementation_,b=a.shouldBeMakingProgress(),c=a.getPresentationSeconds(),d=a.getWallSeconds();if(this.value_!=c||this.wasMakingProgress_!=b)this.lastUpdateSeconds_=d,this.value_=c,this.wasMakingProgress_=b,this.didJump_=!1;c=d-this.lastUpdateSeconds_;if(b=c>=this.stallThresholdSeconds_&&b&&!this.didJump_)this.onStall_(this.value_,c),this.didJump_=!0,this.value_=a.getPresentationSeconds(),this.stallsDetected_++,this.onEvent_(new shaka.util.FakeEvent(shaka.util.FakeEvent.EventName.StallDetected));
|
|
840
840
|
return b};shaka.media.StallDetector.Implementation=function(){};shaka.media.StallDetector.Implementation.prototype.shouldBeMakingProgress=function(){};shaka.media.StallDetector.Implementation.prototype.getPresentationSeconds=function(){};shaka.media.StallDetector.Implementation.prototype.getWallSeconds=function(){};shaka.media.StallDetector.MediaElementImplementation=function(a){this.mediaElement_=a};
|
|
@@ -1288,9 +1288,10 @@ d);h.manifest_.textStreams.push(v);h.onTracksChanged_();return z.return(shaka.ut
|
|
|
1288
1288
|
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);
|
|
1289
1289
|
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,
|
|
1290
1290
|
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);
|
|
1291
|
-
m=h.parseMedia(l,k,a);n=[];p={};q=$jscomp.makeIterator(m);for(r=q.next();!r.done;p={$jscomp$loop$prop$
|
|
1292
|
-
4===u.length&&w.setThumbnailSprite({height:parseInt(u[3],10),positionX:parseInt(u[0],10),positionY:parseInt(u[1],10),width:parseInt(u[2],10)})),n.push(w);v={id:c.nextExternalStreamId_++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
1293
|
-
roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1};c.loadMode_==shaka.Player.LoadMode.SRC_EQUALS?c.externalSrcEqualsThumbnailsStreams_.push(v):c.manifest_.imageStreams.push(v);
|
|
1291
|
+
m=h.parseMedia(l,k,a);n=[];p={};q=$jscomp.makeIterator(m);for(r=q.next();!r.done;p={$jscomp$loop$prop$uris$883:p.$jscomp$loop$prop$uris$883,$jscomp$loop$prop$cue$884:p.$jscomp$loop$prop$cue$884},r=q.next())p.$jscomp$loop$prop$cue$884=r.value,p.$jscomp$loop$prop$uris$883=null,t=function(y){return function(){null==y.$jscomp$loop$prop$uris$883&&(y.$jscomp$loop$prop$uris$883=shaka.util.ManifestParserUtils.resolveUris([a],[y.$jscomp$loop$prop$cue$884.payload]));return y.$jscomp$loop$prop$uris$883||[]}}(p),
|
|
1292
|
+
w=new shaka.media.SegmentReference(p.$jscomp$loop$prop$cue$884.startTime,p.$jscomp$loop$prop$cue$884.endTime,t,0,null,null,0,0,Infinity),p.$jscomp$loop$prop$cue$884.payload.includes("#xywh")&&(u=p.$jscomp$loop$prop$cue$884.payload.split("#xywh=")[1].split(","),4===u.length&&w.setThumbnailSprite({height:parseInt(u[3],10),positionX:parseInt(u[0],10),positionY:parseInt(u[1],10),width:parseInt(u[2],10)})),n.push(w);v={id:c.nextExternalStreamId_++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
1293
|
+
segmentIndex:new shaka.media.SegmentIndex(n),mimeType:b||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:d.IMAGE,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1};c.loadMode_==shaka.Player.LoadMode.SRC_EQUALS?c.externalSrcEqualsThumbnailsStreams_.push(v):c.manifest_.imageStreams.push(v);
|
|
1294
|
+
c.onTracksChanged_();return x.return(shaka.util.StreamUtils.imageStreamToTrack(v))}})};
|
|
1294
1295
|
shaka.Player.prototype.addChaptersTrack=function(a,b,c){var d=this,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){switch(k.nextAddress){case 1:if(d.loadMode_!=shaka.Player.LoadMode.MEDIA_SOURCE&&d.loadMode_!=shaka.Player.LoadMode.SRC_EQUALS)throw shaka.log.error("Must call load() and wait for it to resolve before adding chapters tracks."),new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.PLAYER,shaka.util.Error.Code.CONTENT_NOT_LOADED);if(c){k.jumpTo(2);
|
|
1295
1296
|
break}return k.yield(d.getTextMimetype_(a),3);case 3:c=k.yieldResult;case 2:return e=[],d.adManager_&&(e=d.adManager_.getCuePoints()),k.yield(d.addSrcTrackElement_(a,b,"chapters",c,"",e),4);case 4:f=k.yieldResult;g=d.getChaptersTracks();h=g.find(function(l){return l.language==b});if(!h){k.jumpTo(5);break}return k.yield(new Promise(function(l,m){d.loadEventManager_.listenOnce(f,"load",l);d.loadEventManager_.listenOnce(f,"error",function(n){m(new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,
|
|
1296
1297
|
shaka.util.Error.Category.TEXT,shaka.util.Error.Code.CHAPTERS_TRACK_FAILED))})}),6);case 6:return d.onTracksChanged_(),k.return(h);case 5:throw shaka.log.error("Cannot add this text when loaded with src="),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);}})};
|
|
@@ -1369,22 +1370,22 @@ goog.exportProperty(shaka.Player.prototype,"isInProgress",shaka.Player.prototype
|
|
|
1369
1370
|
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);
|
|
1370
1371
|
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);
|
|
1371
1372
|
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);
|
|
1372
|
-
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.
|
|
1373
|
+
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.4-debug";
|
|
1373
1374
|
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_++};
|
|
1374
1375
|
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()};
|
|
1375
1376
|
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()};
|
|
1376
1377
|
shaka.ads.ClientSideAd.prototype.getTimeUntilSkippable=function(){var a=this.ad_.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};shaka.ads.ClientSideAd.prototype.canSkipNow=function(){return this.manager_.getAdSkippableState()};shaka.ads.ClientSideAd.prototype.skip=function(){return this.manager_.skip()};shaka.ads.ClientSideAd.prototype.setPaused=function(a){this.isPaused_=a};shaka.ads.ClientSideAd.prototype.pause=function(){return this.manager_.pause()};
|
|
1377
|
-
shaka.ads.ClientSideAd.prototype.play=function(){return this.manager_.resume()};shaka.ads.ClientSideAd.prototype.getVolume=function(){return this.manager_.getVolume()};shaka.ads.ClientSideAd.prototype.setVolume=function(a){return this.manager_.setVolume(a)};shaka.ads.ClientSideAd.prototype.isMuted=function(){return 0==this.manager_.getVolume()};shaka.ads.ClientSideAd.prototype.isLinear=function(){return this.ad_.isLinear()};
|
|
1378
|
-
shaka.ads.ClientSideAd.prototype.resize=function(a,b){var c=!1,d=this.video_;document.fullscreenEnabled?c=!!document.fullscreenElement:d.webkitSupportsFullscreen&&(c=d.webkitDisplayingFullscreen);this.manager_.resize(a,b,c?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)};shaka.ads.ClientSideAd.prototype.setMuted=function(a){a?(this.volume_=this.getVolume(),this.setVolume(0)):this.setVolume(this.volume_)};
|
|
1379
|
-
shaka.ads.ClientSideAd.prototype.getSequenceLength=function(){var a=this.ad_.getAdPodInfo();return null==a?1:a.getTotalAds()};shaka.ads.ClientSideAd.prototype.getPositionInSequence=function(){var a=this.ad_.getAdPodInfo();return null==a?1:a.getAdPosition()};shaka.ads.ClientSideAd.prototype.getTitle=function(){return this.ad_.getTitle()};shaka.ads.ClientSideAd.prototype.getDescription=function(){return this.ad_.getDescription()};
|
|
1380
|
-
shaka.ads.ClientSideAd.prototype.
|
|
1381
|
-
shaka.ads.ClientSideAd.prototype.getMediaUrl=function(){return this.ad_.getMediaUrl()};shaka.ads.ClientSideAd.prototype.getTimeOffset=function(){var a=this.ad_.getAdPodInfo();return null==a?0:a.getTimeOffset()};shaka.ads.ClientSideAd.prototype.getPodIndex=function(){var a=this.ad_.getAdPodInfo();return null==a?0:a.getPodIndex()};
|
|
1382
|
-
|
|
1383
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1384
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1385
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1386
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1387
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"pause",shaka.ads.ClientSideAd.prototype.pause);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"skip",shaka.ads.ClientSideAd.prototype.skip);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"canSkipNow",shaka.ads.ClientSideAd.prototype.canSkipNow);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getTimeUntilSkippable",shaka.ads.ClientSideAd.prototype.getTimeUntilSkippable);
|
|
1378
|
+
shaka.ads.ClientSideAd.prototype.play=function(){return this.manager_.resume()};shaka.ads.ClientSideAd.prototype.getVolume=function(){return this.manager_.getVolume()};shaka.ads.ClientSideAd.prototype.setVolume=function(a){this.video_.volume=a;return this.manager_.setVolume(a)};shaka.ads.ClientSideAd.prototype.isMuted=function(){return 0==this.manager_.getVolume()};shaka.ads.ClientSideAd.prototype.isLinear=function(){return this.ad_.isLinear()};
|
|
1379
|
+
shaka.ads.ClientSideAd.prototype.resize=function(a,b){var c=!1,d=this.video_;document.fullscreenEnabled?c=!!document.fullscreenElement:d.webkitSupportsFullscreen&&(c=d.webkitDisplayingFullscreen);this.manager_.resize(a,b,c?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)};shaka.ads.ClientSideAd.prototype.setMuted=function(a){(this.video_.muted=a)?(this.volume_=this.getVolume(),this.manager_.setVolume(0)):this.manager_.setVolume(this.volume_)};
|
|
1380
|
+
shaka.ads.ClientSideAd.prototype.setInitialMuted=function(a){this.volume_=a;this.manager_.setVolume(0)};shaka.ads.ClientSideAd.prototype.getSequenceLength=function(){var a=this.ad_.getAdPodInfo();return null==a?1:a.getTotalAds()};shaka.ads.ClientSideAd.prototype.getPositionInSequence=function(){var a=this.ad_.getAdPodInfo();return null==a?1:a.getAdPosition()};shaka.ads.ClientSideAd.prototype.getTitle=function(){return this.ad_.getTitle()};shaka.ads.ClientSideAd.prototype.getDescription=function(){return this.ad_.getDescription()};
|
|
1381
|
+
shaka.ads.ClientSideAd.prototype.getVastMediaBitrate=function(){return this.ad_.getVastMediaBitrate()};shaka.ads.ClientSideAd.prototype.getVastMediaHeight=function(){return this.ad_.getVastMediaHeight()};shaka.ads.ClientSideAd.prototype.getVastMediaWidth=function(){return this.ad_.getVastMediaWidth()};shaka.ads.ClientSideAd.prototype.getAdId=function(){return this.ad_.getAdId()};shaka.ads.ClientSideAd.prototype.getCreativeAdId=function(){return this.ad_.getCreativeAdId()};
|
|
1382
|
+
shaka.ads.ClientSideAd.prototype.getAdvertiserName=function(){return this.ad_.getAdvertiserName()};shaka.ads.ClientSideAd.prototype.getMediaUrl=function(){return this.ad_.getMediaUrl()};shaka.ads.ClientSideAd.prototype.getTimeOffset=function(){var a=this.ad_.getAdPodInfo();return null==a?0:a.getTimeOffset()};shaka.ads.ClientSideAd.prototype.getPodIndex=function(){var a=this.ad_.getAdPodInfo();return null==a?0:a.getPodIndex()};
|
|
1383
|
+
shaka.ads.ClientSideAd.prototype.release=function(){this.manager_=this.ad_=null};goog.exportSymbol("shaka.ads.ClientSideAd",shaka.ads.ClientSideAd);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"release",shaka.ads.ClientSideAd.prototype.release);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getPodIndex",shaka.ads.ClientSideAd.prototype.getPodIndex);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getTimeOffset",shaka.ads.ClientSideAd.prototype.getTimeOffset);
|
|
1384
|
+
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getMediaUrl",shaka.ads.ClientSideAd.prototype.getMediaUrl);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getAdvertiserName",shaka.ads.ClientSideAd.prototype.getAdvertiserName);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getCreativeAdId",shaka.ads.ClientSideAd.prototype.getCreativeAdId);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getAdId",shaka.ads.ClientSideAd.prototype.getAdId);
|
|
1385
|
+
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getVastMediaWidth",shaka.ads.ClientSideAd.prototype.getVastMediaWidth);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getVastMediaHeight",shaka.ads.ClientSideAd.prototype.getVastMediaHeight);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getVastMediaBitrate",shaka.ads.ClientSideAd.prototype.getVastMediaBitrate);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getDescription",shaka.ads.ClientSideAd.prototype.getDescription);
|
|
1386
|
+
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getTitle",shaka.ads.ClientSideAd.prototype.getTitle);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getPositionInSequence",shaka.ads.ClientSideAd.prototype.getPositionInSequence);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getSequenceLength",shaka.ads.ClientSideAd.prototype.getSequenceLength);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"setMuted",shaka.ads.ClientSideAd.prototype.setMuted);
|
|
1387
|
+
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"resize",shaka.ads.ClientSideAd.prototype.resize);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"isLinear",shaka.ads.ClientSideAd.prototype.isLinear);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"isMuted",shaka.ads.ClientSideAd.prototype.isMuted);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"setVolume",shaka.ads.ClientSideAd.prototype.setVolume);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getVolume",shaka.ads.ClientSideAd.prototype.getVolume);
|
|
1388
|
+
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"play",shaka.ads.ClientSideAd.prototype.play);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"pause",shaka.ads.ClientSideAd.prototype.pause);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"skip",shaka.ads.ClientSideAd.prototype.skip);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"canSkipNow",shaka.ads.ClientSideAd.prototype.canSkipNow);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getTimeUntilSkippable",shaka.ads.ClientSideAd.prototype.getTimeUntilSkippable);
|
|
1388
1389
|
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"isSkippable",shaka.ads.ClientSideAd.prototype.isSkippable);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"isPaused",shaka.ads.ClientSideAd.prototype.isPaused);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getRemainingTime",shaka.ads.ClientSideAd.prototype.getRemainingTime);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getMinSuggestedDuration",shaka.ads.ClientSideAd.prototype.getMinSuggestedDuration);
|
|
1389
1390
|
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getDuration",shaka.ads.ClientSideAd.prototype.getDuration);shaka.ads.ClientSideAdManager=function(a,b,c,d,e){var f=this;this.adContainer_=a;this.video_=b;this.videoPlayed_=!1;this.resizeObserver_=this.config_=null;this.requestAdsStartTime_=NaN;this.onEvent_=e;this.ad_=null;this.eventManager_=new shaka.util.EventManager;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);a=new google.ima.AdDisplayContainer(this.adContainer_,this.video_);a.initialize();this.adsLoader_=new google.ima.AdsLoader(a);this.adsLoader_.getSettings().setPlayerType("shaka-player");
|
|
1390
1391
|
this.adsLoader_.getSettings().setPlayerVersion(shaka.Player.version);this.imaAdsManager_=null;this.adsRenderingSettings_=d||new google.ima.AdsRenderingSettings;this.eventManager_.listen(this.adsLoader_,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(g){f.onAdsManagerLoaded_(g)});this.eventManager_.listen(this.adsLoader_,google.ima.AdErrorEvent.Type.AD_ERROR,function(g){f.onAdError_(g)});this.eventManager_.listen(this.video_,"ended",function(){f.adsLoader_.contentComplete()});this.eventManager_.listenOnce(this.video_,
|
|
@@ -1393,7 +1394,7 @@ shaka.ads.ClientSideAdManager.prototype.updateAdsRenderingSettings=function(a){t
|
|
|
1393
1394
|
shaka.ads.ClientSideAdManager.prototype.release=function(){this.stop();this.resizeObserver_&&this.resizeObserver_.disconnect();this.eventManager_&&this.eventManager_.release();this.imaAdsManager_&&this.imaAdsManager_.destroy();this.adsLoader_.destroy()};
|
|
1394
1395
|
shaka.ads.ClientSideAdManager.prototype.onAdError_=function(a){shaka.log.warning("There was an ad error from the IMA SDK: "+a.getError());shaka.log.warning("Resuming playback.");a=(new Map).set("originalEvent",a);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.AD_ERROR,a));this.onAdComplete_(null);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.CUEPOINTS_CHANGED,(new Map).set("cuepoints",[])))};
|
|
1395
1396
|
shaka.ads.ClientSideAdManager.prototype.onAdsManagerLoaded_=function(a){var b=this;goog.asserts.assert(null!=this.video_,"Video should not be null!");var c=Date.now()/1E3-this.requestAdsStartTime_;this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.ADS_LOADED,(new Map).set("loadTime",c)));if(this.config_.customPlayheadTracker){var d={currentTime:this.video_.currentTime};this.imaAdsManager_=a.getAdsManager(d,this.adsRenderingSettings_);this.video_.muted?this.imaAdsManager_.setVolume(0):this.imaAdsManager_.setVolume(this.video_.volume);
|
|
1396
|
-
this.eventManager_.listen(this.video_,"timeupdate",function(){b.video_.duration&&(d.currentTime=b.video_.currentTime)});this.eventManager_.listen(this.video_,"volumechange",function(){b.
|
|
1397
|
+
this.eventManager_.listen(this.video_,"timeupdate",function(){b.video_.duration&&(d.currentTime=b.video_.currentTime)});this.eventManager_.listen(this.video_,"volumechange",function(){b.ad_&&(b.ad_.setVolume(b.video_.volume),b.video_.muted&&b.ad_.setMuted(!0))})}else this.imaAdsManager_=a.getAdsManager(this.video_,this.adsRenderingSettings_);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.IMA_AD_MANAGER_LOADED,(new Map).set("imaAdManager",this.imaAdsManager_)));c=this.imaAdsManager_.getCuePoints();
|
|
1397
1398
|
if(c.length){a=[];c=$jscomp.makeIterator(c);for(var e=c.next();!e.done;e=c.next())a.push({start:e.value,end:null});this.onEvent_(new shaka.util.FakeEvent(shaka.ads.AdManager.CUEPOINTS_CHANGED,(new Map).set("cuepoints",a)))}this.addImaEventListeners_();try{var f=this.isFullScreenEnabled_()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;this.imaAdsManager_.init(this.video_.offsetWidth,this.video_.offsetHeight,f);this.eventManager_.listen(this.video_,"loadeddata",function(){var g=b.isFullScreenEnabled_()?
|
|
1398
1399
|
google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;b.imaAdsManager_.resize(b.video_.offsetWidth,b.video_.offsetHeight,g)});"ResizeObserver"in window?(this.resizeObserver_=new ResizeObserver(function(){var g=b.isFullScreenEnabled_()?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;b.imaAdsManager_.resize(b.video_.offsetWidth,b.video_.offsetHeight,g)}),this.resizeObserver_.observe(this.video_)):this.eventManager_.listen(document,"fullscreenchange",function(){var g=b.isFullScreenEnabled_()?
|
|
1399
1400
|
google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL;b.imaAdsManager_.resize(b.video_.offsetWidth,b.video_.offsetHeight,g)});this.videoPlayed_?this.imaAdsManager_.start():this.eventManager_.listenOnce(this.video_,"play",function(){b.videoPlayed_=!0;b.imaAdsManager_.start()})}catch(g){this.onAdComplete_(null)}};
|
|
@@ -1551,7 +1552,7 @@ shaka.cast.CastProxy.prototype.cast=function(){var a=this,b;return $jscomp.async
|
|
|
1551
1552
|
shaka.cast.CastProxy.prototype.changeReceiverId=function(a,b){b=void 0===b?!1:b;var c=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){if(1==d.nextAddress){if(a==c.receiverAppId_&&b==c.androidReceiverCompatible_)return d.return();c.receiverAppId_=a;c.androidReceiverCompatible_=b;c.sender_.forceDisconnect();return d.yield(c.sender_.destroy(),2)}c.sender_=null;c.sender_=new shaka.cast.CastSender(a,function(){return c.onCastStatusChanged_()},function(){return c.onFirstCastStateUpdate_()},
|
|
1552
1553
|
function(e,f){return c.onRemoteEvent_(e,f)},function(){return c.onResumeLocal_()},function(){return c.getInitState_()},b);c.sender_.init();d.jumpToEnd()})};
|
|
1553
1554
|
shaka.cast.CastProxy.prototype.init_=function(){var a=this;this.sender_.init();this.eventManager_=new shaka.util.EventManager;for(var b=$jscomp.makeIterator(shaka.cast.CastUtils.VideoEvents),c=b.next();!c.done;c=b.next())this.eventManager_.listen(this.localVideo_,c.value,function(f){return a.videoProxyLocalEvent_(f)});for(var d in shaka.util.FakeEvent.EventName)this.eventManager_.listen(this.localPlayer_,shaka.util.FakeEvent.EventName[d],function(f){return a.playerProxyLocalEvent_(f)});this.videoProxy_=
|
|
1554
|
-
{};b={};for(var e in this.localVideo_)b.$jscomp$loop$prop$k$
|
|
1555
|
+
{};b={};for(var e in this.localVideo_)b.$jscomp$loop$prop$k$887=e,Object.defineProperty(this.videoProxy_,b.$jscomp$loop$prop$k$887,{configurable:!1,enumerable:!0,get:function(f){return function(){return a.videoProxyGet_(f.$jscomp$loop$prop$k$887)}}(b),set:function(f){return function(g){a.videoProxySet_(f.$jscomp$loop$prop$k$887,g)}}(b)}),b={$jscomp$loop$prop$k$887:b.$jscomp$loop$prop$k$887};this.playerProxy_={};this.iterateOverPlayerMethods_(function(f,g){goog.asserts.assert(a.playerProxy_,"Must have player proxy!");
|
|
1555
1556
|
Object.defineProperty(a.playerProxy_,f,{configurable:!1,enumerable:!0,get:function(){return a.playerProxyGet_(f)}})});COMPILED&&this.mapCompiledToUncompiledPlayerMethodNames_();this.videoEventTarget_=new shaka.util.FakeEventTarget;this.videoEventTarget_.dispatchTarget=this.videoProxy_;this.playerEventTarget_=new shaka.util.FakeEventTarget;this.playerEventTarget_.dispatchTarget=this.playerProxy_};
|
|
1556
1557
|
shaka.cast.CastProxy.prototype.mapCompiledToUncompiledPlayerMethodNames_=function(){var a=this,b=new Map;this.iterateOverPlayerMethods_(function(c,d){b.has(d)?(d=b.get(d),c.length<d.length?a.compiledToExternNames_.set(c,d):a.compiledToExternNames_.set(d,c)):b.set(d,c)})};
|
|
1557
1558
|
shaka.cast.CastProxy.prototype.iterateOverPlayerMethods_=function(a){function b(k){return"constructor"==k||"function"!=typeof c[k]?!1:!d.has(k)}goog.asserts.assert(this.localPlayer_,"Must have player!");var c=this.localPlayer_,d=new Set;for(e in c)b(e)&&(d.add(e),a(e,c[e]));var e=Object.getPrototypeOf(c);for(var f=Object.getPrototypeOf({});e&&e!=f;){for(var g=$jscomp.makeIterator(Object.getOwnPropertyNames(e)),h=g.next();!h.done;h=g.next())h=h.value,b(h)&&(d.add(h),a(h,c[h]));e=Object.getPrototypeOf(e)}};
|
|
@@ -1607,7 +1608,7 @@ shaka.cea.CeaUtils.getParsedCaption=function(a,b,c,d,e){if(d>=e)return null;for(
|
|
|
1607
1608
|
" ";n.payload&&a.nestedCues.push(n);f!==g&&(n=shaka.cea.CeaUtils.createLineBreakCue(d,e),a.nestedCues.push(n));n=shaka.cea.CeaUtils.createStyledCue(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null};shaka.cea.CeaUtils.createStyledCue=function(a,b,c,d,e,f){a=new shaka.text.Cue(a,b,"");c&&a.textDecoration.push(shaka.text.Cue.textDecoration.UNDERLINE);d&&(a.fontStyle=shaka.text.Cue.fontStyle.ITALIC);a.color=e;a.backgroundColor=f;return a};
|
|
1608
1609
|
shaka.cea.CeaUtils.createLineBreakCue=function(a,b){a=new shaka.text.Cue(a,b,"");a.lineBreak=!0;return a};shaka.cea.CeaUtils.StyledChar=function(a,b,c,d,e){this.character_=a;this.underline_=b;this.italics_=c;this.backgroundColor_=d;this.textColor_=e};shaka.cea.CeaUtils.StyledChar.prototype.getChar=function(){return this.character_};shaka.cea.CeaUtils.StyledChar.prototype.isUnderlined=function(){return this.underline_};shaka.cea.CeaUtils.StyledChar.prototype.isItalicized=function(){return this.italics_};
|
|
1609
1610
|
shaka.cea.CeaUtils.StyledChar.prototype.getBackgroundColor=function(){return this.backgroundColor_};shaka.cea.CeaUtils.StyledChar.prototype.getTextColor=function(){return this.textColor_};shaka.cea.CeaUtils.DEFAULT_BG_COLOR="black";shaka.cea.CeaUtils.DEFAULT_TXT_COLOR="white";shaka.cea.CeaUtils.H264_NALU_TYPE_SEI=6;shaka.cea.CeaUtils.H265_PREFIX_NALU_TYPE_SEI=39;shaka.cea.CeaUtils.H265_SUFFIX_NALU_TYPE_SEI=40;shaka.cea.CeaUtils.DEFAULT_TIMESCALE_VALUE=9E4;shaka.cea.Cea608Memory=function(a,b){this.rows_=[];this.row_=1;this.scrollRows_=0;this.fieldNum_=a;this.channelNum_=b;this.italics_=this.underline_=!1;this.textColor_=shaka.cea.CeaUtils.DEFAULT_TXT_COLOR;this.backgroundColor_=shaka.cea.CeaUtils.DEFAULT_BG_COLOR;this.reset()};
|
|
1610
|
-
shaka.cea.Cea608Memory.prototype.forceEmit=function(a,b){var c="CC"+(this.fieldNum_<<1|this.channelNum_+1),d=new shaka.text.Cue(a,b,"");d.lineInterpretation=shaka.text.Cue.lineInterpretation.PERCENTAGE;var e=shaka.cea.Cea608Memory.ROW_TO_LINE_CONVERSION_.get(this.row_);e&&(d.line=e);return shaka.cea.CeaUtils.getParsedCaption(d,c,this.rows_,a,b)};shaka.cea.Cea608Memory.prototype.reset=function(){this.resetAllRows();this.row_=1};shaka.cea.Cea608Memory.prototype.getRow=function(){return this.row_};
|
|
1611
|
+
shaka.cea.Cea608Memory.prototype.forceEmit=function(a,b){var c="CC"+((this.fieldNum_<<1|this.channelNum_)+1),d=new shaka.text.Cue(a,b,"");d.lineInterpretation=shaka.text.Cue.lineInterpretation.PERCENTAGE;var e=shaka.cea.Cea608Memory.ROW_TO_LINE_CONVERSION_.get(this.row_);e&&(d.line=e);return shaka.cea.CeaUtils.getParsedCaption(d,c,this.rows_,a,b)};shaka.cea.Cea608Memory.prototype.reset=function(){this.resetAllRows();this.row_=1};shaka.cea.Cea608Memory.prototype.getRow=function(){return this.row_};
|
|
1611
1612
|
shaka.cea.Cea608Memory.prototype.setRow=function(a){this.row_=a};shaka.cea.Cea608Memory.prototype.getScrollSize=function(){return this.scrollRows_};shaka.cea.Cea608Memory.prototype.setScrollSize=function(a){this.scrollRows_=a};
|
|
1612
1613
|
shaka.cea.Cea608Memory.prototype.addChar=function(a,b){if(!(32>b||127<b)){var c="";switch(a){case shaka.cea.Cea608Memory.CharSet.BASIC_NORTH_AMERICAN:c=shaka.cea.Cea608Memory.CharSet.BasicNorthAmericanChars.has(b)?shaka.cea.Cea608Memory.CharSet.BasicNorthAmericanChars.get(b):String.fromCharCode(b);break;case shaka.cea.Cea608Memory.CharSet.SPECIAL_NORTH_AMERICAN:c=shaka.cea.Cea608Memory.CharSet.SpecialNorthAmericanChars.get(b);break;case shaka.cea.Cea608Memory.CharSet.SPANISH_FRENCH:this.eraseChar();
|
|
1613
1614
|
c=shaka.cea.Cea608Memory.CharSet.ExtendedSpanishFrench.get(b);break;case shaka.cea.Cea608Memory.CharSet.PORTUGUESE_GERMAN:this.eraseChar(),c=shaka.cea.Cea608Memory.CharSet.ExtendedPortugueseGerman.get(b)}c&&(a=new shaka.cea.CeaUtils.StyledChar(c,this.underline_,this.italics_,this.backgroundColor_,this.textColor_),this.rows_[this.row_].push(a))}};shaka.cea.Cea608Memory.prototype.eraseChar=function(){this.rows_[this.row_].pop()};
|
|
@@ -1674,7 +1675,7 @@ shaka.cea.CeaDecoder.prototype.extract=function(a,b){if(this.waitingForFirstPack
|
|
|
1674
1675
|
value:h,order:this.cea708DataArray_.length})))}};
|
|
1675
1676
|
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=
|
|
1676
1677
|
b.next())c=this.decodeCea708_(c.value),a.push.apply(a,$jscomp.arrayFromIterable(c));this.dtvccPacketBuilder_.clearBuiltPackets();this.cea608DataArray_=[];this.cea708DataArray_=[];return a};
|
|
1677
|
-
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}c="CC"+(b<<1|(b?this.currentField2Channel_:this.currentField1Channel_)+1);b=this.cea608ModeToStream_.get(c);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_=
|
|
1678
|
+
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}c="CC"+((b<<1|(b?this.currentField2Channel_:this.currentField1Channel_))+1);b=this.cea608ModeToStream_.get(c);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_=
|
|
1678
1679
|
0;a.ccData1&=127;a.ccData2&=127;if(!a.ccData1&&!a.ccData2)return null;this.streams_.add(c);c=null;shaka.cea.Cea608DataChannel.isControlCode(a.ccData1)?c=b.handleControlCode(a):b.handleBasicNorthAmericanChar(a.ccData1,a.ccData2);return c};
|
|
1679
1680
|
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&&
|
|
1680
1681
|
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;
|
|
@@ -1772,9 +1773,9 @@ mediaSegments:d}};
|
|
|
1772
1773
|
shaka.dash.SegmentList.checkSegmentListInfo_=function(a,b){if(!b.segmentDuration&&!b.timeline&&1<b.mediaSegments.length)throw shaka.log.warning("SegmentList does not contain sufficient segment information:","the SegmentList specifies multiple segments,","but does not specify a segment duration or timeline.",a.representation),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);if(!b.segmentDuration&&!a.periodInfo.duration&&
|
|
1773
1774
|
!b.timeline&&1==b.mediaSegments.length)throw shaka.log.warning("SegmentList does not contain sufficient segment information:","the SegmentList specifies one segment,","but does not specify a segment duration, period duration,","or timeline.",a.representation),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);if(b.timeline&&0==b.timeline.length)throw shaka.log.warning("SegmentList does not contain sufficient segment information:",
|
|
1774
1775
|
"the SegmentList has an empty timeline.",a.representation),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);};
|
|
1775
|
-
shaka.dash.SegmentList.createSegmentReferences_=function(a,b,c,d,e,f,g){var h=shaka.util.ManifestParserUtils;c=e.mediaSegments.length;e.timeline&&e.timeline.length!=e.mediaSegments.length&&(c=Math.min(e.timeline.length,e.mediaSegments.length),shaka.log.warning("The number of items in the segment timeline and the number of ","segment URLs do not match, truncating",e.mediaSegments.length,"to",c));for(var k=a-e.scaledPresentationTimeOffset,l=b?a+b:Infinity,m=[],n=e.startTime,p={},q=0;q<c;p={$jscomp$loop$prop$uris$
|
|
1776
|
-
$jscomp$loop$prop$segment$
|
|
1777
|
-
return w.$jscomp$loop$prop$uris$
|
|
1776
|
+
shaka.dash.SegmentList.createSegmentReferences_=function(a,b,c,d,e,f,g){var h=shaka.util.ManifestParserUtils;c=e.mediaSegments.length;e.timeline&&e.timeline.length!=e.mediaSegments.length&&(c=Math.min(e.timeline.length,e.mediaSegments.length),shaka.log.warning("The number of items in the segment timeline and the number of ","segment URLs do not match, truncating",e.mediaSegments.length,"to",c));for(var k=a-e.scaledPresentationTimeOffset,l=b?a+b:Infinity,m=[],n=e.startTime,p={},q=0;q<c;p={$jscomp$loop$prop$uris$889:p.$jscomp$loop$prop$uris$889,
|
|
1777
|
+
$jscomp$loop$prop$segment$890:p.$jscomp$loop$prop$segment$890},q++){p.$jscomp$loop$prop$segment$890=e.mediaSegments[q];var r=void 0;null!=e.segmentDuration?r=n+e.segmentDuration:e.timeline?r=e.timeline[q].end:(goog.asserts.assert(1==e.mediaSegments.length&&b,"There should be exactly one segment with a Period duration."),r=n+b);p.$jscomp$loop$prop$uris$889=null;var t=function(w){return function(){null==w.$jscomp$loop$prop$uris$889&&(w.$jscomp$loop$prop$uris$889=h.resolveUris(d(),[w.$jscomp$loop$prop$segment$890.mediaUri]));
|
|
1778
|
+
return w.$jscomp$loop$prop$uris$889}}(p);m.push(new shaka.media.SegmentReference(a+n,a+r,t,p.$jscomp$loop$prop$segment$890.start,p.$jscomp$loop$prop$segment$890.end,f,k,a,l,[],"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,g));n=r}return m};
|
|
1778
1779
|
shaka.dash.SegmentList.parseMediaSegments_=function(a){var b=[a.representation.segmentList,a.adaptationSet.segmentList,a.period.segmentList].filter(shaka.util.Functional.isNotNull),c=shaka.util.XmlUtils;return b.map(function(d){return c.findChildren(d,"SegmentURL")}).reduce(function(d,e){return 0<d.length?d:e}).map(function(d){d.getAttribute("indexRange")&&!a.indexRangeWarningGiven&&(a.indexRangeWarningGiven=!0,shaka.log.warning("We do not support the SegmentURL@indexRange attribute on SegmentList. We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate."));
|
|
1779
1780
|
var e=d.getAttribute("media");d=c.parseAttr(d,"mediaRange",c.parseRange,{start:0,end:null});return{mediaUri:e,start:d.start,end:d.end}})};shaka.dash.SegmentTemplate=function(){};
|
|
1780
1781
|
shaka.dash.SegmentTemplate.createStreamInfo=function(a,b,c,d,e,f,g){goog.asserts.assert(a.representation.segmentTemplate,"Should only be called with SegmentTemplate");var h=shaka.dash.SegmentTemplate,k=shaka.dash.TimelineSegmentIndex,l=h.createInitSegment_(a,g),m=h.parseSegmentTemplateInfo_(a);h.checkSegmentTemplateInfo_(a,m);var n=shaka.util.ObjectUtils.shallowCloneObject(a);if(m.indexTemplate)return shaka.dash.SegmentBase.checkSegmentIndexSupport(a,l),{generateSegmentIndex:function(){return h.generateSegmentIndexFromIndexTemplate_(n,b,
|
|
@@ -1800,8 +1801,8 @@ shaka.dash.TimelineSegmentIndex.prototype.appendTemplateInfo=function(a,b,c,d,e)
|
|
|
1800
1801
|
a,this.periodStart_=b,this.periodEnd_=c;d&&this.fitTimeline()};shaka.dash.TimelineSegmentIndex.prototype.isBeforeFirstEntry=function(a){return this.templateInfo_&&this.templateInfo_.timeline&&this.templateInfo_.timeline.length?a<this.templateInfo_.timeline[0].start+this.periodStart_:!1};
|
|
1801
1802
|
shaka.dash.TimelineSegmentIndex.prototype.fitTimeline=function(){if(!this.getIsImmutable()){for(var a=this.templateInfo_.timeline;a.length;)if(a[a.length-1].start>=this.periodEnd_)a.pop();else break;this.evict(this.periodStart_);0!==a.length&&Infinity!==this.periodEnd_&&(a[a.length-1].end=this.periodEnd_-this.periodStart_)}};
|
|
1802
1803
|
shaka.dash.TimelineSegmentIndex.prototype.find=function(a){shaka.log.debug("Find "+a);if(this.isBeforeFirstEntry(a))return this.numEvicted_;if(!this.templateInfo_)return null;var b=this.templateInfo_.timeline;if(a<this.periodStart_||a>this.periodEnd_)return null;for(var c=b.length-1,d=0;d<b.length;d++){var e=b[d],f=e.start+this.periodStart_;e=e.end+this.periodStart_;d<c&&(e=b[d+1].start+this.periodStart_);if(a>=f&&a<e)return d+this.numEvicted_}return null};
|
|
1803
|
-
shaka.dash.TimelineSegmentIndex.prototype.get=function(a){var b=this;a-=this.numEvicted_;if(0>a||a>=this.getNumReferences()||!this.templateInfo_)return null;var c=this.references[a];if(!c){var d=this.templateInfo_.mediaTemplate,e=this.templateInfo_.timeline[a],f=e.segmentPosition,g=this.templateInfo_.unscaledPresentationTimeOffset+e.unscaledStart;c=this.periodStart_-this.templateInfo_.scaledPresentationTimeOffset;for(var h=[],k=(e.end-e.start)/e.partialSegments,l={},m=0;m<e.partialSegments;l={$jscomp$loop$prop$uris$
|
|
1804
|
-
$jscomp$loop$prop$subNumber$
|
|
1804
|
+
shaka.dash.TimelineSegmentIndex.prototype.get=function(a){var b=this;a-=this.numEvicted_;if(0>a||a>=this.getNumReferences()||!this.templateInfo_)return null;var c=this.references[a];if(!c){var d=this.templateInfo_.mediaTemplate,e=this.templateInfo_.timeline[a],f=e.segmentPosition,g=this.templateInfo_.unscaledPresentationTimeOffset+e.unscaledStart;c=this.periodStart_-this.templateInfo_.scaledPresentationTimeOffset;for(var h=[],k=(e.end-e.start)/e.partialSegments,l={},m=0;m<e.partialSegments;l={$jscomp$loop$prop$uris$892:l.$jscomp$loop$prop$uris$892,
|
|
1805
|
+
$jscomp$loop$prop$subNumber$893:l.$jscomp$loop$prop$subNumber$893},m++){var n=e.start+k*m,p=n+k;l.$jscomp$loop$prop$subNumber$893=m+1;l.$jscomp$loop$prop$uris$892=null;var q=function(r){return function(){if(!b.templateInfo_)return[];null==r.$jscomp$loop$prop$uris$892&&(r.$jscomp$loop$prop$uris$892=shaka.dash.TimelineSegmentIndex.createUris_(b.templateInfo_.mediaTemplate,b.representationId_,f,b.bandwidth_,g,r.$jscomp$loop$prop$subNumber$893,b.getBaseUris_));return r.$jscomp$loop$prop$uris$892}}(l);
|
|
1805
1806
|
n=new shaka.media.SegmentReference(this.periodStart_+n,this.periodStart_+p,q,0,null,this.initSegmentReference_,c,this.periodStart_,this.periodEnd_,[],"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,this.aes128Key_);0==this.segmentSequenceCadence_?0<m&&n.markAsNonIndependent():0!=m%this.segmentSequenceCadence_&&n.markAsNonIndependent();h.push(n)}c=new shaka.media.SegmentReference(this.periodStart_+e.start,this.periodStart_+e.end,function(){return 0<e.partialSegments?[]:shaka.dash.TimelineSegmentIndex.createUris_(d,
|
|
1806
1807
|
b.representationId_,f,b.bandwidth_,g,null,b.getBaseUris_)},0,null,this.initSegmentReference_,c,this.periodStart_,this.periodEnd_,h,"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,this.aes128Key_,0<e.partialSegments);this.references[a]=c}return c};shaka.dash.TimelineSegmentIndex.createUris_=function(a,b,c,d,e,f,g){a=shaka.dash.MpdUtils.fillUriTemplate(a,b,c,f,d||null,e);return shaka.util.ManifestParserUtils.resolveUris(g(),[a]).map(function(h){return h.toString()})};shaka.util.ContentSteeringManager=function(a){this.config_=null;this.playerInterface_=a;this.operationManager_=new shaka.util.OperationManager;this.baseUris_=[];this.defaultPathwayId_=null;this.pathwayPriority_=[];this.lastPathwayUsed_=null;this.pathwayClones_=[];this.lastTTL_=300;this.locations_=new Map;this.bannedLocations_=new Map;this.updateTimer_=null;this.manifestType_=shaka.media.ManifestParser.UNKNOWN};shaka.util.ContentSteeringManager.prototype.configure=function(a){this.config_=a};
|
|
1807
1808
|
shaka.util.ContentSteeringManager.prototype.destroy=function(){this.playerInterface_=this.config_=null;this.baseUris_=[];this.defaultPathwayId_=null;this.pathwayPriority_=[];this.pathwayClones_=[];this.locations_.clear();null!=this.updateTimer_&&(this.updateTimer_.stop(),this.updateTimer_=null);return this.operationManager_.destroy()};shaka.util.ContentSteeringManager.prototype.setManifestType=function(a){this.manifestType_=a};
|
|
@@ -1811,8 +1812,8 @@ m.yield(f.promise,4);if(2!=m.nextAddress)return g=m.yieldResult,h=shaka.util.Str
|
|
|
1811
1812
|
shaka.util.ContentSteeringManager.prototype.addQueryParams_=function(a){if(!this.pathwayPriority_.length)return a;a=new goog.Uri(a);var b=this.lastPathwayUsed_||this.pathwayPriority_[0],c=Math.round(this.playerInterface_.getBandwidthEstimate()),d=a.getQueryData();this.manifestType_==shaka.media.ManifestParser.DASH?(d.add("_DASH_pathway",b),d.add("_DASH_throughput",String(c))):this.manifestType_==shaka.media.ManifestParser.HLS&&(d.add("_HLS_pathway",b),d.add("_HLS_throughput",String(c)));d.getCount()&&
|
|
1812
1813
|
a.setQueryData(d);return a.toString()};shaka.util.ContentSteeringManager.prototype.processManifest_=function(a,b){var c=this;null!=this.updateTimer_&&(this.updateTimer_.stop(),this.updateTimer_=null);var d=a["RELOAD-URI"]||b;this.updateTimer_=new shaka.util.Timer(function(){c.requestInfo(d)});if(b=a.TTL)this.lastTTL_=b;this.updateTimer_.tickAfter(this.lastTTL_);this.pathwayPriority_=a["PATHWAY-PRIORITY"]||[];this.pathwayClones_=a["PATHWAY-CLONES"]||[]};
|
|
1813
1814
|
shaka.util.ContentSteeringManager.prototype.clearPreviousLocations=function(){this.locations_.clear()};shaka.util.ContentSteeringManager.prototype.addLocation=function(a,b,c){var d=this.locations_.get(a);d||(d=new Map);d.set(b,c);this.locations_.set(a,d)};shaka.util.ContentSteeringManager.prototype.banLocation=function(a){var b=Date.now()+6E4;this.bannedLocations_.set(a,b)};
|
|
1814
|
-
shaka.util.ContentSteeringManager.prototype.getLocations=function(a,b){var c=this;b=void 0===b?!1:b;a=this.locations_.get(a)||new Map;for(var d=[],e={},f=$jscomp.makeIterator(this.pathwayPriority_),g=f.next();!g.done;e={$jscomp$loop$prop$pathwayId$
|
|
1815
|
-
k.$jscomp$loop$prop$pathwayId$
|
|
1815
|
+
shaka.util.ContentSteeringManager.prototype.getLocations=function(a,b){var c=this;b=void 0===b?!1:b;a=this.locations_.get(a)||new Map;for(var d=[],e={},f=$jscomp.makeIterator(this.pathwayPriority_),g=f.next();!g.done;e={$jscomp$loop$prop$pathwayId$895:e.$jscomp$loop$prop$pathwayId$895},g=f.next())if(e.$jscomp$loop$prop$pathwayId$895=g.value,g=a.get(e.$jscomp$loop$prop$pathwayId$895))d.push({pathwayId:e.$jscomp$loop$prop$pathwayId$895,location:g});else if(g=this.pathwayClones_.find(function(k){return function(l){return l.ID==
|
|
1816
|
+
k.$jscomp$loop$prop$pathwayId$895}}(e))){var h=a.get(g["BASE-ID"]);h&&(g["URI-REPLACEMENT"].HOST?(h=new goog.Uri(h),h.setDomain(g["URI-REPLACEMENT"].HOST),d.push({pathwayId:e.$jscomp$loop$prop$pathwayId$895,location:h.toString()})):d.push({pathwayId:e.$jscomp$loop$prop$pathwayId$895,location:h}))}e=Date.now();f=$jscomp.makeIterator(this.bannedLocations_.keys());for(g=f.next();!g.done;g=f.next())g=g.value,h=this.bannedLocations_.get(g),e>h&&this.bannedLocations_.delete(g);d=d.filter(function(k){for(var l=
|
|
1816
1817
|
$jscomp.makeIterator(c.bannedLocations_.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes((new goog.Uri(k.location)).getDomain()))return!1;return!0});d.length&&(this.lastPathwayUsed_=d[0].pathwayId);d=d.map(function(k){return k.location});if(!d.length&&this.defaultPathwayId_)for(e=$jscomp.makeIterator(this.defaultPathwayId_.split(",")),g=e.next();!g.done;g=e.next())if(f=a.get(g.value))this.lastPathwayUsed_=this.defaultPathwayId_,d.push(f);if(!d.length)for(a=$jscomp.makeIterator(a.values()),
|
|
1817
1818
|
e=a.next();!e.done;e=a.next())d.push(e.value);return b?d:shaka.util.ManifestParserUtils.resolveUris(this.baseUris_,d)};shaka.util.PeriodCombiner=function(){this.variants_=[];this.audioStreams_=[];this.videoStreams_=[];this.textStreams_=[];this.imageStreams_=[];this.multiTypeVariantsAllowed_=!1;this.usedPeriodIds_=new Set};
|
|
1818
1819
|
shaka.util.PeriodCombiner.prototype.release=function(){var a=this.audioStreams_.concat(this.videoStreams_,this.textStreams_,this.imageStreams_);a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.audioStreams_=[];this.videoStreams_=[];this.textStreams_=[];this.imageStreams_=[];this.variants_=[]};shaka.util.PeriodCombiner.prototype.getVariants=function(){return this.variants_};shaka.util.PeriodCombiner.prototype.getTextStreams=function(){return this.textStreams_.slice()};
|
|
@@ -1829,13 +1830,13 @@ b.VIDEO}).map(function(L){return[c.generateVideoKey_(L),L]}))});f=a.map(function
|
|
|
1829
1830
|
n.next())q=p.value,r=c.dummyStreamDB_(b.IMAGE),q.set(c.generateImageKey_(r),r);t=new shaka.util.PeriodCombiner;return K.yield(t.combine_([],d,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),2);case 2:return w=K.yieldResult,K.yield(t.combine_([],e,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),3);case 3:return u=K.yieldResult,K.yield(t.combine_([],f,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),
|
|
1830
1831
|
4);case 4:return v=K.yieldResult,K.yield(t.combine_([],g,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),5);case 5:x=K.yieldResult;y=0;if(u.length&&w.length)for(H=$jscomp.makeIterator(w),C=H.next();!C.done;C=H.next())for(G=C.value,E=$jscomp.makeIterator(u),F=E.next();!F.done;F=E.next())I=F.value,J=y++,I.variantIds.push(J),G.variantIds.push(J);else for(z=u.concat(w),A=$jscomp.makeIterator(z),B=A.next();!B.done;B=A.next())D=B.value,D.variantIds=[y++];return K.return(u.concat(w).concat(v).concat(x))}})};
|
|
1831
1832
|
shaka.util.PeriodCombiner.prototype.combine_=function(a,b,c,d,e){var f=this,g,h,k,l,m,n,p,q,r,t,w,u,v,x,y,z,A,B,D;return $jscomp.asyncExecutePromiseGeneratorProgram(function(H){switch(H.nextAddress){case 1:g=[];for(h=0;h<c;h++)g.push(new Set);for(k=c;k<b.length;k++)g.push(new Set(b[k].values()));l=$jscomp.makeIterator(a);m=l.next();case 2:if(m.done){H.jumpTo(4);break}n=m.value;return H.yield(f.extendExistingOutputStream_(n,b,c,e,g),5);case 5:p=H.yieldResult;if(!p)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
1832
|
-
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);m=l.next();H.jumpTo(2);break;case 4:q=$jscomp.makeIterator(g);for(r=q.next();!r.done;r=q.next())for(t=r.value,w=$jscomp.makeIterator(t),u=w.next();!u.done;u=w.next())v=u.value,(x=f.createNewOutputStream_(v,b,d,e,g))&&a.push(x);y=$jscomp.makeIterator(g);for(r=y.next();!r.done;r=y.next())for(z=r.value,A={},B=$jscomp.makeIterator(z),u=B.next();!u.done;A={$jscomp$loop$prop$stream$
|
|
1833
|
-
u=B.next())if(A.$jscomp$loop$prop$stream$
|
|
1833
|
+
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);m=l.next();H.jumpTo(2);break;case 4:q=$jscomp.makeIterator(g);for(r=q.next();!r.done;r=q.next())for(t=r.value,w=$jscomp.makeIterator(t),u=w.next();!u.done;u=w.next())v=u.value,(x=f.createNewOutputStream_(v,b,d,e,g))&&a.push(x);y=$jscomp.makeIterator(g);for(r=y.next();!r.done;r=y.next())for(z=r.value,A={},B=$jscomp.makeIterator(z),u=B.next();!u.done;A={$jscomp$loop$prop$stream$713$897:A.$jscomp$loop$prop$stream$713$897},
|
|
1834
|
+
u=B.next())if(A.$jscomp$loop$prop$stream$713$897=u.value,!shaka.util.PeriodCombiner.isDummy_(A.$jscomp$loop$prop$stream$713$897)&&(D=a.some(function(C){return function(G){return f.areAVStreamsCompatible_(C.$jscomp$loop$prop$stream$713$897,G)}}(A))))throw shaka.log.error("Unused stream in period-flattening!",A.$jscomp$loop$prop$stream$713$897,a),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);return H.return(a)}})};
|
|
1834
1835
|
shaka.util.PeriodCombiner.prototype.extendExistingOutputStream_=function(a,b,c,d,e){var f=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){if(1==g.nextAddress)return f.findMatchesInAllPeriods_(b,a),goog.asserts.assert(a.createSegmentIndex,"outputStream should be a Stream type!"),a.matchedStreams?a.segmentIndex?g.yield(shaka.util.PeriodCombiner.extendOutputSegmentIndex_(a,c),2):g.jumpTo(2):(shaka.log.error("No matches extending output stream!",a,b),g.return(!1));shaka.util.PeriodCombiner.extendOutputStream_(a,
|
|
1835
1836
|
c,d,e);return g.return(!0)})};
|
|
1836
1837
|
shaka.util.PeriodCombiner.extendOutputSegmentIndex_=function(a,b){var c,d,e,f,g,h,k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress){c=[];d=a.matchedStreams;goog.asserts.assert(d,"matched streams should be valid");e=$jscomp.makeIterator(d);for(f=e.next();!f.done;f=e.next())g=f.value,c.push(g.createSegmentIndex()),g.trickModeVideo&&!g.trickModeVideo.segmentIndex&&c.push(g.trickModeVideo.createSegmentIndex());return l.yield(Promise.all(c),2)}if(a.segmentIndex instanceof
|
|
1837
|
-
shaka.media.MetaSegmentIndex)for(h={},k=b;k<d.length;h={$jscomp$loop$prop$match$
|
|
1838
|
-
(n.initSegmentReference.codecs=m.$jscomp$loop$prop$match$
|
|
1838
|
+
shaka.media.MetaSegmentIndex)for(h={},k=b;k<d.length;h={$jscomp$loop$prop$match$899:h.$jscomp$loop$prop$match$899},k++)h.$jscomp$loop$prop$match$899=d[k],goog.asserts.assert(h.$jscomp$loop$prop$match$899.segmentIndex,"stream should have a segmentIndex."),h.$jscomp$loop$prop$match$899.segmentIndex&&(h.$jscomp$loop$prop$match$899.segmentIndex.forEachTopLevelReference(function(m){return function(n){n.codecs=m.$jscomp$loop$prop$match$899.codecs;n.mimeType=m.$jscomp$loop$prop$match$899.mimeType;n.initSegmentReference&&
|
|
1839
|
+
(n.initSegmentReference.codecs=m.$jscomp$loop$prop$match$899.codecs,n.initSegmentReference.mimeType=m.$jscomp$loop$prop$match$899.mimeType)}}(h)),a.segmentIndex.appendSegmentIndex(h.$jscomp$loop$prop$match$899.segmentIndex));l.jumpToEnd()})};
|
|
1839
1840
|
shaka.util.PeriodCombiner.prototype.createNewOutputStream_=function(a,b,c,d,e){if(shaka.util.PeriodCombiner.isDummy_(a))return null;var f=c(a);this.findMatchesInAllPeriods_(b,f);f.createSegmentIndex&&(f.createSegmentIndex=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){if(f.segmentIndex)return g.jumpTo(0);f.segmentIndex=new shaka.media.MetaSegmentIndex;return g.yield(shaka.util.PeriodCombiner.extendOutputSegmentIndex_(f,0),0)})});if(!f.matchedStreams||!f.matchedStreams.length)return null;
|
|
1840
1841
|
shaka.util.PeriodCombiner.extendOutputStream_(f,0,d,e);return f};
|
|
1841
1842
|
shaka.util.PeriodCombiner.extendOutputStream_=function(a,b,c,d){var e=shaka.util.ManifestParserUtils.ContentType,f=shaka.util.LanguageUtils,g=a.matchedStreams;for(goog.asserts.assert(a.matchedStreams,"matchedStreams should be non-null");b<g.length;b++){var h=g[b];c(a,h);var k=!0;a.type==e.AUDIO&&0==f.relatedness(a.language,h.language)&&(k=!1);if(k){d[b].delete(h);k=new Set(a.codecs.split(","));h=$jscomp.makeIterator(h.codecs.split(","));for(var l=h.next();!l.done;l=h.next())k.add(l.value);a.codecs=
|
|
@@ -1898,8 +1899,8 @@ m);g=this.parsePeriod_(a,b,{start:m,duration:q,node:k,isLastPeriod:null==q||!l})
|
|
|
1898
1899
|
duration:e,durationDerivedFromPeriods:!1}):{periods:f,duration:g,durationDerivedFromPeriods:!0}};
|
|
1899
1900
|
shaka.dash.DashParser.prototype.parsePeriod_=function(a,b,c){var d=this,e=shaka.util.Functional,f=shaka.util.XmlUtils,g=shaka.util.ManifestParserUtils.ContentType;a.period=this.createFrame_(c.node,null,b);a.periodInfo=c;a.period.availabilityTimeOffset=a.availabilityTimeOffset;a.period.id||(shaka.log.info("No Period ID given for Period with start time "+c.start+", Assigning a default"),a.period.id="__shaka_period_"+c.start);var h=f.findChildren(c.node,"EventStream");b=a.presentationTimeline.getSegmentAvailabilityStart();
|
|
1900
1901
|
h=$jscomp.makeIterator(h);for(var k=h.next();!k.done;k=h.next())this.parseEventStream_(c.start,c.duration,k.value,b);e=f.findChildren(c.node,"AdaptationSet").map(function(n){return d.parseAdaptationSet_(a,n)}).filter(e.isNotNull);if(a.dynamic){c=[];f=$jscomp.makeIterator(e);for(b=f.next();!b.done;b=f.next())for(b=$jscomp.makeIterator(b.value.representationIds),h=b.next();!h.done;h=b.next())c.push(h.value);f=new Set(c);if(c.length!=f.size)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
1901
|
-
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);}c=e.filter(function(n){return!n.trickModeFor});e=e.filter(function(n){return n.trickModeFor});e=$jscomp.makeIterator(e);for(f=e.next();!f.done;f=e.next())for(f=f.value,b=f.trickModeFor.split(" "),h=$jscomp.makeIterator(c),k=h.next();!k.done;k=h.next()){var l=k.value;if(b.includes(l.id)){k={};l=$jscomp.makeIterator(l.streams);for(var m=l.next();!m.done;k={$jscomp$loop$prop$stream$
|
|
1902
|
-
m=l.next())k.$jscomp$loop$prop$stream$
|
|
1902
|
+
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);}c=e.filter(function(n){return!n.trickModeFor});e=e.filter(function(n){return n.trickModeFor});e=$jscomp.makeIterator(e);for(f=e.next();!f.done;f=e.next())for(f=f.value,b=f.trickModeFor.split(" "),h=$jscomp.makeIterator(c),k=h.next();!k.done;k=h.next()){var l=k.value;if(b.includes(l.id)){k={};l=$jscomp.makeIterator(l.streams);for(var m=l.next();!m.done;k={$jscomp$loop$prop$stream$901:k.$jscomp$loop$prop$stream$901},
|
|
1903
|
+
m=l.next())k.$jscomp$loop$prop$stream$901=m.value,k.$jscomp$loop$prop$stream$901.trickModeVideo=f.streams.find(function(n){return function(p){return shaka.util.MimeUtils.getNormalizedCodec(n.$jscomp$loop$prop$stream$901.codecs)==shaka.util.MimeUtils.getNormalizedCodec(p.codecs)}}(k))}}e=this.getStreamsFromSets_(this.config_.disableAudio,c,g.AUDIO);f=this.getStreamsFromSets_(this.config_.disableVideo,c,g.VIDEO);b=this.getStreamsFromSets_(this.config_.disableText,c,g.TEXT);g=this.getStreamsFromSets_(this.config_.disableThumbnails,
|
|
1903
1904
|
c,g.IMAGE);if(0===f.length&&0===e.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.DASH_EMPTY_PERIOD);return{id:a.period.id,audioStreams:e,videoStreams:f,textStreams:b,imageStreams:g}};shaka.dash.DashParser.prototype.getStreamsFromSets_=function(a,b,c){return a||!b.length?[]:b.reduce(function(d,e){if(e.contentType!=c)return d;d.push.apply(d,$jscomp.arrayFromIterable(e.streams));return d},[])};
|
|
1904
1905
|
shaka.dash.DashParser.prototype.parseAdaptationSet_=function(a,b){var c=this,d=shaka.util.XmlUtils,e=shaka.util.Functional,f=shaka.util.ManifestParserUtils,g=f.ContentType,h=shaka.dash.ContentProtection;a.adaptationSet=this.createFrame_(b,a.period,null);var k=!1,l=d.findChildren(b,"Role"),m=l.map(function(E){return E.getAttribute("value")}).filter(e.isNotNull),n=void 0;if(e=a.adaptationSet.contentType==g.TEXT)n=f.TextStreamKind.SUBTITLE;l=$jscomp.makeIterator(l);for(var p=l.next();!p.done;p=l.next()){p=
|
|
1905
1906
|
p.value;var q=p.getAttribute("schemeIdUri");if(null==q||"urn:mpeg:dash:role:2011"==q)switch(p=p.getAttribute("value"),p){case "main":k=!0;break;case "caption":case "subtitle":n=p}}var r;q=function(E){switch(E){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var t=d.findChildren(b,"EssentialProperty");l=null;var w=!1;p=!1;t=$jscomp.makeIterator(t);for(var u=t.next();!u.done;u=t.next()){u=u.value;var v=u.getAttribute("schemeIdUri");"http://dashif.org/guidelines/trickmode"==
|
|
@@ -1999,8 +2000,9 @@ shaka.hls.HlsParser.prototype.getMediaPlaylistBasicInfo_=function(a,b){var c=thi
|
|
|
1999
2000
|
h[0];l=new goog.Uri(k);m=l.getPath().split(".").pop();if(n=d.RAW_FORMATS_TO_MIME_TYPES_[m])return D.return(shaka.media.SegmentUtils.getBasicInfoFromMimeType(n));p=shaka.net.NetworkingEngine.RequestType.SEGMENT;q=null;r=c.getInitSegmentReference_(a,g.tags,b);c.mapTagToInitSegmentRefMap_.clear();if(!r){D.jumpTo(2);break}t=shaka.net.NetworkingEngine.makeRequest(r.getUris(),c.config_.retryParameters);w=shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT;return D.yield(c.makeNetworkRequest_(t,
|
|
2000
2001
|
p,{type:w}),3);case 3:u=D.yieldResult,q=u.data;case 2:return v=shaka.net.NetworkingEngine.makeRequest(h,c.config_.retryParameters),x=shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT,D.yield(c.makeNetworkRequest_(v,p,{type:x}),4);case 4:y=D.yieldResult;(z=y.headers["content-type"])&&(z=z.split(";")[0].toLowerCase());if("ts"==m||"video/mp2t"==z){if(A=shaka.media.SegmentUtils.getBasicInfoFromTs(y.data))return D.return(A)}else if("mp4"==m||"cmfv"==m||"m4s"==m||"video/mp4"==z||"audio/mp4"==
|
|
2001
2002
|
z||"video/iso.segment"==z)if(B=shaka.media.SegmentUtils.getBasicInfoFromMp4(q,y.data))return D.return(B);return D.return(e)}})};
|
|
2002
|
-
shaka.hls.HlsParser.prototype.determineDuration_=function(){goog.asserts.assert(this.presentationTimeline_,"Presentation timeline not created!");if(this.isLive_()){if(this.presentationType_==shaka.hls.HlsParser.PresentationType_.LIVE){var a=this.getLiveDuration_();this.config_.hls.useSafariBehaviorForLive&&(a=this.presentationTimeline_.getDelay());isNaN(this.config_.availabilityWindowOverride)||(a=this.config_.availabilityWindowOverride);this.presentationTimeline_.setSegmentAvailabilityDuration(a)}
|
|
2003
|
-
this.presentationTimeline_.lockStartTime();goog.asserts.assert(!this.presentationTimeline_.usingPresentationStartTime(),
|
|
2003
|
+
shaka.hls.HlsParser.prototype.determineDuration_=function(){goog.asserts.assert(this.presentationTimeline_,"Presentation timeline not created!");if(this.isLive_()){if(this.presentationType_==shaka.hls.HlsParser.PresentationType_.LIVE){var a=this.getLiveDuration_();this.config_.hls.useSafariBehaviorForLive&&(a=this.presentationTimeline_.getDelay());isNaN(this.config_.availabilityWindowOverride)||(a=this.config_.availabilityWindowOverride);this.presentationTimeline_.setSegmentAvailabilityDuration(a)}if(!this.presentationTimeline_.isStartTimeLocked()){a=
|
|
2004
|
+
Array.from(this.uriToStreamInfosMap_.values()).filter(function(c){return c.stream.segmentIndex});a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b=b.value,("audio"==b.type||"video"==b.type)&&(b=b.stream.segmentIndex.get(0))&&b.syncTime&&this.presentationTimeline_.setPresentationStartTime(b.syncTime)}}else this.presentationTimeline_.setDuration(this.getMinDuration_());this.presentationTimeline_.lockStartTime();goog.asserts.assert(!this.presentationTimeline_.usingPresentationStartTime(),
|
|
2005
|
+
"We should not be using the presentation start time in HLS!")};
|
|
2004
2006
|
shaka.hls.HlsParser.prototype.parseMasterVariables_=function(a){var b=(new goog.Uri(this.masterPlaylistUri_)).getQueryData();a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next()){var d=c.value;c=d.getAttributeValue("NAME");var e=d.getAttributeValue("VALUE");d=d.getAttributeValue("QUERYPARAM");c&&e&&(this.globalVariables_.has(c)||this.globalVariables_.set(c,e));d&&(c=b.get(d)[0])&&!this.globalVariables_.has(c)&&this.globalVariables_.set(d,c)}};
|
|
2005
2007
|
shaka.hls.HlsParser.prototype.parseMediaVariables_=function(a,b){b=(new goog.Uri(b)).getQueryData();var c=new Map;a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){var e=d.value,f=e.getAttributeValue("NAME"),g=e.getAttributeValue("VALUE");d=e.getAttributeValue("QUERYPARAM");e=e.getAttributeValue("IMPORT");f&&g&&(c.has(f)||c.set(f,g));d&&(f=b.get(d)[0])&&!c.has(f)&&c.set(d,f);e&&(d=this.globalVariables_.get(e))&&c.set(e,d)}return c};
|
|
2006
2008
|
shaka.hls.HlsParser.prototype.parseCodecs_=function(a){var b=shaka.util.ManifestParserUtils.ContentType;a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next()){var d=c.value,e=d.getAttributeValue("AUDIO");c=d.getAttributeValue("VIDEO");var f=d.getAttributeValue("SUBTITLES");d=this.getCodecsForVariantTag_(d);if(f){var g=shaka.util.ManifestParserUtils.guessCodecsSafe(b.TEXT,d);goog.asserts.assert(null!=g,"Text codecs should be valid.");this.groupIdToCodecsMap_.set(f,g);shaka.util.ArrayUtils.remove(d,
|
|
@@ -2077,19 +2079,19 @@ e.id&&(h=this.parseAES128DrmTag_(l,a,c,d)):"EXT-X-BYTERANGE"==l.name&&l.id<e.id&
|
|
|
2077
2079
|
shaka.hls.HlsParser.prototype.createInitSegmentReference_=function(a,b,c,d){var e=0,f=null;b=b.getAttributeValue("BYTERANGE");!b&&c&&(b=c.value);b&&(e=b.split("@"),f=Number(e[0]),e=Number(e[1]),f=e+f-1,d&&(c=f+1-e,c%16&&(f+=16-c%16)));return new shaka.media.InitSegmentReference(function(){return a},e,f,null,null,null,d)};
|
|
2078
2080
|
shaka.hls.HlsParser.prototype.createSegmentReference_=function(a,b,c,d,e,f,g,h,k){var l=c.tags,m=shaka.hls.Utils.getFirstTagWithName(l,"EXTINF"),n=0;f=0;var p=null;c.partialSegments.length&&!this.lowLatencyMode_&&shaka.log.alwaysWarn("Low-latency HLS live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details.");var q=null;if(!this.config_.hls.ignoreManifestProgramDateTime){var r=
|
|
2079
2081
|
shaka.hls.Utils.getFirstTagWithName(l,"EXT-X-PROGRAM-DATE-TIME");r&&r.value&&(q=shaka.util.XmlUtils.parseDate(r.value),goog.asserts.assert(null!=q,"EXT-X-PROGRAM-DATE-TIME format not valid"))}var t=shaka.media.SegmentReference.Status.AVAILABLE;shaka.hls.Utils.getFirstTagWithName(l,"EXT-X-GAP")&&(t=shaka.media.SegmentReference.Status.MISSING);if(!m){if(0==c.partialSegments.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING,
|
|
2080
|
-
"EXTINF");if(!this.lowLatencyMode_)return null}var w=[];r=!1;var u=null,v=!1,x=!1;if(this.lowLatencyMode_&&c.partialSegments.length){n=("video/mp4"==g.mimeType||"audio/mp4"==g.mimeType)&&window.ReadableStream&&this.config_.hls.allowLowLatencyByteRangeOptimization;for(var y=q,z={},A=0;A<c.partialSegments.length;z={$jscomp$loop$prop$uris$
|
|
2081
|
-
C=Number(B.getAttributeValue("DURATION"))||this.partialTargetDuration_;if(C){var G=H+C,E=0,F=null;"EXT-X-PRELOAD-HINT"==B.name?(E=(E=B.getAttributeValue("BYTERANGE-START"))?Number(E):0,(D=B.getAttributeValue("BYTERANGE-LENGTH"))?F=E+Number(D)-1:E&&(F=Number.MAX_SAFE_INTEGER)):(E=B.getAttributeValue("BYTERANGE"),F=$jscomp.makeIterator(this.parseByteRange_(D,E)),E=F.next().value,F=F.next().value);z.$jscomp$loop$prop$pUri$
|
|
2082
|
-
"YES"==B.getAttributeValue("GAP")&&(D=shaka.media.SegmentReference.Status.MISSING,v=!0);z.$jscomp$loop$prop$uris$
|
|
2082
|
+
"EXTINF");if(!this.lowLatencyMode_)return null}var w=[];r=!1;var u=null,v=!1,x=!1;if(this.lowLatencyMode_&&c.partialSegments.length){n=("video/mp4"==g.mimeType||"audio/mp4"==g.mimeType)&&window.ReadableStream&&this.config_.hls.allowLowLatencyByteRangeOptimization;for(var y=q,z={},A=0;A<c.partialSegments.length;z={$jscomp$loop$prop$uris$748$903:z.$jscomp$loop$prop$uris$748$903,$jscomp$loop$prop$pUri$904:z.$jscomp$loop$prop$pUri$904},A++){var B=c.partialSegments[A],D=0==A?b:w[w.length-1],H=0==A?d:D.endTime,
|
|
2083
|
+
C=Number(B.getAttributeValue("DURATION"))||this.partialTargetDuration_;if(C){var G=H+C,E=0,F=null;"EXT-X-PRELOAD-HINT"==B.name?(E=(E=B.getAttributeValue("BYTERANGE-START"))?Number(E):0,(D=B.getAttributeValue("BYTERANGE-LENGTH"))?F=E+Number(D)-1:E&&(F=Number.MAX_SAFE_INTEGER)):(E=B.getAttributeValue("BYTERANGE"),F=$jscomp.makeIterator(this.parseByteRange_(D,E)),E=F.next().value,F=F.next().value);z.$jscomp$loop$prop$pUri$904=B.getAttributeValue("URI");if(z.$jscomp$loop$prop$pUri$904){D=shaka.media.SegmentReference.Status.AVAILABLE;
|
|
2084
|
+
"YES"==B.getAttributeValue("GAP")&&(D=shaka.media.SegmentReference.Status.MISSING,v=!0);z.$jscomp$loop$prop$uris$748$903=null;var I=function(K){return function(){null==K.$jscomp$loop$prop$uris$748$903&&(goog.asserts.assert(K.$jscomp$loop$prop$pUri$904,"Partial uri should be defined!"),K.$jscomp$loop$prop$uris$748$903=shaka.hls.Utils.constructSegmentUris(h(),K.$jscomp$loop$prop$pUri$904,e));return K.$jscomp$loop$prop$uris$748$903}}(z);n&&0<=E&&null!=F&&(u=I,r=!0);H=new shaka.media.SegmentReference(H,
|
|
2083
2085
|
G,I,E,F,a,0,0,Infinity,[],"",null,y,D,k);"EXT-X-PRELOAD-HINT"==B.name&&(H.markAsPreload(),x=!0);"YES"!=B.getAttributeValue("INDEPENDENT")&&0<A&&H.markAsNonIndependent();w.push(H);y&&(y+=C)}}}}if(m){m=m.value.split(",");m=Number(m[0]);if(0==m)return null;n=d+m}else if(w.length)n=w[w.length-1].endTime;else return null;r&&(v||0!=w[0].startByte?(r=!1,u=null):w=[]);(v=shaka.hls.Utils.getFirstTagWithName(l,"EXT-X-BYTERANGE"))?(p=$jscomp.makeIterator(this.parseByteRange_(b,v.value)),f=p.next().value,p=p.next().value):
|
|
2084
2086
|
w.length&&(f=w[0].startByte,p=w[w.length-1].endByte);b="";v=null;g.type==shaka.util.ManifestParserUtils.ContentType.IMAGE&&(b="1x1",g=shaka.hls.Utils.getFirstTagWithName(l,"EXT-X-TILES"))&&(b=g.getRequiredAttrValue("LAYOUT"),(g=g.getAttributeValue("DURATION"))&&(v=Number(g)));var J=null;a=new shaka.media.SegmentReference(d,n,function(){if(u)return u();null==J&&(J=shaka.hls.Utils.constructSegmentUris(h(),c.verbatimSegmentUri,e));return J||[]},f,p,a,0,0,Infinity,w,b,v,q,t,k,0<w.length&&!!c.verbatimSegmentUri);
|
|
2085
2087
|
r&&(this.lowLatencyByterangeOptimization_=!0,a.markAsByterangeOptimization(),x&&a.markAsPreload());return a};shaka.hls.HlsParser.prototype.parseByteRange_=function(a,b){var c=0,d=null;b&&(c=b.split("@"),b=Number(c[0]),c[1]?c=Number(c[1]):(goog.asserts.assert(a,"Cannot refer back to previous HLS segment!"),c=a.endByte+1),d=c+b-1);return[c,d]};
|
|
2086
2088
|
shaka.hls.HlsParser.prototype.createSegments_=function(a,b,c,d,e){var f=a.segments;goog.asserts.assert(f.length,"Playlist should have segments!");var g=void 0,h=shaka.hls.Utils.getFirstTagWithNameAsNumber(a.tags,"EXT-X-DISCONTINUITY-SEQUENCE",0),k=shaka.hls.Utils.getFirstTagWithNameAsNumber(a.tags,"EXT-X-MEDIA-SEQUENCE",0),l=shaka.hls.Utils.getFirstTagWithName(a.tags,"EXT-X-SKIP"),m=l?Number(l.getAttributeValue("SKIPPED-SEGMENTS")):0,n=k+m,p=0;this.isLive_()&&c.has(n)&&(p=c.get(n));0===p&&this.presentationType_==
|
|
2087
2089
|
shaka.hls.HlsParser.PresentationType_.LIVE&&0<c.size&&!c.has(n)&&(p=this.presentationTimeline_.getSegmentAvailabilityStart());var q=[],r=null;l=[];for(var t=0;t<f.length;t++){var w=f[t],u=0==t?p:r.endTime;n=k+m+t;shaka.hls.Utils.getFirstTagWithName(w.tags,"EXT-X-DISCONTINUITY")&&h++;var v=$jscomp.makeIterator(w.tags);for(var x=v.next();!x.done;x=v.next())x=x.value,"EXT-X-KEY"==x.name&&(g="AES-128"==x.getRequiredAttrValue("METHOD")?this.parseAES128DrmTag_(x,a,e,d):void 0);c.set(n,u);v=this.getInitSegmentReference_(a,
|
|
2088
2090
|
w.tags,e,d);!this.lowLatencyMode_&&this.playerInterface_.isAutoLowLatencyMode()&&(this.playerInterface_.enableLowLatencyMode(),this.lowLatencyMode_=this.playerInterface_.isLowLatencyMode());if(u=this.createSegmentReference_(v,r,w,u,d,a,b,e,g))(r=shaka.hls.Utils.getFirstTagWithNameAsNumber(w.tags,"EXT-X-BITRATE"))?l.push({bitrate:r,duration:u.endTime-u.startTime}):l.length&&(r=l.pop(),r.duration+=u.endTime-u.startTime,l.push(r)),r=u,u.discontinuitySequence=h,this.config_.hls.ignoreManifestProgramDateTime&&
|
|
2089
|
-
null!=this.minSequenceNumber_&&n<this.minSequenceNumber_||q.push(u)}a=void 0;l.length&&(a=l.reduce(function(y,z){return y+z.duration},0),a=Math.round(l.reduce(function(y,z){return y+z.bitrate*z.duration},0)/a*1E3));if(l=q.some(function(y){return null!=y.syncTime}))for(b={},c=0;c<q.length;b={$jscomp$loop$prop$forwardI$
|
|
2090
|
-
$jscomp$loop$prop$backwardAdd$
|
|
2091
|
-
b.$jscomp$loop$prop$backwardAdd$
|
|
2092
|
-
(b.$jscomp$loop$prop$reference$
|
|
2091
|
+
null!=this.minSequenceNumber_&&n<this.minSequenceNumber_||q.push(u)}a=void 0;l.length&&(a=l.reduce(function(y,z){return y+z.duration},0),a=Math.round(l.reduce(function(y,z){return y+z.bitrate*z.duration},0)/a*1E3));if(l=q.some(function(y){return null!=y.syncTime}))for(b={},c=0;c<q.length;b={$jscomp$loop$prop$forwardI$906:b.$jscomp$loop$prop$forwardI$906,$jscomp$loop$prop$forwardAdd$907:b.$jscomp$loop$prop$forwardAdd$907,$jscomp$loop$prop$backwardI$908:b.$jscomp$loop$prop$backwardI$908,$jscomp$loop$prop$reference$751$909:b.$jscomp$loop$prop$reference$751$909,
|
|
2092
|
+
$jscomp$loop$prop$backwardAdd$910:b.$jscomp$loop$prop$backwardAdd$910},c++)if(b.$jscomp$loop$prop$reference$751$909=q[c],null==b.$jscomp$loop$prop$reference$751$909.syncTime)for(b.$jscomp$loop$prop$forwardAdd$907=0,b.$jscomp$loop$prop$forwardI$906=c,d=function(y){return function(){var z=q[y.$jscomp$loop$prop$forwardI$906];if(z){if(null!=z.syncTime)return z.syncTime+y.$jscomp$loop$prop$forwardAdd$907;y.$jscomp$loop$prop$forwardAdd$907-=z.endTime-z.startTime;y.$jscomp$loop$prop$forwardI$906+=1}return null}}(b),
|
|
2093
|
+
b.$jscomp$loop$prop$backwardAdd$910=0,b.$jscomp$loop$prop$backwardI$908=c,e=function(y){return function(){var z=q[y.$jscomp$loop$prop$backwardI$908];if(z){z!=y.$jscomp$loop$prop$reference$751$909&&(y.$jscomp$loop$prop$backwardAdd$910+=z.endTime-z.startTime);if(null!=z.syncTime)return z.syncTime+y.$jscomp$loop$prop$backwardAdd$910;--y.$jscomp$loop$prop$backwardI$908}return null}}(b);null==b.$jscomp$loop$prop$reference$751$909.syncTime;)b.$jscomp$loop$prop$reference$751$909.syncTime=e(),null==b.$jscomp$loop$prop$reference$751$909.syncTime&&
|
|
2094
|
+
(b.$jscomp$loop$prop$reference$751$909.syncTime=d());if(l)for(b=$jscomp.makeIterator(q),c=b.next();!c.done;c=b.next())for(d=c.value,c=d.syncTime,d=$jscomp.makeIterator(d.partialReferences),e=d.next();!e.done;e=d.next())e=e.value,e.syncTime=c,c+=e.endTime-e.startTime;b=this.lowestSyncTime_;if(l&&Infinity!=b)for(l=$jscomp.makeIterator(q),c=l.next();!c.done;c=l.next())c.value.syncAgainst(b);return{segments:q,bandwidth:a}};
|
|
2093
2095
|
shaka.hls.HlsParser.prototype.guessMimeTypeBeforeLoading_=function(a,b){if(a==shaka.util.ManifestParserUtils.ContentType.TEXT){if("vtt"==b||"wvtt"==b)return"text/vtt";if(b&&""!==b)return"application/mp4"}return a!=shaka.util.ManifestParserUtils.ContentType.IMAGE||b&&"jpeg"!=b?a==shaka.util.ManifestParserUtils.ContentType.AUDIO&&"mp4a.40.34"==b?"audio/mpeg":"mjpg"==b?"application/mp4":null:"image/jpeg"};
|
|
2094
2096
|
shaka.hls.HlsParser.prototype.guessMimeTypeFallback_=function(a){return a==shaka.util.ManifestParserUtils.ContentType.TEXT?"text/vtt":shaka.hls.HlsParser.EXTENSION_MAP_BY_CONTENT_TYPE_[a].mp4};
|
|
2095
2097
|
shaka.hls.HlsParser.prototype.guessMimeType_=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:g=shaka.hls.HlsParser;h=shaka.net.NetworkingEngine.RequestType.SEGMENT;goog.asserts.assert(c.segments.length,"Playlist should have segments!");k=Math.trunc((c.segments.length-1)/2);l=shaka.hls.Utils.constructSegmentUris(e(),c.segments[k].verbatimSegmentUri,d);m=new goog.Uri(l[0]);n=m.getPath().split(".").pop();
|
|
@@ -2186,8 +2188,8 @@ l,d,v);v.mssPrivateData.codecPrivateData=k;switch(l){case "audio":if(!k)return s
|
|
|
2186
2188
|
f.initSegmentDataByStreamId_.set(v.id,x);x=new shaka.media.InitSegmentReference(function(){return[]},0,null,null,void 0,x);x=f.createSegments_(x,v,a,c);v.segmentIndex=new shaka.media.SegmentIndex(x);return Promise.resolve()};v.closeSegmentIndex=function(){v.segmentIndex&&(v.segmentIndex.release(),v.segmentIndex=null)};return v};
|
|
2187
2189
|
shaka.mss.MssParser.prototype.getCodecPrivateData_=function(a,b,c,d){if(a=a.getAttribute("CodecPrivateData"))return a;if("audio"!==b)return null;b=d.channelsCount||2;a=d.audioSamplingRate||44100;var e={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12};d=e[a];if("AACH"===c)return c=new Uint8Array(4),a=e[2*a],c[0]=40|d>>1,c[1]=d<<7|b<<3|a>>1,c[2]=a<<7|8,c[3]=0,b=new Uint16Array(2),b[0]=(c[0]<<8)+c[1],b[1]=(c[2]<<8)+c[3],b[0].toString(16)+b[1].toString(16);
|
|
2188
2190
|
c=new Uint8Array(2);c[0]=16|d>>1;c[1]=d<<7|b<<3;b=new Uint16Array(1);b[0]=(c[0]<<8)+c[1];return b[0].toString(16)};shaka.mss.MssParser.prototype.getAACCodec_=function(a,b,c){a=0;"AACH"===b&&(a=5);c?0===a&&(a=(parseInt(c.substr(0,2),16)&248)>>3):(a=2,"AACH"===b&&(a=5));return"mp4a.40."+a};shaka.mss.MssParser.prototype.getH264Codec_=function(a,b){a=/00000001[0-9]7/.exec(b);return a.length&&b?"avc1."+b.substr(b.indexOf(a[0])+10,6):""};
|
|
2189
|
-
shaka.mss.MssParser.prototype.createSegments_=function(a,b,c,d){var e=this,f=shaka.util.ManifestParserUtils;c=c.getAttribute("Url");goog.asserts.assert(c,"Missing URL for segments");var g=c.replace("{bitrate}",String(b.bandwidth));c=[];var h={};d=$jscomp.makeIterator(d);for(var k=d.next();!k.done;h={$jscomp$loop$prop$time$
|
|
2190
|
-
String(l.$jscomp$loop$prop$time$
|
|
2191
|
+
shaka.mss.MssParser.prototype.createSegments_=function(a,b,c,d){var e=this,f=shaka.util.ManifestParserUtils;c=c.getAttribute("Url");goog.asserts.assert(c,"Missing URL for segments");var g=c.replace("{bitrate}",String(b.bandwidth));c=[];var h={};d=$jscomp.makeIterator(d);for(var k=d.next();!k.done;h={$jscomp$loop$prop$time$912:h.$jscomp$loop$prop$time$912},k=d.next())h.$jscomp$loop$prop$time$912=k.value,k=function(l){return function(){return f.resolveUris(e.manifestUris_,[g.replace("{start time}",
|
|
2192
|
+
String(l.$jscomp$loop$prop$time$912.unscaledStart))])}}(h),c.push(new shaka.media.SegmentReference(h.$jscomp$loop$prop$time$912.start,h.$jscomp$loop$prop$time$912.end,k,0,null,a,0,0,b.mssPrivateData.duration));return c};
|
|
2191
2193
|
shaka.mss.MssParser.prototype.createTimeline_=function(a,b,c){goog.asserts.assert(0<b&&Infinity>b,"timescale must be a positive, finite integer");goog.asserts.assert(0<c,"duration must be a positive integer");var d=shaka.util.XmlUtils;a=d.findChildren(a,"c");for(var e=[],f=0,g=0;g<a.length;++g){var h=a[g],k=a[g+1],l=d.parseAttr(h,"t",d.parseNonNegativeInt),m=d.parseAttr(h,"d",d.parseNonNegativeInt),n=d.parseAttr(h,"r",d.parseInt);if(!m){shaka.log.warning('"c" element must have a duration:','ignoring the remaining "c" elements.',
|
|
2192
2194
|
h);break}l=null!=l?l:f;n=n||0;if(0>n)if(k){k=d.parseAttr(k,"t",d.parseNonNegativeInt);if(null==k){shaka.log.warning('An "c" element cannot have a negative repeat','if the next "c" element does not have a valid start time:','ignoring the remaining "c" elements.',h);break}else if(l>=k){shaka.log.warning('An "c" element cannot have a negative repeatif its start ','time exceeds the next "c" element\'s start time:','ignoring the remaining "c" elements.',h);break}n=Math.ceil((k-l)/m)-1}else{if(Infinity==
|
|
2193
2195
|
c){shaka.log.warning('The last "c" element cannot have a negative repeat',"if the Period has an infinite duration:",'ignoring the last "c" element.',h);break}else if(l/b>=c){shaka.log.warning('The last "c" element cannot have a negative repeat',"if its start time exceeds the duration:",'igoring the last "c" element.',h);break}n=Math.ceil((c*b-l)/m)-1}for(h=0;h<=n;++h)f=l+m,e.push({start:l/b,end:f/b,unscaledStart:l}),l=f}return e};
|
|
@@ -2226,10 +2228,10 @@ shaka.offline.indexeddb.BaseStorageCell.prototype.getManifests=function(a){var b
|
|
|
2226
2228
|
shaka.offline.indexeddb.BaseStorageCell.prototype.getAllManifests=function(){var a=this,b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){return 1==d.nextAddress?(b=a.connection_.startReadOnlyOperation(a.manifestStore_),c=new Map,d.yield(b.forEachEntry(function(e,f){var g;return $jscomp.asyncExecutePromiseGeneratorProgram(function(h){if(1==h.nextAddress)return h.yield(a.convertManifest(f),2);g=h.yieldResult;c.set(e,g);h.jumpToEnd()})}),2)):3!=d.nextAddress?d.yield(b.promise(),3):
|
|
2227
2229
|
d.return(c)})};shaka.offline.indexeddb.BaseStorageCell.prototype.convertSegmentData=function(a){return a};shaka.offline.indexeddb.BaseStorageCell.prototype.convertManifest=function(a){return Promise.resolve(a)};shaka.offline.indexeddb.BaseStorageCell.prototype.rejectAdd=function(a){return Promise.reject(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.NEW_KEY_OPERATION_NOT_SUPPORTED,"Cannot add new value to "+a))};
|
|
2228
2230
|
shaka.offline.indexeddb.BaseStorageCell.prototype.rejectUpdate=function(a){return Promise.reject(new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.MODIFY_OPERATION_NOT_SUPPORTED,"Cannot modify values in "+a))};
|
|
2229
|
-
shaka.offline.indexeddb.BaseStorageCell.prototype.add=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){d=c.connection_.startReadWriteOperation(a);e=d.store();f=[];g={};h=$jscomp.makeIterator(b);for(k=h.next();!k.done;g={$jscomp$loop$prop$request$
|
|
2230
|
-
return m.yield(d.promise(),2)}return m.return(f)})};shaka.offline.indexeddb.BaseStorageCell.prototype.remove_=function(a,b,c){a=this.connection_.startReadWriteOperation(a);var d=a.store(),e={};b=$jscomp.makeIterator(b);for(var f=b.next();!f.done;e={$jscomp$loop$prop$key$
|
|
2231
|
-
shaka.offline.indexeddb.BaseStorageCell.prototype.get_=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){d=c.connection_.startReadOnlyOperation(a);e=d.store();f={};g=[];h={};k=$jscomp.makeIterator(b);for(l=k.next();!l.done;h={$jscomp$loop$prop$request$
|
|
2232
|
-
h.$jscomp$loop$prop$request$
|
|
2231
|
+
shaka.offline.indexeddb.BaseStorageCell.prototype.add=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){d=c.connection_.startReadWriteOperation(a);e=d.store();f=[];g={};h=$jscomp.makeIterator(b);for(k=h.next();!k.done;g={$jscomp$loop$prop$request$914:g.$jscomp$loop$prop$request$914},k=h.next())l=k.value,g.$jscomp$loop$prop$request$914=e.add(l),g.$jscomp$loop$prop$request$914.onsuccess=function(n){return function(p){f.push(n.$jscomp$loop$prop$request$914.result)}}(g);
|
|
2232
|
+
return m.yield(d.promise(),2)}return m.return(f)})};shaka.offline.indexeddb.BaseStorageCell.prototype.remove_=function(a,b,c){a=this.connection_.startReadWriteOperation(a);var d=a.store(),e={};b=$jscomp.makeIterator(b);for(var f=b.next();!f.done;e={$jscomp$loop$prop$key$916:e.$jscomp$loop$prop$key$916},f=b.next())e.$jscomp$loop$prop$key$916=f.value,d.delete(e.$jscomp$loop$prop$key$916).onsuccess=function(g){return function(){return c(g.$jscomp$loop$prop$key$916)}}(e);return a.promise()};
|
|
2233
|
+
shaka.offline.indexeddb.BaseStorageCell.prototype.get_=function(a,b){var c=this,d,e,f,g,h,k,l;return $jscomp.asyncExecutePromiseGeneratorProgram(function(m){if(1==m.nextAddress){d=c.connection_.startReadOnlyOperation(a);e=d.store();f={};g=[];h={};k=$jscomp.makeIterator(b);for(l=k.next();!l.done;h={$jscomp$loop$prop$request$918:h.$jscomp$loop$prop$request$918,$jscomp$loop$prop$key$919:h.$jscomp$loop$prop$key$919},l=k.next())h.$jscomp$loop$prop$key$919=l.value,h.$jscomp$loop$prop$request$918=e.get(h.$jscomp$loop$prop$key$919),
|
|
2234
|
+
h.$jscomp$loop$prop$request$918.onsuccess=function(n){return function(){void 0==n.$jscomp$loop$prop$request$918.result&&g.push(n.$jscomp$loop$prop$key$919);f[n.$jscomp$loop$prop$key$919]=n.$jscomp$loop$prop$request$918.result}}(h);return m.yield(d.promise(),2)}if(g.length)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.STORAGE,shaka.util.Error.Code.KEY_NOT_FOUND,"Could not find values for "+g);return m.return(b.map(function(n){return f[n]}))})};shaka.offline.indexeddb.EmeSessionStorageCell=function(a,b){this.connection_=new shaka.offline.indexeddb.DBConnection(a);this.store_=b};shaka.offline.indexeddb.EmeSessionStorageCell.prototype.destroy=function(){return this.connection_.destroy()};
|
|
2233
2235
|
shaka.offline.indexeddb.EmeSessionStorageCell.prototype.getAll=function(){var a=this,b,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){return 1==d.nextAddress?(b=a.connection_.startReadOnlyOperation(a.store_),c=[],d.yield(b.forEachEntry(function(e,f){c.push(f)}),2)):3!=d.nextAddress?d.yield(b.promise(),3):d.return(c)})};
|
|
2234
2236
|
shaka.offline.indexeddb.EmeSessionStorageCell.prototype.add=function(a){var b=this.connection_.startReadWriteOperation(this.store_),c=b.store();a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next())c.add(d.value);return b.promise()};
|
|
2235
2237
|
shaka.offline.indexeddb.EmeSessionStorageCell.prototype.remove=function(a){var b=this,c;return $jscomp.asyncExecutePromiseGeneratorProgram(function(d){return 1==d.nextAddress?(c=b.connection_.startReadWriteOperation(b.store_),d.yield(c.forEachEntry(function(e,f,g){a.includes(f.sessionId)&&g.delete()}),2)):d.yield(c.promise(),0)})};shaka.offline.StorageCellHandle={};shaka.offline.StorageCellPath={};shaka.offline.StorageMuxer=function(){this.mechanisms_=new Map};shaka.offline.StorageMuxer.prototype.destroy=function(){for(var a=[],b=$jscomp.makeIterator(this.mechanisms_.values()),c=b.next();!c.done;c=b.next())a.push(c.value.destroy());this.mechanisms_.clear();return Promise.all(a)};
|
|
@@ -2295,10 +2297,9 @@ shaka.offline.OfflineManifestParser.prototype.onInitialVariantChosen=function(a)
|
|
|
2295
2297
|
shaka.offline.OfflineScheme.getManifest_=function(a){a={uri:a,originalUri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return shaka.util.AbortableOperation.completed(a)};
|
|
2296
2298
|
shaka.offline.OfflineScheme.getSegment_=function(a,b){goog.asserts.assert(b.isSegment(),"Only segment uri's should be given to getSegment");var c=new shaka.offline.StorageMuxer;return shaka.util.AbortableOperation.completed(void 0).chain(function(){return c.init()}).chain(function(){return c.getCell(b.mechanism(),b.cell())}).chain(function(d){return d.getSegments([b.key()])}).chain(function(d){return{uri:b,data:d[0].data,headers:{}}}).finally(function(){return c.destroy()})};
|
|
2297
2299
|
goog.exportSymbol("shaka.offline.OfflineScheme",shaka.offline.OfflineScheme);goog.exportProperty(shaka.offline.OfflineScheme,"plugin",shaka.offline.OfflineScheme.plugin);shaka.net.NetworkingEngine.registerScheme("offline",shaka.offline.OfflineScheme.plugin);shaka.offline.SessionDeleter=function(){};shaka.offline.SessionDeleter.prototype.delete=function(a,b,c){var d=this,e,f,g,h,k,l,m;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){switch(n.nextAddress){case 1:e=shaka.offline.SessionDeleter,f=[],g=$jscomp.makeIterator(e.createBuckets_(c)),h=g.next();case 2:if(h.done){n.jumpTo(4);break}k=h.value;l=d.doDelete_(a,b,k);return n.yield(l,5);case 5:m=n.yieldResult;f=f.concat(m);h=g.next();n.jumpTo(2);break;case 4:return n.return(f)}})};
|
|
2298
|
-
shaka.offline.SessionDeleter.prototype.doDelete_=function(a,b,c){var d,e,f
|
|
2299
|
-
break;case 2:return e=
|
|
2300
|
-
|
|
2301
|
-
shaka.offline.SessionDeleter.createBuckets_=function(a){var b=shaka.offline.SessionDeleter,c=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=!1,f=$jscomp.makeIterator(c),g=f.next();!g.done;g=f.next())if(g=g.value,b.isCompatible_(g.info,d)){g.sessionIds.push(d.sessionId);e=!0;break}e||c.push({info:d,sessionIds:[d.sessionId]})}return c};
|
|
2300
|
+
shaka.offline.SessionDeleter.prototype.doDelete_=function(a,b,c){var d,e,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){switch(g.nextAddress){case 1:return d=new shaka.media.DrmEngine({netEngine:b,onError:function(){},onKeyStatus:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),g.setCatchFinallyBlocks(2),d.configure(a),g.yield(d.initForRemoval(c.info.keySystem,c.info.licenseUri,c.info.serverCertificate,c.info.audioCapabilities,c.info.videoCapabilities),4);case 4:g.leaveTryBlock(3);
|
|
2301
|
+
break;case 2:return e=g.enterCatchBlock(),shaka.log.warning("Error initializing EME",e),g.yield(d.destroy(),5);case 5:return g.return([]);case 3:return f=[],g.yield(Promise.all(c.sessionIds.map(function(h){var k;return $jscomp.asyncExecutePromiseGeneratorProgram(function(l){if(1==l.nextAddress)return l.setCatchFinallyBlocks(2),l.yield(d.removeSession(h),4);if(2!=l.nextAddress)return f.push(h),l.leaveTryBlock(0);k=l.enterCatchBlock();shaka.log.warning("Error deleting offline session",k);l.jumpToEnd()})})),
|
|
2302
|
+
6);case 6:return g.yield(d.destroy(),7);case 7:return g.return(f)}})};shaka.offline.SessionDeleter.createBuckets_=function(a){var b=shaka.offline.SessionDeleter,c=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=!1,f=$jscomp.makeIterator(c),g=f.next();!g.done;g=f.next())if(g=g.value,b.isCompatible_(g.info,d)){g.sessionIds.push(d.sessionId);e=!0;break}e||c.push({info:d,sessionIds:[d.sessionId]})}return c};
|
|
2302
2303
|
shaka.offline.SessionDeleter.isCompatible_=function(a,b){var c=shaka.util.ArrayUtils,d=function(e,f){return e.robustness==f.robustness&&e.contentType==f.contentType};return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&c.hasSameElements(a.audioCapabilities,b.audioCapabilities,d)&&c.hasSameElements(a.videoCapabilities,b.videoCapabilities,d)};shaka.offline.StoredContentUtils=function(){};shaka.offline.StoredContentUtils.fromManifest=function(a,b,c,d){goog.asserts.assert(b.variants.length,"Cannot create stored content from manifest with no variants.");var e=b.presentationTimeline.getDuration();b=shaka.offline.StoredContentUtils.getTracks_(b);return{offlineUri:null,originalManifestUri:a,duration:e,size:c,expiration:Infinity,tracks:b,appMetadata:d,isIncomplete:!1}};
|
|
2303
2304
|
shaka.offline.StoredContentUtils.fromManifestDB=function(a,b){goog.asserts.assert(b.streams.length,"Cannot create stored content from manifestDB with no streams.");var c=(new shaka.offline.ManifestConverter(a.mechanism(),a.cell())).fromManifestDB(b),d=b.appMetadata||{};c=shaka.offline.StoredContentUtils.getTracks_(c);goog.asserts.assert(null!=b.expiration,"Manifest expiration must be set by now!");return{offlineUri:a.toString(),originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,
|
|
2304
2305
|
expiration:b.expiration,tracks:c,appMetadata:d,isIncomplete:b.isIncomplete||!1}};shaka.offline.StoredContentUtils.getTracks_=function(a){var b=shaka.util.StreamUtils,c=[],d=b.getPlayableVariants(a.variants);d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())c.push(b.variantToTrack(e.value));a=$jscomp.makeIterator(a.textStreams);for(d=a.next();!d.done;d=a.next())c.push(b.textStreamToTrack(d.value));return c};shaka.offline.StreamBandwidthEstimator=function(){this.estimateByStreamId_={}};
|
|
@@ -2316,9 +2317,9 @@ shaka.offline.Storage.prototype.store_=function(a,b,c,d,e){var f=this,g,h,k,l,m,
|
|
|
2316
2317
|
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,
|
|
2317
2318
|
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,t));case 3:return y.enterFinallyBlock(),y.yield(k.destroy(),13);case 13:if(!g){y.jumpTo(14);
|
|
2318
2319
|
break}return y.yield(g.stop(),14);case 14:if(!h){y.jumpTo(16);break}return y.yield(h.destroy(),16);case 16:y.leaveFinallyBlock(0);break;case 2:x=y.enterCatchBlock();if(null==m){y.jumpTo(18);break}return y.yield(shaka.offline.Storage.cleanStoredManifest(m),18);case 18:throw n||x;}})};
|
|
2319
|
-
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$779$
|
|
2320
|
-
D.value,H=A.$jscomp$loop$prop$download$779$
|
|
2321
|
-
d.queue(A.$jscomp$loop$prop$download$779$
|
|
2320
|
+
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$779$921:A.$jscomp$loop$prop$download$779$921},D=B.next())A.$jscomp$loop$prop$download$779$921=
|
|
2321
|
+
D.value,H=A.$jscomp$loop$prop$download$779$921.makeSegmentRequest(e),C=A.$jscomp$loop$prop$download$779$921.estimateId,G=A.$jscomp$loop$prop$download$779$921.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$779$921.ref;L=shaka.offline.DownloadInfo.idForSegmentRef(M);l[L]=K[0];m+=J.byteLength;O.jumpToEnd()})}}(A),
|
|
2322
|
+
d.queue(A.$jscomp$loop$prop$download$779$921.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}),
|
|
2322
2323
|
q=l,r=m,l={},m=0,x.yield(shaka.offline.Storage.assignSegmentsToManifest(f,b,c,q,r,function(){return k.ensureNotDestroyed_()}),6);case 6:k.ensureNotDestroyed_();case 4:if(p){x.jumpTo(7);break}return x.yield(n(a,!1),8);case 8:return k.ensureNotDestroyed_(),t=l,w=m,l={},m=0,x.yield(shaka.offline.Storage.assignSegmentsToManifest(f,b,c,t,w,function(){return k.ensureNotDestroyed_()}),9);case 9:k.ensureNotDestroyed_(),goog.asserts.assert(!c.isIncomplete,"The manifest should be complete by now");case 7:x.leaveTryBlock(0);
|
|
2323
2324
|
break;case 2:return u=x.enterCatchBlock(),v=Object.values(l),x.yield(f.removeSegments(v,function(y){}),10);case 10:throw u;}})};
|
|
2324
2325
|
shaka.offline.Storage.cleanStoredManifest=function(a){var b,c,d,e;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){switch(f.nextAddress){case 1:return b=new shaka.offline.StorageMuxer,f.yield(b.init(),2);case 2:return f.yield(b.getActive(),3);case 3:return c=f.yieldResult,d=shaka.offline.OfflineUri.manifest(c.path.mechanism,c.path.cell,a),f.yield(b.destroy(),4);case 4:return e=new shaka.offline.Storage,f.yield(e.remove(d.toString()),0)}})};
|
|
@@ -2429,7 +2430,7 @@ shaka.polyfill.PatchedMediaKeysApple.MediaKeySession.prototype.onWebkitKeyError_
|
|
|
2429
2430
|
break;default:this.updateKeyStatus_("internal-error")}};shaka.polyfill.PatchedMediaKeysApple.MediaKeySession.prototype.updateKeyStatus_=function(a){this.keyStatuses.setStatus(a);a=new shaka.util.FakeEvent("keystatuseschange");this.dispatchEvent(a)};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap=function(){this.size=0;this.status_=void 0};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.setStatus=function(a){this.size=void 0==a?0:1;this.status_=a};
|
|
2430
2431
|
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.getStatus=function(){return this.status_};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.forEach=function(a){this.status_&&a(this.status_,shaka.media.DrmEngine.DUMMY_KEY_ID.value())};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.get=function(a){if(this.has(a))return this.status_};
|
|
2431
2432
|
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.has=function(a){var b=shaka.media.DrmEngine.DUMMY_KEY_ID.value();return this.status_&&shaka.util.BufferUtils.equal(a,b)?!0:!1};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.entries=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.keys=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};
|
|
2432
|
-
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};
|
|
2433
|
+
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};shaka.polyfill.PatchedMediaKeysNop=function(){};
|
|
2433
2434
|
shaka.polyfill.PatchedMediaKeysNop.install=function(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){shaka.log.info("EME not available.");var a=shaka.polyfill.PatchedMediaKeysNop;navigator.requestMediaKeySystemAccess=a.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=a.setMediaKeys;window.MediaKeys=a.MediaKeys;window.MediaKeySystemAccess=
|
|
2434
2435
|
a.MediaKeySystemAccess;window.shakaMediaKeysPolyfill=!0}};shaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess=function(a,b){shaka.log.debug("PatchedMediaKeysNop.requestMediaKeySystemAccess");goog.asserts.assert(this==navigator,'bad "this" for requestMediaKeySystemAccess');return Promise.reject(Error("The key system specified is not supported."))};
|
|
2435
2436
|
shaka.polyfill.PatchedMediaKeysNop.setMediaKeys=function(a){shaka.log.debug("PatchedMediaKeysNop.setMediaKeys");goog.asserts.assert(this instanceof HTMLMediaElement,'bad "this" for setMediaKeys');return null==a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))};goog.exportProperty(shaka.polyfill,"PatchedMediaKeysNop",shaka.polyfill.PatchedMediaKeysNop);goog.exportProperty(shaka.polyfill.PatchedMediaKeysNop,"install",shaka.polyfill.PatchedMediaKeysNop.install);
|
|
@@ -2537,8 +2538,8 @@ shaka.text.VttTextParser.parseStyle_=function(a,b){if((1!=a.length||a[0])&&!/^NO
|
|
|
2537
2538
|
shaka.text.Cue.fontStyle.NORMAL;break;case "italic":f=!0;e.fontStyle=shaka.text.Cue.fontStyle.ITALIC;break;case "oblique":f=!0,e.fontStyle=shaka.text.Cue.fontStyle.OBLIQUE}break;case "opacity":f=!0;e.opacity=parseFloat(l);break;case "text-combine-upright":f=!0;e.textCombineUpright=l;break;case "text-shadow":f=!0;e.textShadow=l;break;case "white-space":f=!0;e.wrapLine="noWrap"!=l;break;default:shaka.log.warning("VTT parser encountered an unsupported style: ",h)}}}f&&b.set(c,e)}}};
|
|
2538
2539
|
shaka.text.VttTextParser.parseCue_=function(a,b,c,d){var e=shaka.text.VttTextParser;if(1==a.length&&!a[0]||/^NOTE($|[ \t])/.test(a[0])||"STYLE"==a[0]||"REGION"==a[0])return null;var f=null;a[0].includes("--\x3e")||(f=a[0],a.splice(0,1));var g=new shaka.util.TextParser(a[0]),h=e.parseTime_(g),k=g.readRegex(/[ \t]+--\x3e[ \t]+/g),l=e.parseTime_(g);if(null==h||null==k||null==l)return shaka.log.alwaysWarn("Failed to parse VTT time code. Cue skipped:",f,a),null;h+=b;l+=b;a=a.slice(1).join("\n").trim();
|
|
2539
2540
|
d.has("global")?(b=d.get("global").clone(),b.startTime=h,b.endTime=l,b.payload=""):b=new shaka.text.Cue(h,l,"");g.skipWhitespace();for(h=g.readWord();h;)e.parseCueSetting(b,h,c)||shaka.log.warning("VTT parser encountered an invalid VTT setting: ",h," The setting will be ignored."),g.skipWhitespace(),h=g.readWord();e.parseCueStyles(a,b,d);null!=f&&(b.id=f);return b};
|
|
2540
|
-
shaka.text.VttTextParser.parseCueStyles=function(a,b,c){var d=shaka.text.VttTextParser;0===c.size&&d.addDefaultTextColor_(c);a=d.replaceColorPayload_(a);a=d.replaceKaraokeStylePayload_(a);a=d.replaceVoiceStylePayload_(a);var e=shaka.util.XmlUtils.parseXmlString("<span>"+a+"</span>","span");if(e){e=e.childNodes;if(1==e.length){var f=e[0];if(f.nodeType==Node.TEXT_NODE||f.nodeType==Node.CDATA_SECTION_NODE){b.payload=d.htmlUnescape_(a);return}}a=$jscomp.makeIterator(e);for(e=a.next();!e.done;e=
|
|
2541
|
-
b,c)}else shaka.log.warning("The cue's markup could not be parsed: ",a),b.payload=d.htmlUnescape_(a)};
|
|
2541
|
+
shaka.text.VttTextParser.parseCueStyles=function(a,b,c){var d=shaka.text.VttTextParser;if(a.includes("<")){0===c.size&&d.addDefaultTextColor_(c);a=d.replaceColorPayload_(a);a=d.replaceKaraokeStylePayload_(a);a=d.replaceVoiceStylePayload_(a);var e=shaka.util.XmlUtils.parseXmlString("<span>"+a+"</span>","span");if(e){e=e.childNodes;if(1==e.length){var f=e[0];if(f.nodeType==Node.TEXT_NODE||f.nodeType==Node.CDATA_SECTION_NODE){b.payload=d.htmlUnescape_(a);return}}a=$jscomp.makeIterator(e);for(e=a.next();!e.done;e=
|
|
2542
|
+
a.next())d.generateCueFromElement_(e.value,b,c)}else shaka.log.warning("The cue's markup could not be parsed: ",a),b.payload=d.htmlUnescape_(a)}else b.payload=d.htmlUnescape_(a)};
|
|
2542
2543
|
shaka.text.VttTextParser.replaceVoiceStylePayload_=function(a){for(var b=[],c=-1,d="",e=!1,f=0;f<a.length;f++)if("/"===a[f]){var g=a.indexOf(">",f);if(-1===g)return a;if((g=a.substring(f+1,g))&&"v"==g){e=!0;var h=null;b.length&&(h=b[b.length-1]);if(h){if(h===g)d+="/"+g+">";else{if(!h.startsWith("v")){d+=a[f];continue}d+="/"+h+">"}f+=g.length+1}else d+=a[f]}else d+=a[f]}else"<"===a[f]?(c=f+1,"v"!=a[c]&&(c=-1)):">"===a[f]&&0<c&&(b.push(a.substr(c,f-c)),c=-1),d+=a[f];a=$jscomp.makeIterator(b);for(b=
|
|
2543
2544
|
a.next();!b.done;b=a.next())b=b.value,c=b.replace(" ",".voice-"),d=d.replace("<"+b+">","<"+c+">"),d=d.replace("</"+b+">","</"+c+">"),e||(d+="</"+c+">");return d};
|
|
2544
2545
|
shaka.text.VttTextParser.replaceKaraokeStylePayload_=function(a){for(var b=[],c=-1,d=0;d<a.length;d++)"<"===a[d]?c=d+1:">"===a[d]&&0<c&&(c=a.substr(c,d-c),c.match(shaka.text.VttTextParser.timeFormat_)&&b.push(c),c=-1);b=$jscomp.makeIterator(b);for(d=b.next();!d.done;d=b.next())d=d.value,a=a.replace("<"+d+">",'<div time="'+d+'">'),a+="</div>";return a};
|
|
@@ -2579,8 +2580,8 @@ shaka.text.SrtTextParser.convertSrtCue_=function(a){a=a.split(/\n/);a[0].match(/
|
|
|
2579
2580
|
goog.exportProperty(shaka.text.SrtTextParser.prototype,"parseMedia",shaka.text.SrtTextParser.prototype.parseMedia);goog.exportProperty(shaka.text.SrtTextParser.prototype,"setManifestType",shaka.text.SrtTextParser.prototype.setManifestType);goog.exportProperty(shaka.text.SrtTextParser.prototype,"setSequenceMode",shaka.text.SrtTextParser.prototype.setSequenceMode);goog.exportProperty(shaka.text.SrtTextParser.prototype,"parseInit",shaka.text.SrtTextParser.prototype.parseInit);
|
|
2580
2581
|
shaka.text.TextEngine.registerParser("text/srt",function(){return new shaka.text.SrtTextParser});shaka.text.SsaTextParser=function(){};shaka.text.SsaTextParser.prototype.parseInit=function(a){goog.asserts.assert(!1,"SSA does not have init segments")};shaka.text.SsaTextParser.prototype.setSequenceMode=function(a){};shaka.text.SsaTextParser.prototype.setManifestType=function(a){};
|
|
2581
2582
|
shaka.text.SsaTextParser.prototype.parseMedia=function(a,b){b=shaka.text.SsaTextParser;var c="",d="";a=shaka.util.StringUtils.fromUTF8(a).split(/\r?\n\s*\r?\n/);a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=b.ssaContent_.exec(e);if(f){var g=f[1];f=f[2];if("V4 Styles"==g||"V4+ Styles"==g){c=f;continue}if("Events"==g){d=f;continue}}shaka.log.warning("SsaTextParser parser encountered an unknown part.",e)}a=[];e=null;c=c.split(/\r?\n/);c=$jscomp.makeIterator(c);for(f=
|
|
2582
|
-
c.next();!f.done;f=c.next())if(g=f.value,!/^\s*;/.test(g)&&(f=b.lineParts_.exec(g)))if(g=f[1].trim(),f=f[2].trim(),"Format"==g)e=f.split(b.valuesFormat_);else if("Style"==g){g=f.split(b.valuesFormat_);f={};for(var h=0;h<e.length&&h<g.length;h++)f[e[h]]=g[h];a.push(f)}e=[];c=null;g=d.split(/\r?\n/);d={};g=$jscomp.makeIterator(g);for(f=g.next();!f.done;d={$jscomp$loop$prop$styleName$
|
|
2583
|
-
h=h[2].trim(),"Format"==f)c=h.split(b.valuesFormat_);else if("Dialogue"==f){h=h.split(b.valuesFormat_);f={};for(var k=0;k<c.length&&k<h.length;k++)f[c[k]]=h[k];k=b.parseTime_(f.Start);var l=b.parseTime_(f.End);h=h.slice(c.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"");h=new shaka.text.Cue(k,l,h);d.$jscomp$loop$prop$styleName$
|
|
2583
|
+
c.next();!f.done;f=c.next())if(g=f.value,!/^\s*;/.test(g)&&(f=b.lineParts_.exec(g)))if(g=f[1].trim(),f=f[2].trim(),"Format"==g)e=f.split(b.valuesFormat_);else if("Style"==g){g=f.split(b.valuesFormat_);f={};for(var h=0;h<e.length&&h<g.length;h++)f[e[h]]=g[h];a.push(f)}e=[];c=null;g=d.split(/\r?\n/);d={};g=$jscomp.makeIterator(g);for(f=g.next();!f.done;d={$jscomp$loop$prop$styleName$923:d.$jscomp$loop$prop$styleName$923},f=g.next())if(f=f.value,!/^\s*;/.test(f)&&(h=b.lineParts_.exec(f)))if(f=h[1].trim(),
|
|
2584
|
+
h=h[2].trim(),"Format"==f)c=h.split(b.valuesFormat_);else if("Dialogue"==f){h=h.split(b.valuesFormat_);f={};for(var k=0;k<c.length&&k<h.length;k++)f[c[k]]=h[k];k=b.parseTime_(f.Start);var l=b.parseTime_(f.End);h=h.slice(c.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,"");h=new shaka.text.Cue(k,l,h);d.$jscomp$loop$prop$styleName$923=f.Style;(f=a.find(function(m){return function(n){return n.Name==m.$jscomp$loop$prop$styleName$923}}(d)))&&b.addStyle_(h,f);e.push(h)}return e};
|
|
2584
2585
|
shaka.text.SsaTextParser.addStyle_=function(a,b){var c=shaka.text.Cue,d=shaka.text.SsaTextParser,e=b.Fontname;e&&(a.fontFamily=e);if(e=b.Fontsize)a.fontSize=e+"px";if(e=b.PrimaryColour)if(e=d.parseSsaColor_(e))a.color=e;if(e=b.BackColour)if(d=d.parseSsaColor_(e))a.backgroundColor=d;b.Bold&&(a.fontWeight=c.fontWeight.BOLD);b.Italic&&(a.fontStyle=c.fontStyle.ITALIC);b.Underline&&a.textDecoration.push(c.textDecoration.UNDERLINE);if(d=b.Spacing)a.letterSpacing=d+"px";if(d=b.Alignment)switch(parseInt(d,
|
|
2585
2586
|
10)){case 1:a.displayAlign=c.displayAlign.AFTER;a.textAlign=c.textAlign.START;break;case 2:a.displayAlign=c.displayAlign.AFTER;a.textAlign=c.textAlign.CENTER;break;case 3:a.displayAlign=c.displayAlign.AFTER;a.textAlign=c.textAlign.END;break;case 5:a.displayAlign=c.displayAlign.BEFORE;a.textAlign=c.textAlign.START;break;case 6:a.displayAlign=c.displayAlign.BEFORE;a.textAlign=c.textAlign.CENTER;break;case 7:a.displayAlign=c.displayAlign.BEFORE;a.textAlign=c.textAlign.END;break;case 9:a.displayAlign=
|
|
2586
2587
|
c.displayAlign.CENTER;a.textAlign=c.textAlign.START;break;case 10:a.displayAlign=c.displayAlign.CENTER;a.textAlign=c.textAlign.CENTER;break;case 11:a.displayAlign=c.displayAlign.CENTER,a.textAlign=c.textAlign.END}if(b=b.AlphaLevel)a.opacity=parseFloat(b)};shaka.text.SsaTextParser.parseSsaColor_=function(a){a=parseInt(a.replace("&H",""),16);return 0<=a?"rgba("+(a&255)+","+(a>>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null};
|
|
@@ -2788,7 +2789,7 @@ englishName:"Serbian (Serbia)"},su:{nativeName:"Basa Sunda",englishName:"Sundane
|
|
|
2788
2789
|
tl:{nativeName:"Filipino",englishName:"Filipino"},"tl-PH":{nativeName:"Filipino",englishName:"Filipino"},tlh:{nativeName:"tlhIngan-Hol",englishName:"Klingon"},tr:{nativeName:"T\u00fcrk\u00e7e",englishName:"Turkish"},"tr-TR":{nativeName:"T\u00fcrk\u00e7e",englishName:"Turkish"},"tt-RU":{nativeName:"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",englishName:"Tatar"},uk:{nativeName:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",englishName:"Ukrainian"},"uk-UA":{nativeName:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",
|
|
2789
2790
|
englishName:"Ukrainian"},ur:{nativeName:"\u0627\u0631\u062f\u0648",englishName:"Urdu"},"ur-PK":{nativeName:"\u0627\u0631\u062f\u0648",englishName:"Urdu"},uz:{nativeName:"O'zbek",englishName:"Uzbek"},"uz-UZ":{nativeName:"O'zbek",englishName:"Uzbek"},vi:{nativeName:"Ti\u1ebfng Vi\u1ec7t",englishName:"Vietnamese"},"vi-VN":{nativeName:"Ti\u1ebfng Vi\u1ec7t",englishName:"Vietnamese"},"xh-ZA":{nativeName:"isiXhosa",englishName:"Xhosa"},yi:{nativeName:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9",englishName:"Yiddish"},
|
|
2790
2791
|
"yi-DE":{nativeName:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",englishName:"Yiddish (German)"},zh:{nativeName:"\u4e2d\u6587",englishName:"Chinese"},"zh-HANS":{nativeName:"\u4e2d\u6587\u7b80\u4f53",englishName:"Chinese Simplified"},"zh-HANT":{nativeName:"\u4e2d\u6587\u7e41\u9ad4",englishName:"Chinese Traditional"},"zh-CN":{nativeName:"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09",englishName:"Chinese Simplified (China)"},"zh-HK":{nativeName:"\u4e2d\u6587\uff08\u9999\u6e2f\uff09",englishName:"Chinese Traditional (Hong Kong)"},
|
|
2791
|
-
"zh-SG":{nativeName:"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09",englishName:"Chinese Simplified (Singapore)"},"zh-TW":{nativeName:"\u4e2d\u6587\uff08\u53f0\u7063\uff09",englishName:"Chinese Traditional (Taiwan)"},"zu-ZA":{nativeName:"isiZulu",englishName:"Zulu"}}},$jscomp$iter$
|
|
2792
|
+
"zh-SG":{nativeName:"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09",englishName:"Chinese Simplified (Singapore)"},"zh-TW":{nativeName:"\u4e2d\u6587\uff08\u53f0\u7063\uff09",englishName:"Chinese Traditional (Taiwan)"},"zu-ZA":{nativeName:"isiZulu",englishName:"Zulu"}}},$jscomp$iter$500=$jscomp.makeIterator(Object.keys(mozilla.LanguageMapping)),$jscomp$key$key=$jscomp$iter$500.next();!$jscomp$key$key.done;$jscomp$key$key=$jscomp$iter$500.next()){var key=$jscomp$key$key.value;mozilla.LanguageMapping[key.toLowerCase()]=
|
|
2792
2793
|
mozilla.LanguageMapping[key]};shaka.ui.Element=function(a,b){var c=this;this.parent=a;this.controls=b;this.eventManager=new shaka.util.EventManager;this.localization=this.controls.getLocalization();this.player=this.controls.getPlayer();this.video=this.controls.getVideo();this.adManager=this.player.getAdManager();this.ad=b.getAd();this.eventManager.listen(this.adManager,shaka.ads.AdManager.AD_STARTED,function(d){c.ad=d.ad});this.eventManager.listen(this.adManager,shaka.ads.AdManager.AD_STOPPED,function(){c.ad=null})};
|
|
2793
2794
|
shaka.ui.Element.prototype.release=function(){this.eventManager.release();this.ad=this.adManager=this.video=this.player=this.localization=this.eventManager=this.controls=this.parent=null};goog.exportSymbol("shaka.ui.Element",shaka.ui.Element);goog.exportProperty(shaka.ui.Element.prototype,"release",shaka.ui.Element.prototype.release);shaka.ui.Enums={};
|
|
2794
2795
|
shaka.ui.Enums.MaterialDesignIcons={FULLSCREEN:"fullscreen",EXIT_FULLSCREEN:"fullscreen_exit",CLOSE:"close",CLOSED_CAPTIONS:"closed_caption",CLOSED_CAPTIONS_OFF:"closed_caption_disabled",CHECKMARK:"done",LANGUAGE:"language",PIP:"picture_in_picture_alt",EXIT_PIP:"branding_watermark",BACK:"arrow_back",RESOLUTION:"settings",MUTE:"volume_up",UNMUTE:"volume_off",CAST:"cast",EXIT_CAST:"cast_connected",OPEN_OVERFLOW:"more_vert",REWIND:"fast_rewind",FAST_FORWARD:"fast_forward",PLAY:"play_arrow",PLAYBACK_RATE:"slow_motion_video",
|
|
@@ -2801,8 +2802,9 @@ shaka.ui.AdCounter.prototype.onTimerTick_=function(){goog.asserts.assert(null!=t
|
|
|
2801
2802
|
shaka.ui.AdCounter.prototype.reset_=function(){this.timer_.stop();this.span_.textContent=""};shaka.ui.AdCounter.prototype.release=function(){this.timer_.stop();this.timer_=null;shaka.ui.Element.prototype.release.call(this)};goog.exportSymbol("shaka.ui.AdCounter",shaka.ui.AdCounter);shaka.ui.AdPosition=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.container_=shaka.util.Dom.createHTMLElement("div");this.container_.classList.add("shaka-ad-position");shaka.ui.Utils.setDisplay(this.container_,!1);this.parent.appendChild(this.container_);this.span_=shaka.util.Dom.createHTMLElement("span");this.span_.classList.add("shaka-ad-position-span");this.container_.appendChild(this.span_);this.updateAriaLabel_();this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,
|
|
2802
2803
|
function(){c.ad&&(c.updateAriaLabel_(),c.setPosition_())});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,function(){c.ad&&(c.updateAriaLabel_(),c.setPosition_())});this.eventManager.listen(this.adManager,shaka.ads.AdManager.AD_STARTED,function(){c.setPosition_()});this.eventManager.listen(this.adManager,shaka.ads.AdManager.AD_STOPPED,function(){c.span_.textContent="";shaka.ui.Utils.setDisplay(c.container_,!1)});this.ad&&this.setPosition_()};
|
|
2803
2804
|
$jscomp.inherits(shaka.ui.AdPosition,shaka.ui.Element);shaka.ui.AdPosition.prototype.updateAriaLabel_=function(){};shaka.ui.AdPosition.prototype.setPosition_=function(){var a=this.ad.getSequenceLength();if(1<a){var b=shaka.ui.Locales.Ids,c=this.ad.getPositionInSequence();this.span_.textContent=this.localization.resolve(b.AD_PROGRESS).replace("[AD_ON]",String(c)).replace("[NUM_ADS]",String(a));shaka.ui.Utils.setDisplay(this.container_,!0)}};goog.exportSymbol("shaka.ui.AdPosition",shaka.ui.AdPosition);shaka.ui.PlayButton=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;a=shaka.ads.AdManager;this.button=shaka.util.Dom.createButton();this.parent.appendChild(this.button);this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,function(){c.updateAriaLabel()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,function(){c.updateAriaLabel()});this.eventManager.listen(this.video,"play",function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.video,
|
|
2804
|
-
"pause",function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.video,"seeking",function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.adManager,a.AD_PAUSED,function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.adManager,a.AD_RESUMED,function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.adManager,a.AD_STARTED,function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.
|
|
2805
|
-
c.ad.isLinear()?c.controls.playPauseAd():c.controls.playPausePresentation()});this.ad&&(this.updateAriaLabel(),this.updateIcon())};$jscomp.inherits(shaka.ui.PlayButton,shaka.ui.Element);shaka.ui.PlayButton.prototype.isPaused=function(){return this.ad&&this.ad.isLinear()?this.ad.isPaused():this.controls.presentationIsPaused()};
|
|
2805
|
+
"pause",function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.video,"seeking",function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.adManager,a.AD_PAUSED,function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.adManager,a.AD_RESUMED,function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.adManager,a.AD_STARTED,function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.adManager,a.AD_STOPPED,
|
|
2806
|
+
function(){c.updateAriaLabel();c.updateIcon()});this.eventManager.listen(this.button,"click",function(){c.ad&&c.ad.isLinear()?c.controls.playPauseAd():c.controls.playPausePresentation()});this.ad&&(this.updateAriaLabel(),this.updateIcon())};$jscomp.inherits(shaka.ui.PlayButton,shaka.ui.Element);shaka.ui.PlayButton.prototype.isPaused=function(){return this.ad&&this.ad.isLinear()?this.ad.isPaused():this.controls.presentationIsPaused()};
|
|
2807
|
+
shaka.ui.PlayButton.prototype.isEnded=function(){return this.ad&&this.ad.isLinear()?!1:this.video.ended};shaka.ui.PlayButton.prototype.updateAriaLabel=function(){};shaka.ui.PlayButton.prototype.updateIcon=function(){};goog.exportSymbol("shaka.ui.PlayButton",shaka.ui.PlayButton);shaka.ui.BigPlayButton=function(a,b){shaka.ui.PlayButton.call(this,a,b);this.button.classList.add("shaka-play-button");this.button.classList.add("shaka-no-propagation");this.updateIcon();this.updateAriaLabel()};$jscomp.inherits(shaka.ui.BigPlayButton,shaka.ui.PlayButton);shaka.ui.BigPlayButton.prototype.updateIcon=function(){this.isPaused()?this.button.setAttribute("icon","play"):this.button.setAttribute("icon","pause")};
|
|
2806
2808
|
shaka.ui.BigPlayButton.prototype.updateAriaLabel=function(){var a=shaka.ui.Locales.Ids;a=this.isPaused()?a.PLAY:a.PAUSE;this.button.ariaLabel=this.localization.resolve(a)};goog.exportSymbol("shaka.ui.BigPlayButton",shaka.ui.BigPlayButton);shaka.ui.ContextMenu=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.config_=this.controls.getConfig();this.controlsContainer_=this.controls.getControlsContainer();this.children_=[];this.contextMenu_=shaka.util.Dom.createHTMLElement("div");this.contextMenu_.classList.add("shaka-no-propagation");this.contextMenu_.classList.add("shaka-context-menu");this.contextMenu_.classList.add("shaka-hidden");this.controlsContainer_.appendChild(this.contextMenu_);this.eventManager.listen(this.controlsContainer_,
|
|
2807
2809
|
"contextmenu",function(d){if(c.contextMenu_.classList.contains("shaka-hidden")){d.preventDefault();var e=c.controlsContainer_.getBoundingClientRect();c.contextMenu_.style.left=d.clientX-e.left+"px";c.contextMenu_.style.top=d.clientY-e.top+"px";shaka.ui.Utils.setDisplay(c.contextMenu_,!0)}else shaka.ui.Utils.setDisplay(c.contextMenu_,!1)});this.eventManager.listen(window,"click",function(){shaka.ui.Utils.setDisplay(c.contextMenu_,!1)});this.createChildren_()};
|
|
2808
2810
|
$jscomp.inherits(shaka.ui.ContextMenu,shaka.ui.Element);shaka.ui.ContextMenu.prototype.release=function(){this.controlsContainer_=null;for(var a=$jscomp.makeIterator(this.children_),b=a.next();!b.done;b=a.next())b.value.release();this.children_=[];shaka.ui.Element.prototype.release.call(this)};shaka.ui.ContextMenu.registerElement=function(a,b){shaka.ui.ContextMenu.elementNamesToFactories_.set(a,b)};
|
|
@@ -2839,8 +2841,8 @@ r=shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT;t=shaka.util.Netw
|
|
|
2839
2841
|
new Blob([B],{type:"image/jpeg"});p=URL.createObjectURL(B)})),u.parse(w.data,!1)):(v=d.mimeType||"image/jpeg",x=new Blob([w.data],{type:v}),p=URL.createObjectURL(x));A.leaveTryBlock(4);break;case 5:y=A.enterCatchBlock();if(y.code==shaka.util.Error.Code.OPERATION_ABORTED)return A.return();throw y;case 4:try{c.thumbnailContainer_.removeChild(c.thumbnailImage_)}catch(B){}c.thumbnailImage_=shaka.util.Dom.createHTMLElement("img");c.thumbnailImage_.id="shaka-player-ui-thumbnail-image";c.thumbnailImage_.draggable=
|
|
2840
2842
|
!1;c.thumbnailImage_.src=p;c.thumbnailImage_.onload=function(){p.startsWith("blob:")&&URL.revokeObjectURL(p)};c.thumbnailContainer_.insertBefore(c.thumbnailImage_,c.thumbnailContainer_.firstChild);case 3:z=l/g.width,g.imageHeight?c.thumbnailImage_.height=g.imageHeight:g.sprite||(c.thumbnailImage_.style.height="100%",c.thumbnailImage_.style.objectFit="contain"),g.imageWidth?c.thumbnailImage_.width=g.imageWidth:g.sprite||(c.thumbnailImage_.style.width="100%",c.thumbnailImage_.style.objectFit="contain"),
|
|
2841
2843
|
c.thumbnailImage_.style.left="-"+z*g.positionX+"px",c.thumbnailImage_.style.top="-"+z*g.positionY+"px",c.thumbnailImage_.style.transform="scale("+z+")",c.thumbnailImage_.style.transformOrigin="left top",m=Math.floor(l*g.height/g.width),c.thumbnailContainer_.style.height=m+"px",c.thumbnailContainer_.style.top=-(m-k)+"px",A.jumpToEnd()}})};
|
|
2842
|
-
shaka.ui.SeekBar.prototype.getThumbnailTrack_=function(){var a=this.player.getImageTracks();if(!a.length)return null;for(var b={},c=$jscomp.makeIterator(["image/avif","image/webp","image/jpeg","image/png","image/svg+xml"]),d=c.next();!d.done;b={$jscomp$loop$prop$mimeType$
|
|
2843
|
-
(d=a.filter(function(e){return function(f){return f.mimeType.toLowerCase()===e.$jscomp$loop$prop$mimeType$
|
|
2844
|
+
shaka.ui.SeekBar.prototype.getThumbnailTrack_=function(){var a=this.player.getImageTracks();if(!a.length)return null;for(var b={},c=$jscomp.makeIterator(["image/avif","image/webp","image/jpeg","image/png","image/svg+xml"]),d=c.next();!d.done;b={$jscomp$loop$prop$mimeType$925:b.$jscomp$loop$prop$mimeType$925,$jscomp$loop$prop$estimatedBandwidth$926:b.$jscomp$loop$prop$estimatedBandwidth$926},d=c.next())if(b.$jscomp$loop$prop$mimeType$925=d.value,b.$jscomp$loop$prop$estimatedBandwidth$926=this.player.getStats().estimatedBandwidth,
|
|
2845
|
+
(d=a.filter(function(e){return function(f){return f.mimeType.toLowerCase()===e.$jscomp$loop$prop$mimeType$925&&f.bandwidth<.01*e.$jscomp$loop$prop$estimatedBandwidth$926}}(b)).sort(function(e,f){return f.bandwidth-e.bandwidth}))&&d.length)return d[0];return a.find(function(e){return"application/mp4"==e.mimeType&&"mjpg"==e.codecs})||a[0]};shaka.ui.SeekBar.prototype.hideThumbnail_=function(){this.thumbnailContainer_.style.visibility="hidden";this.thumbnailTime_.textContent=""};
|
|
2844
2846
|
shaka.ui.SeekBar.prototype.timeFormatter_=function(a){var b=Math.round(a);a=Math.floor(b/3600);var c=Math.floor((b-3600*a)/60);b=b-3600*a-60*c;10>b&&(b="0"+b);return 0<a?(10>c&&(c="0"+c),a+":"+c+":"+b):c+":"+b};
|
|
2845
2847
|
shaka.ui.SeekBar.prototype.setupChapters_=function(){var a=this,b="und",c=[],d=function(f,g){return!f&&!g||f.id===g.id&&f.title===g.title&&f.startTime===g.startTime&&f.endTime===g.endTime},e=function(){var f="und",g=[],h=a.localization.getCurrentLocales();h=$jscomp.makeIterator(Array.from(h));for(var k=h.next();!k.done&&(f=k.value,g=a.player.getChapters(f),!g.length);k=h.next());g.length||(f="und",g=a.player.getChapters(f));h=f!==b;k=c.length!==g.length||!c.some(function(l,m){m=g.at(m);return d(l,
|
|
2846
2848
|
m)||g.some(function(n){return d(l,n)})});b=f;c=g;g.length?(h||k)&&a.createChapterElements_(a.container,c):a.deletePreviousChapters_()};e();this.eventManager.listen(this.player,"unloading",function(){a.deletePreviousChapters_();b="und";c=[]});this.eventManager.listen(this.player,"trackschanged",e);this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,function(){e()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,function(){e()})};
|
|
@@ -2953,10 +2955,10 @@ goog.exportProperty(shaka.ui.Overlay.prototype,"getControls",shaka.ui.Overlay.pr
|
|
|
2953
2955
|
shaka.ui.Overlay.TrackLabelFormat={LANGUAGE:0,ROLE:1,LANGUAGE_ROLE:2,LABEL:3};goog.exportProperty(shaka.ui.Overlay,"TrackLabelFormat",shaka.ui.Overlay.TrackLabelFormat);shaka.ui.Overlay.FailReasonCode={NO_BROWSER_SUPPORT:0,PLAYER_FAILED_TO_LOAD:1};goog.exportProperty(shaka.ui.Overlay,"FailReasonCode",shaka.ui.Overlay.FailReasonCode);
|
|
2954
2956
|
"complete"==document.readyState?function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(a){if(1==a.nextAddress)return a.yield(Promise.resolve(),2);shaka.ui.Overlay.scanPageForShakaElements_();a.jumpToEnd()})}():window.addEventListener("load",shaka.ui.Overlay.scanPageForShakaElements_);shaka.ui.LanguageUtils=function(){};
|
|
2955
2957
|
shaka.ui.LanguageUtils.updateTracks=function(a,b,c,d,e,f,g,h){var k=shaka.ui.Locales.Ids,l=a.find(function(D){return 1==D.active}),m=shaka.ui.Utils.getFirstDescendantWithClassName(b,"shaka-back-to-overflow-button");shaka.util.Dom.removeAllChildren(b);b.appendChild(m);m=function(D){return"variant"==D.type?D.audioRoles?D.audioRoles.join(", "):void 0:D.roles.join(", ")};for(var n=function(D,H,C,G){D=[D,H];h&&null!=G&&D.push(G);C&&g==shaka.ui.Overlay.TrackLabelFormat.LABEL&&D.push(C);return D.join(": ")},
|
|
2956
|
-
p=function(D){var H="";5<=D&&(H=" "+f.resolve(k.SURROUND));return H},q=new Map,r=$jscomp.makeIterator(a),t=r.next();!t.done;t=r.next())t=t.value,q.has(t.language)||q.set(t.language,new Set),q.get(t.language).add(m(t));q=new Set;l=l?n(l.language,m(l),l.label,l.channelsCount):"";r={};a=$jscomp.makeIterator(a);for(t=a.next();!t.done;r={$jscomp$loop$prop$track$846$
|
|
2957
|
-
var w=r.$jscomp$loop$prop$track$846$
|
|
2958
|
-
switch(g){case shaka.ui.Overlay.TrackLabelFormat.LANGUAGE:h&&(B.textContent+=p(y));w&&(B.textContent+=" ("+u+")");break;case shaka.ui.Overlay.TrackLabelFormat.ROLE:h&&(B.textContent+=p(y));v?B.textContent=v:(shaka.log.alwaysWarn("Track #"+r.$jscomp$loop$prop$track$846$
|
|
2959
|
-
v);w&&(B.textContent+=" ("+u+")");break;case shaka.ui.Overlay.TrackLabelFormat.LABEL:x?B.textContent=x:(shaka.log.alwaysWarn("Track #"+r.$jscomp$loop$prop$track$846$
|
|
2958
|
+
p=function(D){var H="";5<=D&&(H=" "+f.resolve(k.SURROUND));return H},q=new Map,r=$jscomp.makeIterator(a),t=r.next();!t.done;t=r.next())t=t.value,q.has(t.language)||q.set(t.language,new Set),q.get(t.language).add(m(t));q=new Set;l=l?n(l.language,m(l),l.label,l.channelsCount):"";r={};a=$jscomp.makeIterator(a);for(t=a.next();!t.done;r={$jscomp$loop$prop$track$846$928:r.$jscomp$loop$prop$track$846$928},t=a.next()){r.$jscomp$loop$prop$track$846$928=t.value;t=r.$jscomp$loop$prop$track$846$928.language;
|
|
2959
|
+
var w=r.$jscomp$loop$prop$track$846$928.forced,u=f.resolve(k.SUBTITLE_FORCED),v=m(r.$jscomp$loop$prop$track$846$928),x=r.$jscomp$loop$prop$track$846$928.label,y=r.$jscomp$loop$prop$track$846$928.channelsCount,z=n(t,v,x,y);if(!q.has(z)){q.add(z);var A=shaka.util.Dom.createButton();A.addEventListener("click",function(D){return function(){c(D.$jscomp$loop$prop$track$846$928)}}(r));var B=shaka.util.Dom.createHTMLElement("span");A.appendChild(B);B.textContent=shaka.ui.LanguageUtils.getLanguageName(t,f);
|
|
2960
|
+
switch(g){case shaka.ui.Overlay.TrackLabelFormat.LANGUAGE:h&&(B.textContent+=p(y));w&&(B.textContent+=" ("+u+")");break;case shaka.ui.Overlay.TrackLabelFormat.ROLE:h&&(B.textContent+=p(y));v?B.textContent=v:(shaka.log.alwaysWarn("Track #"+r.$jscomp$loop$prop$track$846$928.id+" does not have a role, but the UI is configured to only show role."),B.textContent="?");w&&(B.textContent+=" ("+u+")");break;case shaka.ui.Overlay.TrackLabelFormat.LANGUAGE_ROLE:h&&(B.textContent+=p(y));v&&(B.textContent+=": "+
|
|
2961
|
+
v);w&&(B.textContent+=" ("+u+")");break;case shaka.ui.Overlay.TrackLabelFormat.LABEL:x?B.textContent=x:(shaka.log.alwaysWarn("Track #"+r.$jscomp$loop$prop$track$846$928.id+" does not have a label, but the UI is configured to only show labels."),B.textContent="?")}d&&z==l&&(A.appendChild(shaka.ui.Utils.checkmarkIcon()),B.classList.add("shaka-chosen-item"),A.ariaSelected="true",e.textContent=B.textContent);b.appendChild(A)}}};
|
|
2960
2962
|
shaka.ui.LanguageUtils.getLanguageName=function(a,b){if(!a&&!b)return"";switch(a){case "mul":return b.resolve(shaka.ui.Locales.Ids.MULTIPLE_LANGUAGES);case "und":return b.resolve(shaka.ui.Locales.Ids.UNDETERMINED_LANGUAGE);case "zxx":return b.resolve(shaka.ui.Locales.Ids.NOT_APPLICABLE)}var c=shaka.util.LanguageUtils.getBase(a);return a in mozilla.LanguageMapping?mozilla.LanguageMapping[a].nativeName:c in mozilla.LanguageMapping?mozilla.LanguageMapping[c].nativeName+" ("+a+")":b.resolve(shaka.ui.Locales.Ids.UNRECOGNIZED_LANGUAGE)+
|
|
2961
2963
|
" ("+a+")"};shaka.ui.SettingsMenu=function(a,b,c){shaka.ui.Element.call(this,a,b);var d=this;this.addButton_(c);this.addMenu_();this.inOverflowMenu_();this.eventManager.listen(this.button,"click",function(){d.onButtonClick_()})};$jscomp.inherits(shaka.ui.SettingsMenu,shaka.ui.Element);
|
|
2962
2964
|
shaka.ui.SettingsMenu.prototype.addButton_=function(a){this.button=shaka.util.Dom.createButton();this.button.classList.add("shaka-overflow-button");this.icon=shaka.util.Dom.createHTMLElement("i");this.icon.classList.add("material-icons-round");this.icon.textContent=a;this.button.appendChild(this.icon);a=shaka.util.Dom.createHTMLElement("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.nameSpan=shaka.util.Dom.createHTMLElement("span");a.appendChild(this.nameSpan);
|
|
@@ -3005,8 +3007,8 @@ this.eventManager.listen(this.player,"ratechange",function(){c.updatePlaybackRat
|
|
|
3005
3007
|
shaka.ui.PlaybackRateSelection.prototype.updateLocalizedStrings_=function(){var a=shaka.ui.Locales.Ids;this.backButton.ariaLabel=this.localization.resolve(a.BACK);this.button.ariaLabel=this.localization.resolve(a.PLAYBACK_RATE);this.nameSpan.textContent=this.localization.resolve(a.PLAYBACK_RATE);this.backSpan.textContent=this.localization.resolve(a.PLAYBACK_RATE)};
|
|
3006
3008
|
shaka.ui.PlaybackRateSelection.prototype.updatePlaybackRateSelection_=function(a){var b=this,c=shaka.ui.Utils.getDescendantIfExists(this.menu,"material-icons-round shaka-chosen-item");if(c){var d=c.parentElement;d.removeAttribute("aria-selected");d.getElementsByTagName("span")[0].classList.remove("shaka-chosen-item");d.removeChild(c)}if(c=Array.from(this.menu.querySelectorAll("span")).find(function(e){return b.playbackRates_.get(e.textContent)==a}))d=c.parentElement,d.appendChild(shaka.ui.Utils.checkmarkIcon()),
|
|
3007
3009
|
d.ariaSelected="true",c.classList.add("shaka-chosen-item");this.currentSelection.textContent=a+"x";this.button.setAttribute("shaka-status",a+"x")};
|
|
3008
|
-
shaka.ui.PlaybackRateSelection.prototype.addPlaybackRates_=function(){for(var a=this,b={},c=$jscomp.makeIterator(this.playbackRates_.keys()),d=c.next();!d.done;b={$jscomp$loop$prop$rateStr$
|
|
3009
|
-
a.playbackRates_.get(f.$jscomp$loop$prop$rateStr$
|
|
3010
|
+
shaka.ui.PlaybackRateSelection.prototype.addPlaybackRates_=function(){for(var a=this,b={},c=$jscomp.makeIterator(this.playbackRates_.keys()),d=c.next();!d.done;b={$jscomp$loop$prop$rateStr$930:b.$jscomp$loop$prop$rateStr$930},d=c.next()){b.$jscomp$loop$prop$rateStr$930=d.value;d=shaka.util.Dom.createButton();var e=shaka.util.Dom.createHTMLElement("span");e.textContent=b.$jscomp$loop$prop$rateStr$930;d.appendChild(e);this.eventManager.listen(d,"click",function(f){return function(){a.video.playbackRate=
|
|
3011
|
+
a.playbackRates_.get(f.$jscomp$loop$prop$rateStr$930);a.video.defaultPlaybackRate=a.playbackRates_.get(f.$jscomp$loop$prop$rateStr$930)}}(b));this.menu.appendChild(d)}shaka.ui.Utils.focusOnTheChosenItem(this.menu)};goog.exportSymbol("shaka.ui.PlaybackRateSelection",shaka.ui.PlaybackRateSelection);shaka.ui.PlaybackRateSelection.Factory=function(){};shaka.ui.PlaybackRateSelection.Factory.prototype.create=function(a,b){return new shaka.ui.PlaybackRateSelection(a,b)};
|
|
3010
3012
|
shaka.ui.OverflowMenu.registerElement("playback_rate",new shaka.ui.PlaybackRateSelection.Factory);shaka.ui.Controls.registerElement("playback_rate",new shaka.ui.PlaybackRateSelection.Factory);shaka.ui.PresentationTimeTracker=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.currentTime_=shaka.util.Dom.createButton();this.currentTime_.classList.add("shaka-current-time");this.setValue_("0:00");this.parent.appendChild(this.currentTime_);this.eventManager.listen(this.currentTime_,"click",function(){c.player.isLive()&&(c.video.currentTime=c.player.seekRange().end)});this.eventManager.listen(this.controls,"timeandseekrangeupdated",function(){c.updateTime_()});this.eventManager.listen(this.player,
|
|
3011
3013
|
"trackschanged",function(){c.onTracksChanged_()})};$jscomp.inherits(shaka.ui.PresentationTimeTracker,shaka.ui.Element);shaka.ui.PresentationTimeTracker.prototype.setValue_=function(a){a!=this.currentTime_.textContent&&(this.currentTime_.textContent=a)};
|
|
3012
3014
|
shaka.ui.PresentationTimeTracker.prototype.updateTime_=function(){var a=this.controls.isSeeking(),b=this.controls.getDisplayTime(),c=this.player.seekRange(),d=c.end-c.start,e=shaka.ui.Utils;this.player.isLive()?(b=Math.max(0,Math.floor(c.end-b)),d=3600<=d,1<=b||a?(this.setValue_("- "+e.buildTimeString(b,d)),this.currentTime_.disabled=!1):(this.setValue_(this.localization.resolve(shaka.ui.Locales.Ids.LIVE)),this.currentTime_.disabled=!0)):(a=3600<=d,b=e.buildTimeString(Math.max(0,b-c.start),a),d&&
|
|
@@ -3023,8 +3025,8 @@ shaka.ui.RemoteButton.Factory=function(){};shaka.ui.RemoteButton.Factory.prototy
|
|
|
3023
3025
|
this.eventManager.listen(this.player,"variantchanged",function(){c.updateResolutionSelection_()});this.eventManager.listen(this.player,"trackschanged",function(){c.updateResolutionSelection_()});this.eventManager.listen(this.player,"abrstatuschanged",function(){c.updateResolutionSelection_()});this.updateResolutionSelection_()};$jscomp.inherits(shaka.ui.ResolutionSelection,shaka.ui.SettingsMenu);
|
|
3024
3026
|
shaka.ui.ResolutionSelection.prototype.updateResolutionSelection_=function(){var a=this,b=[];this.player.getLoadMode()!=shaka.Player.LoadMode.SRC_EQUALS&&(b=this.player.getVariantTracks());var c=b.find(function(k){return k.active});c&&(b=b.filter(function(k){return k.language==c.language&&k.channelsCount==c.channelsCount}));b=b.filter(function(k,l){var m=-1;m=a.player.isAudioOnly()?b.findIndex(function(n){return n.bandwidth==k.bandwidth}):b.findIndex(function(n){return n.height==k.height&&n.frameRate==
|
|
3025
3027
|
k.frameRate&&n.hdr==k.hdr&&n.videoLayout==k.videoLayout});return m==l});this.player.isAudioOnly()?b.sort(function(k,l){goog.asserts.assert(null!=k.bandwidth,"Null bandwidth");goog.asserts.assert(null!=l.bandwidth,"Null bandwidth");return l.bandwidth-k.bandwidth}):b.sort(function(k,l){goog.asserts.assert(null!=k.height,"Null height");goog.asserts.assert(null!=l.height,"Null height");return l.height-k.height});var d=shaka.ui.Utils.getFirstDescendantWithClassName(this.menu,"shaka-back-to-overflow-button");
|
|
3026
|
-
shaka.util.Dom.removeAllChildren(this.menu);this.menu.appendChild(d);d=this.player.getConfiguration().abr.enabled;for(var e={},f=$jscomp.makeIterator(b),g=f.next();!g.done;e={$jscomp$loop$prop$track$
|
|
3027
|
-
this.player.isAudioOnly()&&e.$jscomp$loop$prop$track$
|
|
3028
|
+
shaka.util.Dom.removeAllChildren(this.menu);this.menu.appendChild(d);d=this.player.getConfiguration().abr.enabled;for(var e={},f=$jscomp.makeIterator(b),g=f.next();!g.done;e={$jscomp$loop$prop$track$932:e.$jscomp$loop$prop$track$932},g=f.next()){e.$jscomp$loop$prop$track$932=g.value;g=shaka.util.Dom.createButton();g.classList.add("explicit-resolution");this.eventManager.listen(g,"click",function(k){return function(){return a.onTrackSelected_(k.$jscomp$loop$prop$track$932)}}(e));var h=shaka.util.Dom.createHTMLElement("span");
|
|
3029
|
+
this.player.isAudioOnly()&&e.$jscomp$loop$prop$track$932.bandwidth?h.textContent=Math.round(e.$jscomp$loop$prop$track$932.bandwidth/1E3)+" kbits/s":h.textContent=e.$jscomp$loop$prop$track$932.height&&e.$jscomp$loop$prop$track$932.width?this.getResolutionLabel_(e.$jscomp$loop$prop$track$932):"Unknown";g.appendChild(h);d||e.$jscomp$loop$prop$track$932!=c||(g.ariaSelected="true",g.appendChild(shaka.ui.Utils.checkmarkIcon()),h.classList.add("shaka-chosen-item"),this.currentSelection.textContent=h.textContent);
|
|
3028
3030
|
this.menu.appendChild(g)}e=shaka.util.Dom.createButton();e.classList.add("shaka-enable-abr-button");this.eventManager.listen(e,"click",function(){a.player.configure({abr:{enabled:!0}});a.updateResolutionSelection_()});this.abrOnSpan_=shaka.util.Dom.createHTMLElement("span");this.abrOnSpan_.classList.add("shaka-auto-span");this.abrOnSpan_.textContent=this.localization.resolve(shaka.ui.Locales.Ids.AUTO_QUALITY);e.appendChild(this.abrOnSpan_);d&&(e.ariaSelected="true",e.appendChild(shaka.ui.Utils.checkmarkIcon()),
|
|
3029
3031
|
this.abrOnSpan_.classList.add("shaka-chosen-item"),this.currentSelection.textContent=this.localization.resolve(shaka.ui.Locales.Ids.AUTO_QUALITY));this.button.setAttribute("shaka-status",this.currentSelection.textContent);this.menu.appendChild(e);shaka.ui.Utils.focusOnTheChosenItem(this.menu);this.controls.dispatchEvent(new shaka.util.FakeEvent("resolutionselectionupdated"));this.updateLocalizedStrings_();shaka.ui.Utils.setDisplay(this.button,0<b.length)};
|
|
3030
3032
|
shaka.ui.ResolutionSelection.prototype.getResolutionLabel_=function(a){var b=a.height||0,c=a.width||0,d=b;c/b>16/9&&(d=Math.round(9*c/16));b=d+"p";2160==d&&(b="4K");(d=a.frameRate)&&(50<=d||20>=d)&&(b+=Math.round(a.frameRate));if("PQ"==a.hdr||"HLG"==a.hdr)b+=" (HDR)";"CH-STEREO"==a.videoLayout&&(b+=" (3D)");return b};
|
|
@@ -3039,9 +3041,9 @@ function(){c.updateAriaLabel_();c.updateLocalizedStrings_()});this.eventManager.
|
|
|
3039
3041
|
$jscomp.inherits(shaka.ui.SkipAdButton,shaka.ui.Element);shaka.ui.SkipAdButton.prototype.release=function(){this.timer_.stop();this.timer_=null;shaka.ui.Element.prototype.release.call(this)};shaka.ui.SkipAdButton.prototype.updateLocalizedStrings_=function(){this.button_.textContent=this.localization.resolve(shaka.ui.Locales.Ids.SKIP_AD)};shaka.ui.SkipAdButton.prototype.updateAriaLabel_=function(){};
|
|
3040
3042
|
shaka.ui.SkipAdButton.prototype.onAdStarted_=function(){this.ad.isSkippable()&&(shaka.ui.Utils.setDisplay(this.button_,!0),shaka.ui.Utils.setDisplay(this.counter_,!0),this.counter_.textContent="",this.timer_.tickNow(),this.timer_.tickEvery(.5))};
|
|
3041
3043
|
shaka.ui.SkipAdButton.prototype.onTimerTick_=function(){goog.asserts.assert(null!=this.ad,"this.ad should exist at this point");var a=Math.round(this.ad.getTimeUntilSkippable());0<a?this.counter_.textContent=a:(this.timer_.stop(),shaka.ui.Utils.setDisplay(this.counter_,!1))};shaka.ui.SkipAdButton.prototype.onSkipStateChanged_=function(){this.ad.canSkipNow()&&(this.button_.disabled=!1,this.timer_.stop(),shaka.ui.Utils.setDisplay(this.counter_,!1))};
|
|
3042
|
-
shaka.ui.SkipAdButton.prototype.reset_=function(){this.timer_.stop();this.button_.disabled=!0;shaka.ui.Utils.setDisplay(this.button_,!1);shaka.ui.Utils.setDisplay(this.counter_,!1)};goog.exportSymbol("shaka.ui.SkipAdButton",shaka.ui.SkipAdButton);shaka.ui.SmallPlayButton=function(a,b){shaka.ui.PlayButton.call(this,a,b);this.button.classList.add("shaka-small-play-button");this.button.classList.add("material-icons-round");this.button.classList.add("shaka-tooltip");this.updateIcon();this.updateAriaLabel()};$jscomp.inherits(shaka.ui.SmallPlayButton,shaka.ui.PlayButton);
|
|
3043
|
-
shaka.ui.SmallPlayButton.prototype.updateAriaLabel=function(){var a=shaka.ui.Locales.Ids;this.
|
|
3044
|
-
shaka.ui.Controls.registerElement("play_pause",new shaka.ui.SmallPlayButton.Factory);shaka.ui.Spacer=function(a,b){shaka.ui.Element.call(this,a,b);a=shaka.util.Dom.createHTMLElement("div");a.classList.add("shaka-spacer");a.ariaHidden="true";this.parent.appendChild(a)};$jscomp.inherits(shaka.ui.Spacer,shaka.ui.Element);goog.exportSymbol("shaka.ui.Spacer",shaka.ui.Spacer);shaka.ui.Spacer.Factory=function(){};shaka.ui.Spacer.Factory.prototype.create=function(a,b){return new shaka.ui.Spacer(a,b)};shaka.ui.Controls.registerElement("spacer",new shaka.ui.Spacer.Factory);shaka.ui.StatisticsButton=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.button_=shaka.util.Dom.createButton();this.button_.classList.add("shaka-statistics-button");this.icon_=shaka.util.Dom.createHTMLElement("i");this.icon_.classList.add("material-icons-round");this.icon_.textContent=shaka.ui.Enums.MaterialDesignIcons.STATISTICS_ON;this.button_.appendChild(this.icon_);a=shaka.util.Dom.createHTMLElement("label");a.classList.add("shaka-overflow-button-label");this.nameSpan_=shaka.util.Dom.createHTMLElement("span");
|
|
3044
|
+
shaka.ui.SkipAdButton.prototype.reset_=function(){this.timer_.stop();this.button_.disabled=!0;shaka.ui.Utils.setDisplay(this.button_,!1);shaka.ui.Utils.setDisplay(this.counter_,!1)};goog.exportSymbol("shaka.ui.SkipAdButton",shaka.ui.SkipAdButton);shaka.ui.SmallPlayButton=function(a,b){shaka.ui.PlayButton.call(this,a,b);this.button.classList.add("shaka-small-play-button");this.button.classList.add("material-icons-round");this.button.classList.add("shaka-tooltip");this.updateIcon();this.updateAriaLabel()};$jscomp.inherits(shaka.ui.SmallPlayButton,shaka.ui.PlayButton);
|
|
3045
|
+
shaka.ui.SmallPlayButton.prototype.updateIcon=function(){var a=shaka.ui.Enums.MaterialDesignIcons;this.isEnded()?this.button.textContent=a.REPLAY:this.button.textContent=this.isPaused()?a.PLAY:a.PAUSE};shaka.ui.SmallPlayButton.prototype.updateAriaLabel=function(){var a=shaka.ui.Locales.Ids;this.isEnded()?this.button.ariaLabel=this.localization.resolve(a.REPLAY):(a=this.isPaused()?a.PLAY:a.PAUSE,this.button.ariaLabel=this.localization.resolve(a))};goog.exportSymbol("shaka.ui.SmallPlayButton",shaka.ui.SmallPlayButton);
|
|
3046
|
+
shaka.ui.SmallPlayButton.Factory=function(){};shaka.ui.SmallPlayButton.Factory.prototype.create=function(a,b){return new shaka.ui.SmallPlayButton(a,b)};shaka.ui.Controls.registerElement("play_pause",new shaka.ui.SmallPlayButton.Factory);shaka.ui.Spacer=function(a,b){shaka.ui.Element.call(this,a,b);a=shaka.util.Dom.createHTMLElement("div");a.classList.add("shaka-spacer");a.ariaHidden="true";this.parent.appendChild(a)};$jscomp.inherits(shaka.ui.Spacer,shaka.ui.Element);goog.exportSymbol("shaka.ui.Spacer",shaka.ui.Spacer);shaka.ui.Spacer.Factory=function(){};shaka.ui.Spacer.Factory.prototype.create=function(a,b){return new shaka.ui.Spacer(a,b)};shaka.ui.Controls.registerElement("spacer",new shaka.ui.Spacer.Factory);shaka.ui.StatisticsButton=function(a,b){shaka.ui.Element.call(this,a,b);var c=this;this.button_=shaka.util.Dom.createButton();this.button_.classList.add("shaka-statistics-button");this.icon_=shaka.util.Dom.createHTMLElement("i");this.icon_.classList.add("material-icons-round");this.icon_.textContent=shaka.ui.Enums.MaterialDesignIcons.STATISTICS_ON;this.button_.appendChild(this.icon_);a=shaka.util.Dom.createHTMLElement("label");a.classList.add("shaka-overflow-button-label");this.nameSpan_=shaka.util.Dom.createHTMLElement("span");
|
|
3045
3047
|
a.appendChild(this.nameSpan_);this.stateSpan_=shaka.util.Dom.createHTMLElement("span");this.stateSpan_.classList.add("shaka-current-selection-span");a.appendChild(this.stateSpan_);this.button_.appendChild(a);this.parent.appendChild(this.button_);this.container_=shaka.util.Dom.createHTMLElement("div");this.container_.classList.add("shaka-no-propagation");this.container_.classList.add("shaka-show-controls-on-mouse-over");this.container_.classList.add("shaka-statistics-container");this.container_.classList.add("shaka-hidden");
|
|
3046
3048
|
this.controls.getControlsContainer().appendChild(this.container_);this.statisticsList_=[];this.skippedStats_=["stateHistory","switchHistory"];this.currentStats_=this.player.getStats();this.displayedElements_={};a=function(g){return c.currentStats_[g]+" (px)"};b=function(g){return c.currentStats_[g]+" (frames)"};var d=function(g){return c.currentStats_[g].toFixed(2)+" (s)"},e=function(g){return Math.round(c.currentStats_[g]/1E3)+" (kbits/s)"},f=function(g){return shaka.ui.Utils.buildTimeString(c.currentStats_[g],
|
|
3047
3049
|
!1)+" (m)"};this.parseFrom_={width:a,height:a,completionPercent:function(g){return c.currentStats_[g]+" (%)"},bufferingTime:d,drmTimeSeconds:d,licenseTime:d,liveLatency:d,loadLatency:d,manifestTimeSeconds:d,estimatedBandwidth:e,streamBandwidth:e,maxSegmentDuration:f,pauseTime:f,playTime:f,corruptedFrames:b,decodedFrames:b,droppedFrames:b,stallsDetected:function(g){return c.currentStats_[g]+" (stalls)"},gapsJumped:function(g){return c.currentStats_[g]+" (gaps)"}};this.timer_=new shaka.util.Timer(function(){c.onTimerTick_()});
|