shaka-player 4.6.7 → 4.6.8
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/CHANGELOG.md +22 -0
- package/README.md +3 -1
- package/dist/locales.js +28 -28
- 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 +690 -690
- 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 -89
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +5 -0
- package/dist/shaka-player.ui.js +786 -786
- 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/test/cea/cea_decoder_unit.js +36 -0
- package/test/media/media_source_engine_unit.js +24 -1
- package/test/player_load_graph_integration.js +5 -0
- package/test/player_unit.js +17 -0
- package/ui/play_button.js +17 -0
- package/ui/small_play_button.js +2 -2
|
@@ -266,8 +266,8 @@ shaka.util.Platform.isWindows=function(){return navigator.userAgentData&&navigat
|
|
|
266
266
|
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_};
|
|
267
267
|
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};
|
|
268
268
|
shaka.util.Platform.isMediaKeysPolyfilled=function(){return window.shakaMediaKeysPolyfill?!0:!1};shaka.util.Platform.cacheExpirationTimer_=null;shaka.util.Platform.cachedMediaElement_=null;shaka.util.StreamUtils=function(){};
|
|
269
|
-
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(u,w){u=0;var t=[],v={};w=$jscomp.makeIterator(w);for(var x=w.next();!x.done;v={$jscomp$loop$prop$variant$
|
|
270
|
-
w.next())v.$jscomp$loop$prop$variant$
|
|
269
|
+
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(u,w){u=0;var t=[],v={};w=$jscomp.makeIterator(w);for(var x=w.next();!x.done;v={$jscomp$loop$prop$variant$491$771:v.$jscomp$loop$prop$variant$491$771},x=
|
|
270
|
+
w.next())v.$jscomp$loop$prop$variant$491$771=x.value,x=d.filter(function(y){return function(z){return y.$jscomp$loop$prop$variant$491$771.decodingInfos[0][z]}}(v)).length,x>u?(u=x,t=[v.$jscomp$loop$prop$variant$491$771]):x==u&&t.push(v.$jscomp$loop$prop$variant$491$771);h.push.apply(h,$jscomp.arrayFromIterable(t))});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(u,w){return u.bandwidth-
|
|
271
271
|
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(u,w){return u.bandwidth&&w.bandwidth?u.bandwidth-
|
|
272
272
|
w.bandwidth:u.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),
|
|
273
273
|
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(u){var w=u.audio,t=u.video;return w&&!k.includes(w.id)||t&&!r.includes(t.id)?(shaka.log.debug("Dropping Variant (better codec available)",u),!1):!0})};
|
|
@@ -445,7 +445,7 @@ shaka.util.Pssh.prototype.parsePsshBox_=function(a){goog.asserts.assert(null!=a.
|
|
|
445
445
|
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)}}}};
|
|
446
446
|
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),
|
|
447
447
|
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};
|
|
448
|
-
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$
|
|
448
|
+
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$514$783:c.$jscomp$loop$prop$initData$514$783},d=b.next())c.$jscomp$loop$prop$initData$514$783=d.value,a.some(function(e){return function(f){return shaka.util.BufferUtils.equal(f,e.$jscomp$loop$prop$initData$514$783)}}(c))||a.push(c.$jscomp$loop$prop$initData$514$783);return shaka.util.Uint8ArrayUtils.concat.apply(shaka.util.Uint8ArrayUtils,
|
|
449
449
|
$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};
|
|
450
450
|
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};
|
|
451
451
|
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};
|
|
@@ -663,7 +663,7 @@ typeof this.lcevcLib_.SupportObject)return shaka.log.alwaysWarn("Could not find
|
|
|
663
663
|
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_||
|
|
664
664
|
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_=
|
|
665
665
|
!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};
|
|
666
|
-
shaka.media.MediaSourceEngine.prototype.createMediaSource=function(a){var b=this;if(window.ManagedMediaSource){this.video_.disableRemotePlayback=!0;var c=new ManagedMediaSource;this.eventManager_.
|
|
666
|
+
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_=
|
|
667
667
|
!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};
|
|
668
668
|
shaka.media.MediaSourceEngine.prototype.onSourceOpen_=function(a){goog.asserts.assert(this.url_,"Must have object URL");URL.revokeObjectURL(this.url_);a.resolve()};
|
|
669
669
|
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)};
|
|
@@ -735,9 +735,9 @@ shaka.media.PresentationTimeline.prototype.getDelay=function(){return this.prese
|
|
|
735
735
|
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_);
|
|
736
736
|
shaka.log.v1("notifySegments:","maxSegmentDuration="+this.maxSegmentDuration_)}};
|
|
737
737
|
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_&&
|
|
738
|
-
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.
|
|
739
|
-
shaka.media.PresentationTimeline.prototype.
|
|
740
|
-
shaka.media.PresentationTimeline.prototype.isLive=function(){return Infinity==this.duration_&&!this.static_};shaka.media.PresentationTimeline.prototype.isInProgress=function(){return Infinity!=this.duration_&&!this.static_};
|
|
738
|
+
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_};
|
|
739
|
+
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_)};
|
|
740
|
+
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_};
|
|
741
741
|
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};
|
|
742
742
|
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_};
|
|
743
743
|
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)};
|
|
@@ -748,11 +748,11 @@ shaka.media.PresentationTimeline.prototype.assertIsValid=function(){goog.DEBUG&&
|
|
|
748
748
|
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);
|
|
749
749
|
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);
|
|
750
750
|
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);
|
|
751
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"notifyMinSegmentStartTime",shaka.media.PresentationTimeline.prototype.notifyMinSegmentStartTime);goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
752
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
753
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
754
|
-
goog.exportProperty(shaka.media.PresentationTimeline.prototype,"
|
|
755
|
-
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(){}};
|
|
751
|
+
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);
|
|
752
|
+
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);
|
|
753
|
+
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);
|
|
754
|
+
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);
|
|
755
|
+
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(){}};
|
|
756
756
|
shaka.media.StallDetector.prototype.onStall=function(a){this.onStall_=a};shaka.media.StallDetector.prototype.getStallsDetected=function(){return this.stallsDetected_};
|
|
757
757
|
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));
|
|
758
758
|
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};
|
|
@@ -1188,9 +1188,10 @@ d);h.manifest_.textStreams.push(v);h.onTracksChanged_();return z.return(shaka.ut
|
|
|
1188
1188
|
shaka.Player.prototype.addThumbnailsTrack=function(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,q,r,u,w,t,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);
|
|
1189
1189
|
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,
|
|
1190
1190
|
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);
|
|
1191
|
-
m=h.parseMedia(l,k,a);n=[];p={};q=$jscomp.makeIterator(m);for(r=q.next();!r.done;p={$jscomp$loop$prop$
|
|
1192
|
-
4===t.length&&w.setThumbnailSprite({height:parseInt(t[3],10),positionX:parseInt(t[0],10),positionY:parseInt(t[1],10),width:parseInt(t[2],10)})),n.push(w);v={id:c.nextExternalStreamId_++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
1193
|
-
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);
|
|
1191
|
+
m=h.parseMedia(l,k,a);n=[];p={};q=$jscomp.makeIterator(m);for(r=q.next();!r.done;p={$jscomp$loop$prop$uris$797:p.$jscomp$loop$prop$uris$797,$jscomp$loop$prop$cue$798:p.$jscomp$loop$prop$cue$798},r=q.next())p.$jscomp$loop$prop$cue$798=r.value,p.$jscomp$loop$prop$uris$797=null,u=function(y){return function(){null==y.$jscomp$loop$prop$uris$797&&(y.$jscomp$loop$prop$uris$797=shaka.util.ManifestParserUtils.resolveUris([a],[y.$jscomp$loop$prop$cue$798.payload]));return y.$jscomp$loop$prop$uris$797||[]}}(p),
|
|
1192
|
+
w=new shaka.media.SegmentReference(p.$jscomp$loop$prop$cue$798.startTime,p.$jscomp$loop$prop$cue$798.endTime,u,0,null,null,0,0,Infinity),p.$jscomp$loop$prop$cue$798.payload.includes("#xywh")&&(t=p.$jscomp$loop$prop$cue$798.payload.split("#xywh=")[1].split(","),4===t.length&&w.setThumbnailSprite({height:parseInt(t[3],10),positionX:parseInt(t[0],10),positionY:parseInt(t[1],10),width:parseInt(t[2],10)})),n.push(w);v={id:c.nextExternalStreamId_++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
|
|
1193
|
+
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);
|
|
1194
|
+
c.onTracksChanged_();return x.return(shaka.util.StreamUtils.imageStreamToTrack(v))}})};
|
|
1194
1195
|
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);
|
|
1195
1196
|
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,
|
|
1196
1197
|
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);}})};
|
|
@@ -1268,22 +1269,22 @@ goog.exportProperty(shaka.Player.prototype,"isInProgress",shaka.Player.prototype
|
|
|
1268
1269
|
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);
|
|
1269
1270
|
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);
|
|
1270
1271
|
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);
|
|
1271
|
-
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.6.
|
|
1272
|
+
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.6.8-debug";
|
|
1272
1273
|
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_++};
|
|
1273
1274
|
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()};
|
|
1274
1275
|
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()};
|
|
1275
1276
|
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()};
|
|
1276
|
-
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()};
|
|
1277
|
-
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_)};
|
|
1278
|
-
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()};
|
|
1279
|
-
shaka.ads.ClientSideAd.prototype.
|
|
1280
|
-
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()};
|
|
1281
|
-
|
|
1282
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1283
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1284
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1285
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"
|
|
1286
|
-
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);
|
|
1277
|
+
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()};
|
|
1278
|
+
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_)};
|
|
1279
|
+
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()};
|
|
1280
|
+
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()};
|
|
1281
|
+
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()};
|
|
1282
|
+
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);
|
|
1283
|
+
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);
|
|
1284
|
+
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);
|
|
1285
|
+
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);
|
|
1286
|
+
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);
|
|
1287
|
+
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);
|
|
1287
1288
|
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);
|
|
1288
1289
|
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");
|
|
1289
1290
|
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_,
|
|
@@ -1292,7 +1293,7 @@ shaka.ads.ClientSideAdManager.prototype.updateAdsRenderingSettings=function(a){t
|
|
|
1292
1293
|
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()};
|
|
1293
1294
|
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",[])))};
|
|
1294
1295
|
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);
|
|
1295
|
-
this.eventManager_.listen(this.video_,"timeupdate",function(){b.video_.duration&&(d.currentTime=b.video_.currentTime)});this.eventManager_.listen(this.video_,"volumechange",function(){b.
|
|
1296
|
+
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();
|
|
1296
1297
|
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_()?
|
|
1297
1298
|
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_()?
|
|
1298
1299
|
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)}};
|
|
@@ -1450,7 +1451,7 @@ shaka.cast.CastProxy.prototype.cast=function(){var a=this,b;return $jscomp.async
|
|
|
1450
1451
|
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_()},
|
|
1451
1452
|
function(e,f){return c.onRemoteEvent_(e,f)},function(){return c.onResumeLocal_()},function(){return c.getInitState_()},b);c.sender_.init();d.jumpToEnd()})};
|
|
1452
1453
|
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_=
|
|
1453
|
-
{};b={};for(var e in this.localVideo_)b.$jscomp$loop$prop$k$
|
|
1454
|
+
{};b={};for(var e in this.localVideo_)b.$jscomp$loop$prop$k$801=e,Object.defineProperty(this.videoProxy_,b.$jscomp$loop$prop$k$801,{configurable:!1,enumerable:!0,get:function(f){return function(){return a.videoProxyGet_(f.$jscomp$loop$prop$k$801)}}(b),set:function(f){return function(g){a.videoProxySet_(f.$jscomp$loop$prop$k$801,g)}}(b)}),b={$jscomp$loop$prop$k$801:b.$jscomp$loop$prop$k$801};this.playerProxy_={};this.iterateOverPlayerMethods_(function(f,g){goog.asserts.assert(a.playerProxy_,"Must have player proxy!");
|
|
1454
1455
|
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_};
|
|
1455
1456
|
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)})};
|
|
1456
1457
|
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)}};
|
|
@@ -1506,7 +1507,7 @@ shaka.cea.CeaUtils.getParsedCaption=function(a,b,c,d,e){if(d>=e)return null;for(
|
|
|
1506
1507
|
" ";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};
|
|
1507
1508
|
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_};
|
|
1508
1509
|
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()};
|
|
1509
|
-
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_};
|
|
1510
|
+
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_};
|
|
1510
1511
|
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};
|
|
1511
1512
|
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();
|
|
1512
1513
|
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()};
|
|
@@ -1570,7 +1571,7 @@ shaka.cea.CeaDecoder.prototype.extract=function(a,b){if(this.waitingForFirstPack
|
|
|
1570
1571
|
value:h,order:this.cea708DataArray_.length})))}};
|
|
1571
1572
|
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=
|
|
1572
1573
|
b.next())c=this.decodeCea708_(c.value),a.push.apply(a,$jscomp.arrayFromIterable(c));this.dtvccPacketBuilder_.clearBuiltPackets();this.cea608DataArray_=[];this.cea708DataArray_=[];return a};
|
|
1573
|
-
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_=
|
|
1574
|
+
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_=
|
|
1574
1575
|
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};
|
|
1575
1576
|
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&&
|
|
1576
1577
|
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;
|
|
@@ -1668,9 +1669,9 @@ mediaSegments:d}};
|
|
|
1668
1669
|
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&&
|
|
1669
1670
|
!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:",
|
|
1670
1671
|
"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);};
|
|
1671
|
-
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$
|
|
1672
|
-
$jscomp$loop$prop$segment$
|
|
1673
|
-
return w.$jscomp$loop$prop$uris$
|
|
1672
|
+
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$803:p.$jscomp$loop$prop$uris$803,
|
|
1673
|
+
$jscomp$loop$prop$segment$804:p.$jscomp$loop$prop$segment$804},q++){p.$jscomp$loop$prop$segment$804=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$803=null;var u=function(w){return function(){null==w.$jscomp$loop$prop$uris$803&&(w.$jscomp$loop$prop$uris$803=h.resolveUris(d(),[w.$jscomp$loop$prop$segment$804.mediaUri]));
|
|
1674
|
+
return w.$jscomp$loop$prop$uris$803}}(p);m.push(new shaka.media.SegmentReference(a+n,a+r,u,p.$jscomp$loop$prop$segment$804.start,p.$jscomp$loop$prop$segment$804.end,f,k,a,l,[],"",null,null,shaka.media.SegmentReference.Status.AVAILABLE,g));n=r}return m};
|
|
1674
1675
|
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."));
|
|
1675
1676
|
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(){};
|
|
1676
1677
|
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,
|
|
@@ -1696,8 +1697,8 @@ shaka.dash.TimelineSegmentIndex.prototype.appendTemplateInfo=function(a,b,c,d,e)
|
|
|
1696
1697
|
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};
|
|
1697
1698
|
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_)}};
|
|
1698
1699
|
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};
|
|
1699
|
-
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$
|
|
1700
|
-
$jscomp$loop$prop$subNumber$
|
|
1700
|
+
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$806:l.$jscomp$loop$prop$uris$806,
|
|
1701
|
+
$jscomp$loop$prop$subNumber$807:l.$jscomp$loop$prop$subNumber$807},m++){var n=e.start+k*m,p=n+k;l.$jscomp$loop$prop$subNumber$807=m+1;l.$jscomp$loop$prop$uris$806=null;var q=function(r){return function(){if(!b.templateInfo_)return[];null==r.$jscomp$loop$prop$uris$806&&(r.$jscomp$loop$prop$uris$806=shaka.dash.TimelineSegmentIndex.createUris_(b.templateInfo_.mediaTemplate,b.representationId_,f,b.bandwidth_,g,r.$jscomp$loop$prop$subNumber$807,b.getBaseUris_));return r.$jscomp$loop$prop$uris$806}}(l);
|
|
1701
1702
|
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,
|
|
1702
1703
|
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};
|
|
1703
1704
|
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};
|
|
@@ -1707,8 +1708,8 @@ m.yield(f.promise,4);if(2!=m.nextAddress)return g=m.yieldResult,h=shaka.util.Str
|
|
|
1707
1708
|
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()&&
|
|
1708
1709
|
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"]||[]};
|
|
1709
1710
|
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)};
|
|
1710
|
-
shaka.util.ContentSteeringManager.prototype.getLocations=function(a){var b=this;a=this.locations_.get(a)||new Map;for(var c=[],d={},e=$jscomp.makeIterator(this.pathwayPriority_),f=e.next();!f.done;d={$jscomp$loop$prop$pathwayId$
|
|
1711
|
-
h.$jscomp$loop$prop$pathwayId$
|
|
1711
|
+
shaka.util.ContentSteeringManager.prototype.getLocations=function(a){var b=this;a=this.locations_.get(a)||new Map;for(var c=[],d={},e=$jscomp.makeIterator(this.pathwayPriority_),f=e.next();!f.done;d={$jscomp$loop$prop$pathwayId$809:d.$jscomp$loop$prop$pathwayId$809},f=e.next())if(d.$jscomp$loop$prop$pathwayId$809=f.value,f=a.get(d.$jscomp$loop$prop$pathwayId$809))c.push({pathwayId:d.$jscomp$loop$prop$pathwayId$809,location:f});else if(f=this.pathwayClones_.find(function(h){return function(k){return k.ID==
|
|
1712
|
+
h.$jscomp$loop$prop$pathwayId$809}}(d))){var g=a.get(f["BASE-ID"]);g&&(f["URI-REPLACEMENT"].HOST?(g=new goog.Uri(g),g.setDomain(f["URI-REPLACEMENT"].HOST),c.push({pathwayId:d.$jscomp$loop$prop$pathwayId$809,location:g.toString()})):c.push({pathwayId:d.$jscomp$loop$prop$pathwayId$809,location:g}))}d=Date.now();e=$jscomp.makeIterator(this.bannedLocations_.keys());for(f=e.next();!f.done;f=e.next())f=f.value,g=this.bannedLocations_.get(f),d>g&&this.bannedLocations_.delete(f);c=c.filter(function(h){for(var k=
|
|
1712
1713
|
$jscomp.makeIterator(b.bannedLocations_.keys()),l=k.next();!l.done;l=k.next())if(l.value.includes((new goog.Uri(h.location)).getDomain()))return!1;return!0});c.length&&(this.lastPathwayUsed_=c[0].pathwayId);c=c.map(function(h){return h.location});if(!c.length&&this.defaultPathwayId_)for(d=$jscomp.makeIterator(this.defaultPathwayId_.split(",")),f=d.next();!f.done;f=d.next())if(e=a.get(f.value))this.lastPathwayUsed_=this.defaultPathwayId_,c.push(e);if(!c.length)for(a=$jscomp.makeIterator(a.values()),
|
|
1713
1714
|
d=a.next();!d.done;d=a.next())c.push(d.value);return shaka.util.ManifestParserUtils.resolveUris(this.baseUris_,c)};shaka.util.PeriodCombiner=function(){this.variants_=[];this.audioStreams_=[];this.videoStreams_=[];this.textStreams_=[];this.imageStreams_=[];this.usedPeriodIds_=new Set};
|
|
1714
1715
|
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()};
|
|
@@ -1722,15 +1723,15 @@ c.variants_=y;L.jumpToEnd()})};
|
|
|
1722
1723
|
shaka.util.PeriodCombiner.filterOutDuplicates_=function(a){var b=shaka.util.PeriodCombiner,c=shaka.util.ArrayUtils,d=shaka.util.MapUtils;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next())e=e.value,e.videoStreams=b.filterOutStreamDuplicates_(e.videoStreams,function(f,g){return f.id!==g.id&&f.fastSwitching==g.fastSwitching&&f.width===g.width&&f.frameRate===g.frameRate&&f.codecs===g.codecs&&f.mimeType===g.mimeType&&f.label===g.label&&c.hasSameElements(f.roles,g.roles)&&d.hasSameElements(f.closedCaptions,
|
|
1723
1724
|
g.closedCaptions)&&f.bandwidth===g.bandwidth}),e.audioStreams=b.filterOutStreamDuplicates_(e.audioStreams,function(f,g){return f.id!==g.id&&f.fastSwitching==g.fastSwitching&&f.channelsCount===g.channelsCount&&f.language===g.language&&f.bandwidth===g.bandwidth&&f.label===g.label&&f.codecs===g.codecs&&f.mimeType===g.mimeType&&c.hasSameElements(f.roles,g.roles)&&f.audioSamplingRate===g.audioSamplingRate&&f.primary===g.primary}),e.textStreams=b.filterOutStreamDuplicates_(e.textStreams,function(f,g){return f.id!==
|
|
1724
1725
|
g.id&&f.language===g.language&&f.label===g.label&&f.codecs===g.codecs&&f.mimeType===g.mimeType&&f.bandwidth===g.bandwidth&&c.hasSameElements(f.roles,g.roles)}),e.imageStreams=b.filterOutStreamDuplicates_(e.imageStreams,function(f,g){return f.id!==g.id&&f.width===g.width&&f.codecs===g.codecs&&f.mimeType===g.mimeType})};
|
|
1725
|
-
shaka.util.PeriodCombiner.filterOutStreamDuplicates_=function(a,b){var c=[],d={};a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;d={$jscomp$loop$prop$s1$
|
|
1726
|
+
shaka.util.PeriodCombiner.filterOutStreamDuplicates_=function(a,b){var c=[],d={};a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;d={$jscomp$loop$prop$s1$811:d.$jscomp$loop$prop$s1$811},e=a.next())d.$jscomp$loop$prop$s1$811=e.value,c.some(function(f){return function(g){return b(f.$jscomp$loop$prop$s1$811,g)}}(d))||c.push(d.$jscomp$loop$prop$s1$811);return c};
|
|
1726
1727
|
shaka.util.PeriodCombiner.combineDbStreams=function(a){var b,c,d,e,f,g,h,k,l,m,n,p,q,r,u,w,t,v,x,y,z,A,B,E,I,C,G;return $jscomp.asyncExecutePromiseGeneratorProgram(function(D){switch(D.nextAddress){case 1:b=shaka.util.ManifestParserUtils.ContentType;if(1==a.length)return D.return(a[0]);c=a.map(function(F){return F.filter(function(H){return H.type==b.AUDIO})});d=a.map(function(F){return F.filter(function(H){return H.type==b.VIDEO})});e=a.map(function(F){return F.filter(function(H){return H.type==b.TEXT})});
|
|
1727
1728
|
f=a.map(function(F){return F.filter(function(H){return H.type==b.IMAGE})});g=$jscomp.makeIterator(e);for(h=g.next();!h.done;h=g.next())k=h.value,k.push(shaka.util.PeriodCombiner.dummyStreamDB_(b.TEXT));l=$jscomp.makeIterator(f);for(m=l.next();!m.done;m=l.next())n=m.value,n.push(shaka.util.PeriodCombiner.dummyStreamDB_(b.IMAGE));return D.yield(shaka.util.PeriodCombiner.combine_([],c,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),2);case 2:return p=D.yieldResult,
|
|
1728
1729
|
D.yield(shaka.util.PeriodCombiner.combine_([],d,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),3);case 3:return q=D.yieldResult,D.yield(shaka.util.PeriodCombiner.combine_([],e,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),4);case 4:return r=D.yieldResult,D.yield(shaka.util.PeriodCombiner.combine_([],f,0,shaka.util.PeriodCombiner.cloneStreamDB_,shaka.util.PeriodCombiner.concatenateStreamDBs_),5);case 5:u=D.yieldResult;
|
|
1729
1730
|
w=0;if(q.length&&p.length)for(z=$jscomp.makeIterator(p),A=z.next();!A.done;A=z.next())for(B=A.value,E=$jscomp.makeIterator(q),I=E.next();!I.done;I=E.next())C=I.value,G=w++,C.variantIds.push(G),B.variantIds.push(G);else for(t=q.concat(p),v=$jscomp.makeIterator(t),x=v.next();!x.done;x=v.next())y=x.value,y.variantIds=[w++];return D.return(q.concat(p).concat(r).concat(u))}})};
|
|
1730
1731
|
shaka.util.PeriodCombiner.combine_=function(a,b,c,d,e){var f,g,h,k,l,m,n,p,q,r,u,w,t,v,x,y,z,A,B,E,I;return $jscomp.asyncExecutePromiseGeneratorProgram(function(C){switch(C.nextAddress){case 1:f=shaka.util.ManifestParserUtils.ContentType;g=[];for(h=0;h<b.length;h++)h>=c?g.push(new Set(b[h])):g.push(new Set);k=$jscomp.makeIterator(a);l=k.next();case 2:if(l.done){C.jumpTo(4);break}m=l.value;return C.yield(shaka.util.PeriodCombiner.extendExistingOutputStream_(m,b,c,e,g),5);case 5:n=C.yieldResult;if(!n)throw new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,
|
|
1731
|
-
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);l=k.next();C.jumpTo(2);break;case 4:p=$jscomp.makeIterator(g);for(q=p.next();!q.done;q=p.next())for(r=q.value,u=$jscomp.makeIterator(r),w=u.next();!w.done;w=u.next())t=w.value,(v=shaka.util.PeriodCombiner.createNewOutputStream_(t,b,d,e,g))&&a.push(v);x=$jscomp.makeIterator(g);for(q=x.next();!q.done;q=x.next())for(y=q.value,z={},A=$jscomp.makeIterator(y),w=A.next();!w.done;z={$jscomp$loop$prop$stream$
|
|
1732
|
-
w=A.next())if(z.$jscomp$loop$prop$stream$
|
|
1733
|
-
z.$jscomp$loop$prop$stream$
|
|
1732
|
+
shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);l=k.next();C.jumpTo(2);break;case 4:p=$jscomp.makeIterator(g);for(q=p.next();!q.done;q=p.next())for(r=q.value,u=$jscomp.makeIterator(r),w=u.next();!w.done;w=u.next())t=w.value,(v=shaka.util.PeriodCombiner.createNewOutputStream_(t,b,d,e,g))&&a.push(v);x=$jscomp.makeIterator(g);for(q=x.next();!q.done;q=x.next())for(y=q.value,z={},A=$jscomp.makeIterator(y),w=A.next();!w.done;z={$jscomp$loop$prop$stream$650$813:z.$jscomp$loop$prop$stream$650$813},
|
|
1733
|
+
w=A.next())if(z.$jscomp$loop$prop$stream$650$813=w.value,B=z.$jscomp$loop$prop$stream$650$813.type==f.TEXT&&!z.$jscomp$loop$prop$stream$650$813.language,E=z.$jscomp$loop$prop$stream$650$813.type==f.IMAGE&&!z.$jscomp$loop$prop$stream$650$813.tilesLayout,!B&&!E&&(I=a.some(function(G){return function(D){return D.mimeType==G.$jscomp$loop$prop$stream$650$813.mimeType&&shaka.util.MimeUtils.getNormalizedCodec(D.codecs)==shaka.util.MimeUtils.getNormalizedCodec(G.$jscomp$loop$prop$stream$650$813.codecs)}}(z))))throw shaka.log.error("Unused stream in period-flattening!",
|
|
1734
|
+
z.$jscomp$loop$prop$stream$650$813,a),new shaka.util.Error(shaka.util.Error.Severity.CRITICAL,shaka.util.Error.Category.MANIFEST,shaka.util.Error.Code.PERIOD_FLATTENING_FAILED);return C.return(a)}})};
|
|
1734
1735
|
shaka.util.PeriodCombiner.extendExistingOutputStream_=function(a,b,c,d,e){return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){if(1==f.nextAddress)return shaka.util.PeriodCombiner.findMatchesInAllPeriods_(b,a),goog.asserts.assert(a.createSegmentIndex,"outputStream should be a Stream type!"),a.matchedStreams?a.segmentIndex?f.yield(shaka.util.PeriodCombiner.extendOutputSegmentIndex_(a,c),2):f.jumpTo(2):(shaka.log.error("No matches extending output stream!",a,b),f.return(!1));shaka.util.PeriodCombiner.extendOutputStream_(a,
|
|
1735
1736
|
c,d,e);return f.return(!0)})};
|
|
1736
1737
|
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
|
|
@@ -1790,8 +1791,8 @@ m);g=this.parsePeriod_(a,b,{start:m,duration:q,node:k,isLastPeriod:null==q||!l})
|
|
|
1790
1791
|
duration:e,durationDerivedFromPeriods:!1}):{periods:f,duration:g,durationDerivedFromPeriods:!0}};
|
|
1791
1792
|
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();
|
|
1792
1793
|
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,
|
|
1793
|
-
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$
|
|
1794
|
-
m=l.next())k.$jscomp$loop$prop$stream$
|
|
1794
|
+
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$815:k.$jscomp$loop$prop$stream$815},
|
|
1795
|
+
m=l.next())k.$jscomp$loop$prop$stream$815=m.value,k.$jscomp$loop$prop$stream$815.trickModeVideo=f.streams.find(function(n){return function(p){return shaka.util.MimeUtils.getNormalizedCodec(n.$jscomp$loop$prop$stream$815.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,
|
|
1795
1796
|
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},[])};
|
|
1796
1797
|
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(D){return D.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=
|
|
1797
1798
|
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(D){switch(D){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var u=d.findChildren(b,"EssentialProperty");l=null;var w=!1;p=!1;u=$jscomp.makeIterator(u);for(var t=u.next();!t.done;t=u.next()){t=t.value;var v=t.getAttribute("schemeIdUri");"http://dashif.org/guidelines/trickmode"==
|
|
@@ -1891,8 +1892,9 @@ shaka.hls.HlsParser.prototype.getMediaPlaylistBasicInfo_=function(a,b){var c=thi
|
|
|
1891
1892
|
h[0];l=new goog.Uri(k);m=l.getPath().split(".").pop();if(n=d.RAW_FORMATS_TO_MIME_TYPES_[m])return E.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){E.jumpTo(2);break}u=shaka.net.NetworkingEngine.makeRequest(r.getUris(),c.config_.retryParameters);w=shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT;return E.yield(c.makeNetworkRequest_(u,
|
|
1892
1893
|
p,{type:w}),3);case 3:t=E.yieldResult,q=t.data;case 2:return v=shaka.net.NetworkingEngine.makeRequest(h,c.config_.retryParameters),x=shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_SEGMENT,E.yield(c.makeNetworkRequest_(v,p,{type:x}),4);case 4:y=E.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 E.return(A)}else if("mp4"==m||"cmfv"==m||"m4s"==m||"video/mp4"==z||"audio/mp4"==
|
|
1893
1894
|
z||"video/iso.segment"==z)if(B=shaka.media.SegmentUtils.getBasicInfoFromMp4(q,y.data))return E.return(B);return E.return(e)}})};
|
|
1894
|
-
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)}
|
|
1895
|
-
this.presentationTimeline_.lockStartTime();goog.asserts.assert(!this.presentationTimeline_.usingPresentationStartTime(),
|
|
1895
|
+
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=
|
|
1896
|
+
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(),
|
|
1897
|
+
"We should not be using the presentation start time in HLS!")};
|
|
1896
1898
|
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)}};
|
|
1897
1899
|
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};
|
|
1898
1900
|
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,
|
|
@@ -1969,19 +1971,19 @@ e.id&&(h=this.parseAES128DrmTag_(l,a,c,d)):"EXT-X-BYTERANGE"==l.name&&l.id<e.id&
|
|
|
1969
1971
|
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)};
|
|
1970
1972
|
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=
|
|
1971
1973
|
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 u=shaka.media.SegmentReference.Status.AVAILABLE;shaka.hls.Utils.getFirstTagWithName(l,"EXT-X-GAP")&&(u=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,
|
|
1972
|
-
"EXTINF");if(!this.lowLatencyMode_)return null}var w=[];r=!1;var t=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$
|
|
1973
|
-
C=Number(B.getAttributeValue("DURATION"))||this.partialTargetDuration_;if(C){var G=I+C,D=0,F=null;"EXT-X-PRELOAD-HINT"==B.name?(D=(D=B.getAttributeValue("BYTERANGE-START"))?Number(D):0,(E=B.getAttributeValue("BYTERANGE-LENGTH"))?F=D+Number(E)-1:D&&(F=Number.MAX_SAFE_INTEGER)):(D=B.getAttributeValue("BYTERANGE"),F=$jscomp.makeIterator(this.parseByteRange_(E,D)),D=F.next().value,F=F.next().value);z.$jscomp$loop$prop$pUri$
|
|
1974
|
-
"YES"==B.getAttributeValue("GAP")&&(E=shaka.media.SegmentReference.Status.MISSING,v=!0);z.$jscomp$loop$prop$uris$
|
|
1974
|
+
"EXTINF");if(!this.lowLatencyMode_)return null}var w=[];r=!1;var t=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$681$817:z.$jscomp$loop$prop$uris$681$817,$jscomp$loop$prop$pUri$818:z.$jscomp$loop$prop$pUri$818},A++){var B=c.partialSegments[A],E=0==A?b:w[w.length-1],I=0==A?d:E.endTime,
|
|
1975
|
+
C=Number(B.getAttributeValue("DURATION"))||this.partialTargetDuration_;if(C){var G=I+C,D=0,F=null;"EXT-X-PRELOAD-HINT"==B.name?(D=(D=B.getAttributeValue("BYTERANGE-START"))?Number(D):0,(E=B.getAttributeValue("BYTERANGE-LENGTH"))?F=D+Number(E)-1:D&&(F=Number.MAX_SAFE_INTEGER)):(D=B.getAttributeValue("BYTERANGE"),F=$jscomp.makeIterator(this.parseByteRange_(E,D)),D=F.next().value,F=F.next().value);z.$jscomp$loop$prop$pUri$818=B.getAttributeValue("URI");if(z.$jscomp$loop$prop$pUri$818){E=shaka.media.SegmentReference.Status.AVAILABLE;
|
|
1976
|
+
"YES"==B.getAttributeValue("GAP")&&(E=shaka.media.SegmentReference.Status.MISSING,v=!0);z.$jscomp$loop$prop$uris$681$817=null;var H=function(K){return function(){null==K.$jscomp$loop$prop$uris$681$817&&(goog.asserts.assert(K.$jscomp$loop$prop$pUri$818,"Partial uri should be defined!"),K.$jscomp$loop$prop$uris$681$817=shaka.hls.Utils.constructSegmentUris(h(),K.$jscomp$loop$prop$pUri$818,e));return K.$jscomp$loop$prop$uris$681$817}}(z);n&&0<=D&&null!=F&&(t=H,r=!0);I=new shaka.media.SegmentReference(I,
|
|
1975
1977
|
G,H,D,F,a,0,0,Infinity,[],"",null,y,E,k);"EXT-X-PRELOAD-HINT"==B.name&&(I.markAsPreload(),x=!0);"YES"!=B.getAttributeValue("INDEPENDENT")&&0<A&&I.markAsNonIndependent();w.push(I);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,t=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):
|
|
1976
1978
|
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(t)return t();null==J&&(J=shaka.hls.Utils.constructSegmentUris(h(),c.verbatimSegmentUri,e));return J||[]},f,p,a,0,0,Infinity,w,b,v,q,u,k,0<w.length&&!!c.verbatimSegmentUri);
|
|
1977
1979
|
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]};
|
|
1978
1980
|
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_==
|
|
1979
1981
|
shaka.hls.HlsParser.PresentationType_.LIVE&&0<c.size&&!c.has(n)&&(p=this.presentationTimeline_.getSegmentAvailabilityStart());var q=[],r=null;l=[];for(var u=0;u<f.length;u++){var w=f[u],t=0==u?p:r.endTime;n=k+m+u;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,t);v=this.getInitSegmentReference_(a,
|
|
1980
1982
|
w.tags,e,d);!this.lowLatencyMode_&&this.playerInterface_.isAutoLowLatencyMode()&&(this.playerInterface_.enableLowLatencyMode(),this.lowLatencyMode_=this.playerInterface_.isLowLatencyMode());if(t=this.createSegmentReference_(v,r,w,t,d,a,b,e,g))(r=shaka.hls.Utils.getFirstTagWithNameAsNumber(w.tags,"EXT-X-BITRATE"))?l.push({bitrate:r,duration:t.endTime-t.startTime}):l.length&&(r=l.pop(),r.duration+=t.endTime-t.startTime,l.push(r)),r=t,t.discontinuitySequence=h,this.config_.hls.ignoreManifestProgramDateTime&&
|
|
1981
|
-
null!=this.minSequenceNumber_&&n<this.minSequenceNumber_||q.push(t)}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$
|
|
1982
|
-
$jscomp$loop$prop$backwardAdd$
|
|
1983
|
-
b.$jscomp$loop$prop$backwardAdd$
|
|
1984
|
-
(b.$jscomp$loop$prop$reference$
|
|
1983
|
+
null!=this.minSequenceNumber_&&n<this.minSequenceNumber_||q.push(t)}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$820:b.$jscomp$loop$prop$forwardI$820,$jscomp$loop$prop$forwardAdd$821:b.$jscomp$loop$prop$forwardAdd$821,$jscomp$loop$prop$backwardI$822:b.$jscomp$loop$prop$backwardI$822,$jscomp$loop$prop$reference$684$823:b.$jscomp$loop$prop$reference$684$823,
|
|
1984
|
+
$jscomp$loop$prop$backwardAdd$824:b.$jscomp$loop$prop$backwardAdd$824},c++)if(b.$jscomp$loop$prop$reference$684$823=q[c],null==b.$jscomp$loop$prop$reference$684$823.syncTime)for(b.$jscomp$loop$prop$forwardAdd$821=0,b.$jscomp$loop$prop$forwardI$820=c,d=function(y){return function(){var z=q[y.$jscomp$loop$prop$forwardI$820];if(z){if(null!=z.syncTime)return z.syncTime+y.$jscomp$loop$prop$forwardAdd$821;y.$jscomp$loop$prop$forwardAdd$821-=z.endTime-z.startTime;y.$jscomp$loop$prop$forwardI$820+=1}return null}}(b),
|
|
1985
|
+
b.$jscomp$loop$prop$backwardAdd$824=0,b.$jscomp$loop$prop$backwardI$822=c,e=function(y){return function(){var z=q[y.$jscomp$loop$prop$backwardI$822];if(z){z!=y.$jscomp$loop$prop$reference$684$823&&(y.$jscomp$loop$prop$backwardAdd$824+=z.endTime-z.startTime);if(null!=z.syncTime)return z.syncTime+y.$jscomp$loop$prop$backwardAdd$824;--y.$jscomp$loop$prop$backwardI$822}return null}}(b);null==b.$jscomp$loop$prop$reference$684$823.syncTime;)b.$jscomp$loop$prop$reference$684$823.syncTime=e(),null==b.$jscomp$loop$prop$reference$684$823.syncTime&&
|
|
1986
|
+
(b.$jscomp$loop$prop$reference$684$823.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}};
|
|
1985
1987
|
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"};
|
|
1986
1988
|
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};
|
|
1987
1989
|
shaka.hls.HlsParser.prototype.guessMimeType_=function(a,b,c,d,e){var f=this,g,h,k,l,m,n,p,q,r,u,w,t,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();
|
|
@@ -2078,8 +2080,8 @@ l,d,v);v.mssPrivateData.codecPrivateData=k;switch(l){case "audio":if(!k)return s
|
|
|
2078
2080
|
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};
|
|
2079
2081
|
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);
|
|
2080
2082
|
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):""};
|
|
2081
|
-
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$
|
|
2082
|
-
String(l.$jscomp$loop$prop$time$
|
|
2083
|
+
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$826:h.$jscomp$loop$prop$time$826},k=d.next())h.$jscomp$loop$prop$time$826=k.value,k=function(l){return function(){return f.resolveUris(e.manifestUris_,[g.replace("{start time}",
|
|
2084
|
+
String(l.$jscomp$loop$prop$time$826.unscaledStart))])}}(h),c.push(new shaka.media.SegmentReference(h.$jscomp$loop$prop$time$826.start,h.$jscomp$loop$prop$time$826.end,k,0,null,a,0,0,b.mssPrivateData.duration));return c};
|
|
2083
2085
|
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.',
|
|
2084
2086
|
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==
|
|
2085
2087
|
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};
|
|
@@ -2118,10 +2120,10 @@ shaka.offline.indexeddb.BaseStorageCell.prototype.getManifests=function(a){var b
|
|
|
2118
2120
|
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):
|
|
2119
2121
|
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))};
|
|
2120
2122
|
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))};
|
|
2121
|
-
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$
|
|
2122
|
-
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$
|
|
2123
|
-
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$
|
|
2124
|
-
h.$jscomp$loop$prop$request$
|
|
2123
|
+
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$828:g.$jscomp$loop$prop$request$828},k=h.next())l=k.value,g.$jscomp$loop$prop$request$828=e.add(l),g.$jscomp$loop$prop$request$828.onsuccess=function(n){return function(p){f.push(n.$jscomp$loop$prop$request$828.result)}}(g);
|
|
2124
|
+
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$830:e.$jscomp$loop$prop$key$830},f=b.next())e.$jscomp$loop$prop$key$830=f.value,d.delete(e.$jscomp$loop$prop$key$830).onsuccess=function(g){return function(){return c(g.$jscomp$loop$prop$key$830)}}(e);return a.promise()};
|
|
2125
|
+
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$832:h.$jscomp$loop$prop$request$832,$jscomp$loop$prop$key$833:h.$jscomp$loop$prop$key$833},l=k.next())h.$jscomp$loop$prop$key$833=l.value,h.$jscomp$loop$prop$request$832=e.get(h.$jscomp$loop$prop$key$833),
|
|
2126
|
+
h.$jscomp$loop$prop$request$832.onsuccess=function(n){return function(){void 0==n.$jscomp$loop$prop$request$832.result&&g.push(n.$jscomp$loop$prop$key$833);f[n.$jscomp$loop$prop$key$833]=n.$jscomp$loop$prop$request$832.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()};
|
|
2125
2127
|
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)})};
|
|
2126
2128
|
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()};
|
|
2127
2129
|
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)};
|
|
@@ -2187,10 +2189,9 @@ shaka.offline.OfflineManifestParser.prototype.onInitialVariantChosen=function(a)
|
|
|
2187
2189
|
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)};
|
|
2188
2190
|
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()})};
|
|
2189
2191
|
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)}})};
|
|
2190
|
-
shaka.offline.SessionDeleter.prototype.doDelete_=function(a,b,c){var d,e,f
|
|
2191
|
-
break;case 2:return e=
|
|
2192
|
-
|
|
2193
|
-
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};
|
|
2192
|
+
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);
|
|
2193
|
+
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()})})),
|
|
2194
|
+
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};
|
|
2194
2195
|
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}};
|
|
2195
2196
|
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,
|
|
2196
2197
|
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_={}};
|
|
@@ -2208,9 +2209,9 @@ shaka.offline.Storage.prototype.store_=function(a,b,c,d,e){var f=this,g,h,k,l,m,
|
|
|
2208
2209
|
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),u=r.manifestDB,
|
|
2209
2210
|
w=r.toDownload,y.yield(l.cell.addManifests([u]),11);case 11:t=y.yieldResult;f.ensureNotDestroyed_();m=t[0];goog.asserts.assert(h,"drmEngine should be non-null here.");f.ensureNotDestroyed_();if(n)throw n;return y.yield(f.downloadSegments_(w,m,u,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,u));case 3:return y.enterFinallyBlock(),y.yield(k.destroy(),13);case 13:if(!g){y.jumpTo(14);
|
|
2210
2211
|
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;}})};
|
|
2211
|
-
shaka.offline.Storage.prototype.downloadSegments_=function(a,b,c,d,e,f,g,h){var k=this,l,m,n,p,q,r,u,w,t,v;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){switch(x.nextAddress){case 1:l={};m=0;n=function(y,z){var A,B,E,I,C,G,D;return $jscomp.asyncExecutePromiseGeneratorProgram(function(F){if(1==F.nextAddress){A={};B=$jscomp.makeIterator(y);for(E=B.next();!E.done;A={$jscomp$loop$prop$download$712$
|
|
2212
|
-
E.value,I=A.$jscomp$loop$prop$download$712$
|
|
2213
|
-
d.queue(A.$jscomp$loop$prop$download$712$
|
|
2212
|
+
shaka.offline.Storage.prototype.downloadSegments_=function(a,b,c,d,e,f,g,h){var k=this,l,m,n,p,q,r,u,w,t,v;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){switch(x.nextAddress){case 1:l={};m=0;n=function(y,z){var A,B,E,I,C,G,D;return $jscomp.asyncExecutePromiseGeneratorProgram(function(F){if(1==F.nextAddress){A={};B=$jscomp.makeIterator(y);for(E=B.next();!E.done;A={$jscomp$loop$prop$download$712$835:A.$jscomp$loop$prop$download$712$835},E=B.next())A.$jscomp$loop$prop$download$712$835=
|
|
2213
|
+
E.value,I=A.$jscomp$loop$prop$download$712$835.makeSegmentRequest(e),C=A.$jscomp$loop$prop$download$712$835.estimateId,G=A.$jscomp$loop$prop$download$712$835.isInitSegment,D=function(H){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=H.$jscomp$loop$prop$download$712$835.ref;L=shaka.offline.DownloadInfo.idForSegmentRef(M);l[L]=K[0];m+=J.byteLength;O.jumpToEnd()})}}(A),
|
|
2214
|
+
d.queue(A.$jscomp$loop$prop$download$712$835.groupId,I,C,G,D);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}),
|
|
2214
2215
|
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_(),u=l,w=m,l={},m=0,x.yield(shaka.offline.Storage.assignSegmentsToManifest(f,b,c,u,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);
|
|
2215
2216
|
break;case 2:return t=x.enterCatchBlock(),v=Object.values(l),x.yield(f.removeSegments(v,function(y){}),10);case 10:throw t;}})};
|
|
2216
2217
|
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)}})};
|
|
@@ -2321,7 +2322,7 @@ shaka.polyfill.PatchedMediaKeysApple.MediaKeySession.prototype.onWebkitKeyError_
|
|
|
2321
2322
|
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};
|
|
2322
2323
|
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_};
|
|
2323
2324
|
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.")};
|
|
2324
|
-
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};
|
|
2325
|
+
shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap.prototype.values=function(){goog.asserts.assert(!1,"Not used! Provided only for the compiler.")};shaka.polyfill.PatchedMediaKeysNop=function(){};
|
|
2325
2326
|
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=
|
|
2326
2327
|
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."))};
|
|
2327
2328
|
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);
|
|
@@ -2429,8 +2430,8 @@ shaka.text.VttTextParser.parseStyle_=function(a,b){if((1!=a.length||a[0])&&!/^NO
|
|
|
2429
2430
|
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)}}};
|
|
2430
2431
|
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();
|
|
2431
2432
|
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};
|
|
2432
|
-
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=
|
|
2433
|
-
b,c)}else shaka.log.warning("The cue's markup could not be parsed: ",a),b.payload=d.htmlUnescape_(a)};
|
|
2433
|
+
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=
|
|
2434
|
+
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)};
|
|
2434
2435
|
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=
|
|
2435
2436
|
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};
|
|
2436
2437
|
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};
|
|
@@ -2471,8 +2472,8 @@ shaka.text.SrtTextParser.convertSrtCue_=function(a){a=a.split(/\n/);a[0].match(/
|
|
|
2471
2472
|
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);
|
|
2472
2473
|
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){};
|
|
2473
2474
|
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=
|
|
2474
|
-
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$
|
|
2475
|
-
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$
|
|
2475
|
+
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$837:d.$jscomp$loop$prop$styleName$837},f=g.next())if(f=f.value,!/^\s*;/.test(f)&&(h=b.lineParts_.exec(f)))if(f=h[1].trim(),
|
|
2476
|
+
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$837=f.Style;(f=a.find(function(m){return function(n){return n.Name==m.$jscomp$loop$prop$styleName$837}}(d)))&&b.addStyle_(h,f);e.push(h)}return e};
|
|
2476
2477
|
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,
|
|
2477
2478
|
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=
|
|
2478
2479
|
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};
|