shaka-player 4.10.8 → 4.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/locales.js +37 -37
- package/dist/shaka-player.compiled.d.ts +5 -0
- package/dist/shaka-player.compiled.debug.d.ts +5 -0
- package/dist/shaka-player.compiled.debug.externs.js +16 -0
- package/dist/shaka-player.compiled.debug.js +40 -37
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +16 -0
- package/dist/shaka-player.compiled.js +146 -142
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +5 -0
- package/dist/shaka-player.ui.debug.d.ts +5 -0
- package/dist/shaka-player.ui.debug.externs.js +16 -0
- package/dist/shaka-player.ui.debug.js +45 -42
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +16 -0
- package/dist/shaka-player.ui.js +147 -143
- package/dist/shaka-player.ui.map +3 -3
- package/externs/shaka/ads.js +5 -0
- package/lib/ads/client_side_ad.js +8 -0
- package/lib/ads/interstitial_ad.js +7 -0
- package/lib/ads/interstitial_ad_manager.js +8 -6
- package/lib/ads/media_tailor_ad.js +7 -0
- package/lib/ads/server_side_ad.js +7 -0
- package/lib/media/streaming_engine.js +7 -6
- package/lib/player.js +2 -2
- package/lib/text/ui_text_displayer.js +37 -10
- package/package.json +1 -1
- package/ui/seek_bar.js +1 -1
- package/ui/skip_ad_button.js +1 -1
|
@@ -754,6 +754,7 @@ declare namespace shaka.ads {
|
|
|
754
754
|
isMuted ( ) : any ;
|
|
755
755
|
isPaused ( ) : any ;
|
|
756
756
|
isSkippable ( ) : any ;
|
|
757
|
+
needsSkipUI ( ) : any ;
|
|
757
758
|
pause ( ) : any ;
|
|
758
759
|
play ( ) : any ;
|
|
759
760
|
release ( ) : any ;
|
|
@@ -791,6 +792,7 @@ declare namespace shaka.ads {
|
|
|
791
792
|
isMuted ( ) : any ;
|
|
792
793
|
isPaused ( ) : any ;
|
|
793
794
|
isSkippable ( ) : any ;
|
|
795
|
+
needsSkipUI ( ) : any ;
|
|
794
796
|
pause ( ) : any ;
|
|
795
797
|
play ( ) : any ;
|
|
796
798
|
release ( ) : any ;
|
|
@@ -828,6 +830,7 @@ declare namespace shaka.ads {
|
|
|
828
830
|
isMuted ( ) : any ;
|
|
829
831
|
isPaused ( ) : any ;
|
|
830
832
|
isSkippable ( ) : any ;
|
|
833
|
+
needsSkipUI ( ) : any ;
|
|
831
834
|
pause ( ) : any ;
|
|
832
835
|
play ( ) : any ;
|
|
833
836
|
release ( ) : any ;
|
|
@@ -865,6 +868,7 @@ declare namespace shaka.ads {
|
|
|
865
868
|
isMuted ( ) : any ;
|
|
866
869
|
isPaused ( ) : any ;
|
|
867
870
|
isSkippable ( ) : any ;
|
|
871
|
+
needsSkipUI ( ) : any ;
|
|
868
872
|
pause ( ) : any ;
|
|
869
873
|
play ( ) : any ;
|
|
870
874
|
release ( ) : any ;
|
|
@@ -4756,6 +4760,7 @@ declare namespace shaka.extern {
|
|
|
4756
4760
|
isMuted ( ) : boolean ;
|
|
4757
4761
|
isPaused ( ) : boolean ;
|
|
4758
4762
|
isSkippable ( ) : boolean ;
|
|
4763
|
+
needsSkipUI ( ) : boolean ;
|
|
4759
4764
|
pause ( ) : any ;
|
|
4760
4765
|
play ( ) : any ;
|
|
4761
4766
|
resize (width : number , height : number ) : any ;
|
|
@@ -754,6 +754,7 @@ declare namespace shaka.ads {
|
|
|
754
754
|
isMuted ( ) : any ;
|
|
755
755
|
isPaused ( ) : any ;
|
|
756
756
|
isSkippable ( ) : any ;
|
|
757
|
+
needsSkipUI ( ) : any ;
|
|
757
758
|
pause ( ) : any ;
|
|
758
759
|
play ( ) : any ;
|
|
759
760
|
release ( ) : any ;
|
|
@@ -791,6 +792,7 @@ declare namespace shaka.ads {
|
|
|
791
792
|
isMuted ( ) : any ;
|
|
792
793
|
isPaused ( ) : any ;
|
|
793
794
|
isSkippable ( ) : any ;
|
|
795
|
+
needsSkipUI ( ) : any ;
|
|
794
796
|
pause ( ) : any ;
|
|
795
797
|
play ( ) : any ;
|
|
796
798
|
release ( ) : any ;
|
|
@@ -828,6 +830,7 @@ declare namespace shaka.ads {
|
|
|
828
830
|
isMuted ( ) : any ;
|
|
829
831
|
isPaused ( ) : any ;
|
|
830
832
|
isSkippable ( ) : any ;
|
|
833
|
+
needsSkipUI ( ) : any ;
|
|
831
834
|
pause ( ) : any ;
|
|
832
835
|
play ( ) : any ;
|
|
833
836
|
release ( ) : any ;
|
|
@@ -865,6 +868,7 @@ declare namespace shaka.ads {
|
|
|
865
868
|
isMuted ( ) : any ;
|
|
866
869
|
isPaused ( ) : any ;
|
|
867
870
|
isSkippable ( ) : any ;
|
|
871
|
+
needsSkipUI ( ) : any ;
|
|
868
872
|
pause ( ) : any ;
|
|
869
873
|
play ( ) : any ;
|
|
870
874
|
release ( ) : any ;
|
|
@@ -4756,6 +4760,7 @@ declare namespace shaka.extern {
|
|
|
4756
4760
|
isMuted ( ) : boolean ;
|
|
4757
4761
|
isPaused ( ) : boolean ;
|
|
4758
4762
|
isSkippable ( ) : boolean ;
|
|
4763
|
+
needsSkipUI ( ) : boolean ;
|
|
4759
4764
|
pause ( ) : any ;
|
|
4760
4765
|
play ( ) : any ;
|
|
4761
4766
|
resize (width : number , height : number ) : any ;
|
|
@@ -3900,6 +3900,10 @@ shaka.ads.ClientSideAd = class {
|
|
|
3900
3900
|
* @param {HTMLMediaElement} video
|
|
3901
3901
|
*/
|
|
3902
3902
|
constructor(imaAd, imaAdManager, video) {}
|
|
3903
|
+
/**
|
|
3904
|
+
* @override
|
|
3905
|
+
*/
|
|
3906
|
+
needsSkipUI() {}
|
|
3903
3907
|
/**
|
|
3904
3908
|
* @override
|
|
3905
3909
|
*/
|
|
@@ -4215,6 +4219,10 @@ shaka.ads.InterstitialAd = class {
|
|
|
4215
4219
|
* @param {number} adPosition
|
|
4216
4220
|
*/
|
|
4217
4221
|
constructor(video, isSkippable, onSkip, sequenceLength, adPosition) {}
|
|
4222
|
+
/**
|
|
4223
|
+
* @override
|
|
4224
|
+
*/
|
|
4225
|
+
needsSkipUI() {}
|
|
4218
4226
|
/**
|
|
4219
4227
|
* @override
|
|
4220
4228
|
*/
|
|
@@ -4347,6 +4355,10 @@ shaka.ads.MediaTailorAd = class {
|
|
|
4347
4355
|
* @param {HTMLMediaElement} video
|
|
4348
4356
|
*/
|
|
4349
4357
|
constructor(mediaTailorAd, adPosition, totalAds, isLinear, video) {}
|
|
4358
|
+
/**
|
|
4359
|
+
* @override
|
|
4360
|
+
*/
|
|
4361
|
+
needsSkipUI() {}
|
|
4350
4362
|
/**
|
|
4351
4363
|
* @override
|
|
4352
4364
|
*/
|
|
@@ -4477,6 +4489,10 @@ shaka.ads.ServerSideAd = class {
|
|
|
4477
4489
|
* @param {HTMLMediaElement} video
|
|
4478
4490
|
*/
|
|
4479
4491
|
constructor(imaAd, video) {}
|
|
4492
|
+
/**
|
|
4493
|
+
* @override
|
|
4494
|
+
*/
|
|
4495
|
+
needsSkipUI() {}
|
|
4480
4496
|
/**
|
|
4481
4497
|
* @override
|
|
4482
4498
|
*/
|
|
@@ -335,9 +335,9 @@ shaka.ui.Locales.addTo=function(a){a.insert("ar",new Map([["AD_DURATION","\u0645
|
|
|
335
335
|
"\u81ea\u52d5"],["BACK","\u8fd4\u56de"],["CAPTIONS","\u5b57\u5e55"],["CAST","\u6295\u653e..."],["ENTER_LOOP_MODE","\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["ENTER_PICTURE_IN_PICTURE","\u9032\u5165\u5b50\u6bcd\u756b\u9762"],["EXIT_FULL_SCREEN","\u9000\u51fa\u5168\u87a2\u5e55\u6a21\u5f0f"],["EXIT_LOOP_MODE","\u505c\u6b62\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["EXIT_PICTURE_IN_PICTURE","\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN",
|
|
336
336
|
"\u5168\u87a2\u5e55"],["LANGUAGE","\u8a9e\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u74b0\u64ad\u653e"],["MORE_SETTINGS","\u986f\u793a\u66f4\u591a\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u7a2e\u8a9e\u8a00"],["MUTE","\u975c\u97f3"],["NOT_APPLICABLE","\u4e0d\u9069\u7528"],["OFF","\u95dc\u9589"],["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["RESOLUTION","\u89e3\u6790\u5ea6"],
|
|
337
337
|
["REWIND","\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]))};
|
|
338
|
-
shaka.ui.Locales.Ids={MORE_SETTINGS:"MORE_SETTINGS",
|
|
339
|
-
|
|
340
|
-
|
|
338
|
+
shaka.ui.Locales.Ids={UNDETERMINED_LANGUAGE:"UNDETERMINED_LANGUAGE",MORE_SETTINGS:"MORE_SETTINGS",SURROUND:"SURROUND",AD_PROGRESS:"AD_PROGRESS",STATISTICS:"STATISTICS",LOOP:"LOOP",OFF:"OFF",SEEK:"SEEK",PLAY:"PLAY",MUTE:"MUTE",SUBTITLE_FORCED:"SUBTITLE_FORCED",BACK:"BACK",PICTURE_IN_PICTURE:"PICTURE_IN_PICTURE",SKIP_AD:"SKIP_AD",ENTER_PICTURE_IN_PICTURE:"ENTER_PICTURE_IN_PICTURE",AD_STATISTICS:"AD_STATISTICS",CAPTIONS:"CAPTIONS",LIVE:"LIVE",PAUSE:"PAUSE",UNRECOGNIZED_LANGUAGE:"UNRECOGNIZED_LANGUAGE",
|
|
339
|
+
EXIT_LOOP_MODE:"EXIT_LOOP_MODE",AD_TIME:"AD_TIME",UNMUTE:"UNMUTE",RECENTER_VR:"RECENTER_VR",RESOLUTION:"RESOLUTION",EXIT_PICTURE_IN_PICTURE:"EXIT_PICTURE_IN_PICTURE",FAST_FORWARD:"FAST_FORWARD",NOT_APPLICABLE:"NOT_APPLICABLE",REWIND:"REWIND",DOWNLOAD_VIDEO_FRAME:"DOWNLOAD_VIDEO_FRAME",AD_DURATION:"AD_DURATION",MULTIPLE_LANGUAGES:"MULTIPLE_LANGUAGES",REPLAY:"REPLAY",ON:"ON",PLAYBACK_RATE:"PLAYBACK_RATE",AUTO_QUALITY:"AUTO_QUALITY",QUALITY:"QUALITY",LANGUAGE:"LANGUAGE",AIRPLAY:"AIRPLAY",CAST:"CAST",
|
|
340
|
+
SKIP_TO_LIVE:"SKIP_TO_LIVE",VOLUME:"VOLUME",TOGGLE_STEREOSCOPIC:"TOGGLE_STEREOSCOPIC",FULL_SCREEN:"FULL_SCREEN",EXIT_FULL_SCREEN:"EXIT_FULL_SCREEN",ENTER_LOOP_MODE:"ENTER_LOOP_MODE"};shaka.abr={};shaka.abr.Ewma=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a);this.totalWeight_=this.estimate_=0};shaka.abr.Ewma.prototype.updateAlpha=function(a){goog.asserts.assert(0<a,"expected halfLife to be positive");this.alpha_=Math.exp(Math.log(.5)/a)};shaka.abr.Ewma.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);b=b*(1-c)+c*this.estimate_;isNaN(b)||(this.estimate_=b,this.totalWeight_+=a)};
|
|
341
341
|
shaka.abr.Ewma.prototype.getEstimate=function(){return this.estimate_/(1-Math.pow(this.alpha_,this.totalWeight_))};shaka.abr.EwmaBandwidthEstimator=function(){this.fast_=new shaka.abr.Ewma(2);this.slow_=new shaka.abr.Ewma(5);this.bytesSampled_=0;this.minTotalBytes_=128E3;this.minBytes_=16E3};shaka.abr.EwmaBandwidthEstimator.prototype.configure=function(a){this.minTotalBytes_=a.minTotalBytes;this.minBytes_=a.minBytes;this.fast_.updateAlpha(a.fastHalfLife);this.slow_.updateAlpha(a.slowHalfLife)};
|
|
342
342
|
shaka.abr.EwmaBandwidthEstimator.prototype.sample=function(a,b){if(!(b<this.minBytes_)){var c=8E3*b/a;a/=1E3;this.bytesSampled_+=b;this.fast_.sample(a,c);this.slow_.sample(a,c)}};shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate=function(a){return this.bytesSampled_<this.minTotalBytes_?a:Math.min(this.fast_.getEstimate(),this.slow_.getEstimate())};shaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate=function(){return this.bytesSampled_>=this.minTotalBytes_};shaka.util.EventManager=function(){this.bindingMap_=new shaka.util.MultiMap};shaka.util.EventManager.prototype.release=function(){this.removeAll();this.bindingMap_=null};shaka.util.EventManager.prototype.listen=function(a,b,c,d){this.bindingMap_&&(a=new shaka.util.EventManager.Binding_(a,b,c,d),this.bindingMap_.push(b,a))};shaka.util.EventManager.prototype.listenOnce=function(a,b,c,d){var e=this,f=function(g){e.unlisten(a,b,f);c(g)};this.listen(a,b,f,d)};
|
|
343
343
|
shaka.util.EventManager.prototype.unlisten=function(a,b,c){if(this.bindingMap_){var d=this.bindingMap_.get(b)||[];d=$jscomp.makeIterator(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.unlisten(),this.bindingMap_.remove(b,e))}};shaka.util.EventManager.prototype.removeAll=function(){if(this.bindingMap_){var a=this.bindingMap_.getAll();a=$jscomp.makeIterator(a);for(var b=a.next();!b.done;b=a.next())b.value.unlisten();this.bindingMap_.clear()}};
|
|
@@ -1114,9 +1114,9 @@ shaka.media.StreamingEngine.prototype.append_=function(a,b,c,d,e,f){f=void 0===f
|
|
|
1114
1114
|
(q=d.initSegmentReference.timescale);r=p&&q&&c.type===shaka.util.ManifestParserUtils.ContentType.VIDEO&&g.manifest_.type==shaka.media.ManifestParser.DASH&&g.config_.shouldFixTimestampOffset;if(m||n||r)l=new shaka.util.Mp4Parser;m&&l.fullBox("emsg",function(u){return g.parseEMSG_(d,c.emsgSchemeIdUris,u)});n&&l.fullBox("prft",function(u){return g.parsePrft_(d,u)});r&&l.box("moof",shaka.util.Mp4Parser.children).box("traf",shaka.util.Mp4Parser.children).fullBox("tfdt",function(u){var x,v,z,B,A,D;return $jscomp.asyncExecutePromiseGeneratorProgram(function(H){goog.asserts.assert(null!=
|
|
1115
1115
|
u.version,"TFDT is a full box and should have a valid version.");x=shaka.util.Mp4BoxParsers.parseTFDTInaccurate(u.reader,u.version);v=x.baseMediaDecodeTime;if(!v)return H.return();goog.asserts.assert("number"==typeof q,"Should be an number!");z=-v/q;B=Number(a.lastTimestampOffset)||0;if(!(B<z))return H.jumpTo(0);A=a.lastAppendWindowStart;D=a.lastAppendWindowEnd;goog.asserts.assert("number"==typeof A,"Should be an number!");goog.asserts.assert("number"==typeof D,"Should be an number!");return H.yield(g.setProperties_(a,
|
|
1116
1116
|
z,A,D,d),0)})});(m||n||r)&&l.parse(e,!1,f);return w.yield(g.evict_(a,b),2);case 2:return g.destroyer_.ensureNotDestroyed(),t=a.seeked,a.seeked=!1,y=a.adaptation,a.adaptation=!1,w.yield(g.playerInterface_.beforeAppendSegment(a.type,e),3);case 3:return w.yield(g.playerInterface_.mediaSourceEngine.appendBuffer(a.type,e,d,c,k,t,y,f),4);case 4:g.destroyer_.ensureNotDestroyed(),shaka.log.v2(h,"appended media segment"),w.jumpToEnd()}})};
|
|
1117
|
-
shaka.media.StreamingEngine.prototype.parseEMSG_=function(a,b,c){if(0===c.version){var d=c.reader.readTerminatedString();var e=c.reader.readTerminatedString();var f=c.reader.readUint32();var g=c.reader.readUint32();var h=c.reader.readUint32();var k=c.reader.readUint32();var l=a.startTime+g/f}else f=c.reader.readUint32(),l=c.reader.readUint64()/f+a.timestampOffset,g=l-a.startTime,h=c.reader.readUint32(),k=c.reader.readUint32(),d=c.reader.readTerminatedString(),e=c.reader.readTerminatedString();
|
|
1118
|
-
c.reader.getPosition());if(b&&b.includes(d)||this.config_.dispatchAllEmsgBoxes)if("urn:mpeg:dash:event:2012"==d)this.playerInterface_.onManifestUpdate();else if(f={startTime:l,endTime:
|
|
1119
|
-
d)&&(d=shaka.util.Id3Utils.getID3Frames(
|
|
1117
|
+
shaka.media.StreamingEngine.prototype.parseEMSG_=function(a,b,c){if(0===c.version){var d=c.reader.readTerminatedString();var e=c.reader.readTerminatedString();var f=c.reader.readUint32();var g=c.reader.readUint32();var h=c.reader.readUint32();var k=c.reader.readUint32();var l=a.startTime+g/f}else f=c.reader.readUint32(),l=c.reader.readUint64()/f+a.timestampOffset,g=l-a.startTime,h=c.reader.readUint32(),k=c.reader.readUint32(),d=c.reader.readTerminatedString(),e=c.reader.readTerminatedString();a=c.reader.readBytes(c.reader.getLength()-
|
|
1118
|
+
c.reader.getPosition());if(b&&b.includes(d)||this.config_.dispatchAllEmsgBoxes)if("urn:mpeg:dash:event:2012"==d)this.playerInterface_.onManifestUpdate();else if(b=l+h/f,k={startTime:l,endTime:b,schemeIdUri:d,value:e,timescale:f,presentationTimeDelta:g,eventDuration:h,id:k,messageData:a},f=shaka.util.FakeEvent.EventName.Emsg,k=(new Map).set("detail",k),f=new shaka.util.FakeEvent(f,k),f.cancelable=!0,this.playerInterface_.onEvent(f),!f.defaultPrevented&&("https://aomedia.org/emsg/ID3"==d||"https://developer.apple.com/streaming/emsg-id3"==
|
|
1119
|
+
d)&&(d=shaka.util.Id3Utils.getID3Frames(a),d.length))this.playerInterface_.onMetadata([{cueTime:l,data:a,frames:d,dts:l,pts:l}],0,b)};
|
|
1120
1120
|
shaka.media.StreamingEngine.prototype.parsePrft_=function(a,b){if(!this.parsedPrftEventRaised_&&a.initSegmentReference.timescale){goog.asserts.assert(0==b.version||1==b.version,"PRFT version can only be 0 or 1");b=shaka.util.Mp4BoxParsers.parsePRFTInaccurate(b.reader,b.version);a=a.initSegmentReference.timescale;var c=this.convertNtp(b.ntpTimestamp);a={wallClockTime:c,programStartDate:new Date(c-b.mediaTime/a*1E3)};b=shaka.util.FakeEvent.EventName.Prft;a=(new Map).set("detail",a);b=new shaka.util.FakeEvent(b,
|
|
1121
1121
|
a);this.playerInterface_.onEvent(b);this.parsedPrftEventRaised_=!0}};shaka.media.StreamingEngine.prototype.convertNtp=function(a){var b=new Date(Date.UTC(1900,0,1,0,0,0));return(new Date(b.getTime()+a)).getTime()};
|
|
1122
1122
|
shaka.media.StreamingEngine.prototype.evict_=function(a,b){var c=this,d,e,f,g,h;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress){d=shaka.media.StreamingEngine.logPrefix_(a);shaka.log.v2(d,"checking buffer length");e=Math.max(c.config_.bufferBehind,c.manifest_.presentationTimeline.getMaxSegmentDuration());f=c.playerInterface_.mediaSourceEngine.bufferStart(a.type);if(null==f)return shaka.log.v2(d,"buffer behind okay because nothing buffered:","presentationTime="+b,
|
|
@@ -1257,11 +1257,12 @@ shaka.text.UITextDisplayer.prototype.computeCuePositionAlignment_=function(a){va
|
|
|
1257
1257
|
b.positionAlign.CENTER};
|
|
1258
1258
|
shaka.text.UITextDisplayer.prototype.setCaptionStyles_=function(a,b,c,d){var e=shaka.text.Cue,f=a.style,g=0==b.nestedCues.length,h=1<c.length;f.whiteSpace="pre-wrap";var k=b.payload.replace(/\s+$/g,function(m){return"\u00a0".repeat(m.length)});f.webkitTextStrokeColor=b.textStrokeColor;f.webkitTextStrokeWidth=b.textStrokeWidth;f.color=b.color;f.direction=b.direction;f.opacity=b.opacity;f.paddingLeft=shaka.text.UITextDisplayer.convertLengthValue_(b.linePadding,b,this.videoContainer_);f.paddingRight=
|
|
1259
1259
|
shaka.text.UITextDisplayer.convertLengthValue_(b.linePadding,b,this.videoContainer_);f.textCombineUpright=b.textCombineUpright;f.textShadow=b.textShadow;if(b.backgroundImage)f.backgroundImage="url('"+b.backgroundImage+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",b.backgroundColor&&(f.backgroundColor=b.backgroundColor),f.width="100%",f.height="100%";else{if(b.nestedCues.length)var l=a;else l=shaka.util.Dom.createHTMLElement("span"),a.appendChild(l);b.border&&
|
|
1260
|
-
(l.style.border=b.border);!d&&((a=shaka.text.UITextDisplayer.inheritProperty_(c,function(m){return m.backgroundColor}))?l.style.backgroundColor=a:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"),a=shaka.text.UITextDisplayer.inheritProperty_(c,function(m){return m.fontFamily}))&&(l.style.fontFamily=a);k&&(l.textContent=k)}h&&!c[c.length-1].isContainer
|
|
1261
|
-
b.displayAlign==e.displayAlign.CENTER?"center":"flex-end"
|
|
1262
|
-
(
|
|
1263
|
-
(b.
|
|
1264
|
-
f.
|
|
1260
|
+
(l.style.border=b.border);!d&&((a=shaka.text.UITextDisplayer.inheritProperty_(c,function(m){return m.backgroundColor}))?l.style.backgroundColor=a:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"),a=shaka.text.UITextDisplayer.inheritProperty_(c,function(m){return m.fontFamily}))&&(l.style.fontFamily=a);k&&(l.textContent=k)}if(h&&!c[c.length-1].isContainer)f.display="inline";else{f.display="flex";f.flexDirection="column";f.alignItems="center";if(b.textAlign==e.textAlign.LEFT||b.textAlign==e.textAlign.START)f.width=
|
|
1261
|
+
"100%",f.alignItems="start";else if(b.textAlign==e.textAlign.RIGHT||b.textAlign==e.textAlign.END)f.width="100%",f.alignItems="end";f.justifyContent=b.displayAlign==e.displayAlign.BEFORE?"flex-start":b.displayAlign==e.displayAlign.CENTER?"center":"flex-end"}g||(f.margin="0");f.fontFamily=b.fontFamily;f.fontWeight=b.fontWeight.toString();f.fontStyle=b.fontStyle;f.letterSpacing=b.letterSpacing;f.fontSize=shaka.text.UITextDisplayer.convertLengthValue_(b.fontSize,b,this.videoContainer_);c=b.line;null!=
|
|
1262
|
+
c&&(g=b.lineInterpretation,g==e.lineInterpretation.LINE_NUMBER&&(g=e.lineInterpretation.PERCENTAGE,h=16,this.aspectRatio_&&1>this.aspectRatio_&&(h=32),c=0>c?100+c/h*100:c/h*100),g==e.lineInterpretation.PERCENTAGE&&(f.position="absolute",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.width="100%",b.lineAlign==e.lineAlign.START?f.top=c+"%":b.lineAlign==e.lineAlign.END&&(f.bottom=100-c+"%")):b.writingMode==e.writingMode.VERTICAL_LEFT_TO_RIGHT?(f.height="100%",b.lineAlign==e.lineAlign.START?
|
|
1263
|
+
f.left=c+"%":b.lineAlign==e.lineAlign.END&&(f.right=100-c+"%")):(f.height="100%",b.lineAlign==e.lineAlign.START?f.right=c+"%":b.lineAlign==e.lineAlign.END&&(f.left=100-c+"%"))));f.lineHeight=b.lineHeight;c=this.computeCuePositionAlignment_(b);c==e.positionAlign.LEFT?(f.cssFloat="left",null!==b.position&&(f.position="absolute",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.left=b.position+"%",f.width="auto"):f.top=b.position+"%")):c==e.positionAlign.RIGHT?(f.cssFloat="right",null!==b.position&&
|
|
1264
|
+
(f.position="absolute",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.right=b.position+"%",f.width="auto"):f.bottom=b.position+"%")):null!==b.position&&50!=b.position&&(f.position="absolute",b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?(f.left=b.position+"%",f.width="auto"):f.top=b.position+"%");f.textAlign=b.textAlign;f.textDecoration=b.textDecoration.join(" ");f.writingMode=b.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==b.writingMode||(f.webkitWritingMode=
|
|
1265
|
+
b.writingMode);b.size&&(b.writingMode==e.writingMode.HORIZONTAL_TOP_TO_BOTTOM?f.width=b.size+"%":f.height=b.size+"%")};shaka.text.UITextDisplayer.getLengthValueInfo_=function(a){return(a=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(a[1]),unit:a[2]}:null};
|
|
1265
1266
|
shaka.text.UITextDisplayer.convertLengthValue_=function(a,b,c){var d=shaka.text.UITextDisplayer.getLengthValueInfo_(a);if(!d)return a;var e=d.value;switch(d.unit){case "%":return shaka.text.UITextDisplayer.getAbsoluteLengthInPixels_(e/100,b,c);case "c":return shaka.text.UITextDisplayer.getAbsoluteLengthInPixels_(e,b,c);default:return a}};shaka.text.UITextDisplayer.getAbsoluteLengthInPixels_=function(a,b,c){return c.clientHeight*a/b.cellResolution.rows+"px"};
|
|
1266
1267
|
shaka.text.UITextDisplayer.inheritProperty_=function(a,b){for(var c=a.length-1;0<=c;c--){var d=b(a[c]);if(d||0===d)return d}return null};goog.exportSymbol("shaka.text.UITextDisplayer",shaka.text.UITextDisplayer);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"setTextVisibility",shaka.text.UITextDisplayer.prototype.setTextVisibility);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"isTextVisible",shaka.text.UITextDisplayer.prototype.isTextVisible);
|
|
1267
1268
|
goog.exportProperty(shaka.text.UITextDisplayer.prototype,"remove",shaka.text.UITextDisplayer.prototype.remove);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"destroy",shaka.text.UITextDisplayer.prototype.destroy);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"append",shaka.text.UITextDisplayer.prototype.append);goog.exportProperty(shaka.text.UITextDisplayer.prototype,"configure",shaka.text.UITextDisplayer.prototype.configure);shaka.text.WebVttGenerator=function(){};
|
|
@@ -1392,7 +1393,7 @@ shaka.Player.prototype.processTimedMetadataSrcEqls_=function(a){var b=this;if("m
|
|
|
1392
1393
|
e.$jscomp$loop$prop$cue$1020.value);if(b.adManager_)b.adManager_.onCueMetadataChange(e.$jscomp$loop$prop$cue$1020.value);"com.apple.quicktime.HLS"==e.$jscomp$loop$prop$cue$1020.type&&null!=e.$jscomp$loop$prop$cue$1020.startTime&&(g=d.find(function(h){return function(k){return k.startTime==h.$jscomp$loop$prop$cue$1020.startTime&&k.endTime==h.$jscomp$loop$prop$cue$1020.endTime}}(e)),g||(g={startTime:e.$jscomp$loop$prop$cue$1020.startTime,endTime:e.$jscomp$loop$prop$cue$1020.endTime,values:[]},d.push(g)),
|
|
1393
1394
|
g.values.push(e.$jscomp$loop$prop$cue$1020.value))}d=$jscomp.makeIterator(d);for(e=d.next();!e.done;e=d.next())e=e.value,e.values.some(function(h){return"X-ASSET-URI"==h.key||"X-ASSET-LIST"==h.key})&&b.adManager_&&(e.values.push({key:"CUE",description:"",data:"ONCE",mimeType:null,pictureType:null}),goog.asserts.assert(b.video_,"Must have video"),b.adManager_.onInterstitialMetadata(b,b.video_,e))}});var c=(new shaka.util.Timer(function(){var d=b.getMetadataTracks_();d=$jscomp.makeIterator(d);for(var e=
|
|
1394
1395
|
d.next();!e.done;e=d.next())e.value.mode="hidden"})).tickNow().tickAfter(.5);this.cleanupOnUnload_.push(function(){c.stop()})}};
|
|
1395
|
-
shaka.Player.prototype.processTimedMetadataMediaSrc_=function(a,b,c){a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.data&&d.cueTime&&d.frames){var e=d.cueTime+b,f=c;f&&e>f&&(f=e);for(var g=$jscomp.makeIterator(d.frames),h=g.next();!h.done;h=g.next())this.dispatchMetadataEvent_(e,f,"org.id3",h.value);if(this.adManager_)this.adManager_.onHlsTimedMetadata(d,e)}};
|
|
1396
|
+
shaka.Player.prototype.processTimedMetadataMediaSrc_=function(a,b,c){a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.data&&"number"==typeof d.cueTime&&d.frames){var e=d.cueTime+b,f=c;f&&e>f&&(f=e);for(var g=$jscomp.makeIterator(d.frames),h=g.next();!h.done;h=g.next())this.dispatchMetadataEvent_(e,f,"org.id3",h.value);if(this.adManager_)this.adManager_.onHlsTimedMetadata(d,e)}};
|
|
1396
1397
|
shaka.Player.prototype.dispatchMetadataEvent_=function(a,b,c,d){goog.asserts.assert(!b||a<=b,"Metadata start time should be less or equal to the end time!");var e=shaka.util.FakeEvent.EventName.Metadata;a=(new Map).set("startTime",a).set("endTime",b).set("metadataType",c).set("payload",d);this.dispatchEvent(shaka.Player.makeEvent_(e,a))};
|
|
1397
1398
|
shaka.Player.prototype.activateChaptersTrack_=function(a){if(a&&"chapters"==a.kind){a.mode="hidden";var b=(new shaka.util.Timer(function(){a.mode="hidden"})).tickNow().tickAfter(.5);this.cleanupOnUnload_.push(function(){b.stop()})}};shaka.Player.prototype.releaseAllMutexes=function(){this.mutex_.releaseAll()};shaka.Player.prototype.createDrmEngine=function(a){return new shaka.media.DrmEngine(a)};
|
|
1398
1399
|
shaka.Player.prototype.createNetworkingEngine=function(a){var b=this;a||(a=function(){return null});var c=function(e){a()?a().addQueuedOperation(!0,e):e()},d=function(e){a()?a().dispatchEvent(e):b.dispatchEvent(e)};return new shaka.net.NetworkingEngine(function(e,f,g,h){var k=a()?a().getAbrManager():b.abrManager_;k&&k.segmentDownloaded(e,f,g,h)},function(e,f,g){var h=shaka.util.FakeEvent.EventName.DownloadHeadersReceived;f=(new Map).set("headers",e).set("request",f).set("requestType",g);d(shaka.Player.makeEvent_(h,
|
|
@@ -1573,10 +1574,10 @@ goog.exportProperty(shaka.Player.prototype,"getLoadMode",shaka.Player.prototype.
|
|
|
1573
1574
|
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,"destroyAllPreloads",shaka.Player.prototype.destroyAllPreloads);goog.exportProperty(shaka.Player.prototype,"preload",shaka.Player.prototype.preload);goog.exportProperty(shaka.Player.prototype,"detachAndSavePreload",shaka.Player.prototype.detachAndSavePreload);
|
|
1574
1575
|
goog.exportProperty(shaka.Player.prototype,"unloadAndSavePreload",shaka.Player.prototype.unloadAndSavePreload);goog.exportProperty(shaka.Player.prototype,"load",shaka.Player.prototype.load);goog.exportProperty(shaka.Player.prototype,"updateStartTime",shaka.Player.prototype.updateStartTime);goog.exportProperty(shaka.Player.prototype,"unload",shaka.Player.prototype.unload);goog.exportProperty(shaka.Player.prototype,"detach",shaka.Player.prototype.detach);
|
|
1575
1576
|
goog.exportProperty(shaka.Player.prototype,"attachCanvas",shaka.Player.prototype.attachCanvas);goog.exportProperty(shaka.Player.prototype,"attach",shaka.Player.prototype.attach);goog.exportProperty(shaka.Player,"probeSupport",shaka.Player.probeSupport);goog.exportProperty(shaka.Player,"isBrowserSupported",shaka.Player.isBrowserSupported);goog.exportProperty(shaka.Player,"setAdManagerFactory",shaka.Player.setAdManagerFactory);goog.exportProperty(shaka.Player,"registerSupportPlugin",shaka.Player.registerSupportPlugin);
|
|
1576
|
-
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.10.
|
|
1577
|
+
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.10.9-debug";goog.exportProperty(shaka.Player,"version",shaka.Player.version);shaka.Deprecate.init(shaka.Player.version);shaka.Player.supportPlugins_={};shaka.Player.adManagerFactory_=null;
|
|
1577
1578
|
shaka.Player.TextTrackLabel="Shaka Player TextTrack";shaka.ads={};shaka.ads.AdsStats=function(){this.loadTimes_=[];this.errors_=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_++};shaka.ads.AdsStats.prototype.incrementErrors=function(){this.errors_++};
|
|
1578
|
-
shaka.ads.AdsStats.prototype.getAverageLoadTime_=function(){return this.loadTimes_.length?this.loadTimes_.reduce(function(a,b){return a+b},0)/this.loadTimes_.length:0};shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,averageLoadTime:this.getAverageLoadTime_(),started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_,errors:this.errors_}};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.
|
|
1579
|
-
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()};
|
|
1579
|
+
shaka.ads.AdsStats.prototype.getAverageLoadTime_=function(){return this.loadTimes_.length?this.loadTimes_.reduce(function(a,b){return a+b},0)/this.loadTimes_.length:0};shaka.ads.AdsStats.prototype.getBlob=function(){return{loadTimes:this.loadTimes_,averageLoadTime:this.getAverageLoadTime_(),started:this.started_,playedCompletely:this.playedCompletely_,skipped:this.skipped_,errors:this.errors_}};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.needsSkipUI=function(){return!1};
|
|
1580
|
+
shaka.ads.ClientSideAd.prototype.getDuration=function(){return this.ad_.getDuration()};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()};
|
|
1580
1581
|
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()};
|
|
1581
1582
|
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()};
|
|
1582
1583
|
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_)};
|
|
@@ -1590,7 +1591,7 @@ goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getTitle",shaka.ads.Client
|
|
|
1590
1591
|
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);
|
|
1591
1592
|
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);
|
|
1592
1593
|
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);
|
|
1593
|
-
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getDuration",shaka.ads.ClientSideAd.prototype.getDuration);shaka.ads.Utils=function(){};goog.exportSymbol("shaka.ads.Utils",shaka.ads.Utils);shaka.ads.Utils.ADS_LOADED="ads-loaded";goog.exportProperty(shaka.ads.Utils,"ADS_LOADED",shaka.ads.Utils.ADS_LOADED);shaka.ads.Utils.AD_STARTED="ad-started";goog.exportProperty(shaka.ads.Utils,"AD_STARTED",shaka.ads.Utils.AD_STARTED);shaka.ads.Utils.AD_FIRST_QUARTILE="ad-first-quartile";goog.exportProperty(shaka.ads.Utils,"AD_FIRST_QUARTILE",shaka.ads.Utils.AD_FIRST_QUARTILE);shaka.ads.Utils.AD_MIDPOINT="ad-midpoint";
|
|
1594
|
+
goog.exportProperty(shaka.ads.ClientSideAd.prototype,"getDuration",shaka.ads.ClientSideAd.prototype.getDuration);goog.exportProperty(shaka.ads.ClientSideAd.prototype,"needsSkipUI",shaka.ads.ClientSideAd.prototype.needsSkipUI);shaka.ads.Utils=function(){};goog.exportSymbol("shaka.ads.Utils",shaka.ads.Utils);shaka.ads.Utils.ADS_LOADED="ads-loaded";goog.exportProperty(shaka.ads.Utils,"ADS_LOADED",shaka.ads.Utils.ADS_LOADED);shaka.ads.Utils.AD_STARTED="ad-started";goog.exportProperty(shaka.ads.Utils,"AD_STARTED",shaka.ads.Utils.AD_STARTED);shaka.ads.Utils.AD_FIRST_QUARTILE="ad-first-quartile";goog.exportProperty(shaka.ads.Utils,"AD_FIRST_QUARTILE",shaka.ads.Utils.AD_FIRST_QUARTILE);shaka.ads.Utils.AD_MIDPOINT="ad-midpoint";
|
|
1594
1595
|
goog.exportProperty(shaka.ads.Utils,"AD_MIDPOINT",shaka.ads.Utils.AD_MIDPOINT);shaka.ads.Utils.AD_THIRD_QUARTILE="ad-third-quartile";goog.exportProperty(shaka.ads.Utils,"AD_THIRD_QUARTILE",shaka.ads.Utils.AD_THIRD_QUARTILE);shaka.ads.Utils.AD_COMPLETE="ad-complete";goog.exportProperty(shaka.ads.Utils,"AD_COMPLETE",shaka.ads.Utils.AD_COMPLETE);shaka.ads.Utils.AD_STOPPED="ad-stopped";goog.exportProperty(shaka.ads.Utils,"AD_STOPPED",shaka.ads.Utils.AD_STOPPED);shaka.ads.Utils.AD_SKIPPED="ad-skipped";
|
|
1595
1596
|
goog.exportProperty(shaka.ads.Utils,"AD_SKIPPED",shaka.ads.Utils.AD_SKIPPED);shaka.ads.Utils.AD_VOLUME_CHANGED="ad-volume-changed";goog.exportProperty(shaka.ads.Utils,"AD_VOLUME_CHANGED",shaka.ads.Utils.AD_VOLUME_CHANGED);shaka.ads.Utils.AD_MUTED="ad-muted";goog.exportProperty(shaka.ads.Utils,"AD_MUTED",shaka.ads.Utils.AD_MUTED);shaka.ads.Utils.AD_PAUSED="ad-paused";goog.exportProperty(shaka.ads.Utils,"AD_PAUSED",shaka.ads.Utils.AD_PAUSED);shaka.ads.Utils.AD_RESUMED="ad-resumed";
|
|
1596
1597
|
goog.exportProperty(shaka.ads.Utils,"AD_RESUMED",shaka.ads.Utils.AD_RESUMED);shaka.ads.Utils.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";goog.exportProperty(shaka.ads.Utils,"AD_SKIP_STATE_CHANGED",shaka.ads.Utils.AD_SKIP_STATE_CHANGED);shaka.ads.Utils.CUEPOINTS_CHANGED="ad-cue-points-changed";goog.exportProperty(shaka.ads.Utils,"CUEPOINTS_CHANGED",shaka.ads.Utils.CUEPOINTS_CHANGED);shaka.ads.Utils.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";
|
|
@@ -1621,20 +1622,21 @@ function(c){b(c,shaka.ads.Utils.ALL_ADS_COMPLETED)});this.eventManager_.listen(t
|
|
|
1621
1622
|
function(c){b(c,shaka.ads.Utils.AD_BREAK_READY)});this.eventManager_.listen(this.imaAdsManager_,google.ima.AdEvent.Type.INTERACTION,function(c){b(c,shaka.ads.Utils.AD_INTERACTION)})};
|
|
1622
1623
|
shaka.ads.ClientSideAdManager.prototype.onAdStart_=function(a){goog.asserts.assert(this.imaAdsManager_,"Should have an ads manager at this point!");var b=a.getAd();if(b){this.ad_=new shaka.ads.ClientSideAd(b,this.imaAdsManager_,this.video_);if(a.type==google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED&&!this.config_.supportsMultipleMediaElements)this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_PAUSE_REQUESTED));a=(new Map).set("ad",this.ad_).set("sdkAdObject",b).set("originalEvent",
|
|
1623
1624
|
a);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STARTED,a));this.ad_.isLinear()&&(this.adContainer_.setAttribute("ad-active","true"),this.config_.customPlayheadTracker||this.video_.pause(),this.video_.muted?this.ad_.setInitialMuted(this.video_.volume):this.ad_.setVolume(this.video_.volume))}else shaka.log.alwaysWarn("The IMA SDK fired a "+a.type+" event with no associated ad. Unable to play ad!")};
|
|
1624
|
-
shaka.ads.ClientSideAdManager.prototype.onAdComplete_=function(a){if(a&&a.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!this.config_.supportsMultipleMediaElements)this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED));this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED,(new Map).set("originalEvent",a)));this.ad_&&this.ad_.isLinear()&&(this.adContainer_.removeAttribute("ad-active"),this.config_.customPlayheadTracker||this.video_.ended||this.video_.play())};shaka.ads.InterstitialAd=function(a,b,c,d,e){this.video_=a;this.isSkippable_=b;this.onSkip_=c;this.sequenceLength_=d;this.adPosition_=e};shaka.ads.InterstitialAd.prototype.getDuration=function(){var a=this.video_.duration;return isNaN(a)?-1:a};shaka.ads.InterstitialAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};
|
|
1625
|
-
shaka.ads.InterstitialAd.prototype.
|
|
1626
|
-
shaka.ads.InterstitialAd.prototype.
|
|
1627
|
-
shaka.ads.InterstitialAd.prototype.
|
|
1628
|
-
shaka.ads.InterstitialAd.prototype.
|
|
1629
|
-
shaka.ads.InterstitialAd.prototype.getTimeOffset=function(){return 0};shaka.ads.InterstitialAd.prototype.getPodIndex=function(){return 0};shaka.ads.InterstitialAd.prototype.release=function(){this.video_=null};goog.exportSymbol("shaka.ads.InterstitialAd",shaka.ads.InterstitialAd);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"release",shaka.ads.InterstitialAd.prototype.release);
|
|
1630
|
-
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"
|
|
1631
|
-
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"
|
|
1632
|
-
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"
|
|
1633
|
-
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"
|
|
1634
|
-
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"
|
|
1635
|
-
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"
|
|
1636
|
-
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"
|
|
1637
|
-
"
|
|
1625
|
+
shaka.ads.ClientSideAdManager.prototype.onAdComplete_=function(a){if(a&&a.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!this.config_.supportsMultipleMediaElements)this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED));this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED,(new Map).set("originalEvent",a)));this.ad_&&this.ad_.isLinear()&&(this.adContainer_.removeAttribute("ad-active"),this.config_.customPlayheadTracker||this.video_.ended||this.video_.play())};shaka.ads.InterstitialAd=function(a,b,c,d,e){this.video_=a;this.isSkippable_=b;this.onSkip_=c;this.sequenceLength_=d;this.adPosition_=e};shaka.ads.InterstitialAd.prototype.needsSkipUI=function(){return!0};shaka.ads.InterstitialAd.prototype.getDuration=function(){var a=this.video_.duration;return isNaN(a)?-1:a};shaka.ads.InterstitialAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};
|
|
1626
|
+
shaka.ads.InterstitialAd.prototype.getRemainingTime=function(){var a=this.video_.duration;return isNaN(a)?-1:a-this.video_.currentTime};shaka.ads.InterstitialAd.prototype.isPaused=function(){return this.video_.paused};shaka.ads.InterstitialAd.prototype.isSkippable=function(){return this.isSkippable_};shaka.ads.InterstitialAd.prototype.getTimeUntilSkippable=function(){return this.isSkippable_?0:Math.max(this.getRemainingTime(),0)};
|
|
1627
|
+
shaka.ads.InterstitialAd.prototype.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};shaka.ads.InterstitialAd.prototype.skip=function(){this.onSkip_()};shaka.ads.InterstitialAd.prototype.pause=function(){return this.video_.pause()};shaka.ads.InterstitialAd.prototype.play=function(){return this.video_.play()};shaka.ads.InterstitialAd.prototype.getVolume=function(){return this.video_.volume};shaka.ads.InterstitialAd.prototype.setVolume=function(a){this.video_.volume=a};
|
|
1628
|
+
shaka.ads.InterstitialAd.prototype.isMuted=function(){return this.video_.muted};shaka.ads.InterstitialAd.prototype.isLinear=function(){return!0};shaka.ads.InterstitialAd.prototype.resize=function(a,b){};shaka.ads.InterstitialAd.prototype.setMuted=function(a){this.video_.muted=a};shaka.ads.InterstitialAd.prototype.getSequenceLength=function(){return this.sequenceLength_};shaka.ads.InterstitialAd.prototype.getPositionInSequence=function(){return this.adPosition_};
|
|
1629
|
+
shaka.ads.InterstitialAd.prototype.getTitle=function(){return""};shaka.ads.InterstitialAd.prototype.getDescription=function(){return""};shaka.ads.InterstitialAd.prototype.getVastMediaBitrate=function(){return 0};shaka.ads.InterstitialAd.prototype.getVastMediaHeight=function(){return 0};shaka.ads.InterstitialAd.prototype.getVastMediaWidth=function(){return 0};shaka.ads.InterstitialAd.prototype.getAdId=function(){return""};shaka.ads.InterstitialAd.prototype.getCreativeAdId=function(){return""};
|
|
1630
|
+
shaka.ads.InterstitialAd.prototype.getAdvertiserName=function(){return""};shaka.ads.InterstitialAd.prototype.getMediaUrl=function(){return null};shaka.ads.InterstitialAd.prototype.getTimeOffset=function(){return 0};shaka.ads.InterstitialAd.prototype.getPodIndex=function(){return 0};shaka.ads.InterstitialAd.prototype.release=function(){this.video_=null};goog.exportSymbol("shaka.ads.InterstitialAd",shaka.ads.InterstitialAd);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"release",shaka.ads.InterstitialAd.prototype.release);
|
|
1631
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getPodIndex",shaka.ads.InterstitialAd.prototype.getPodIndex);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getTimeOffset",shaka.ads.InterstitialAd.prototype.getTimeOffset);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getMediaUrl",shaka.ads.InterstitialAd.prototype.getMediaUrl);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getAdvertiserName",shaka.ads.InterstitialAd.prototype.getAdvertiserName);
|
|
1632
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getCreativeAdId",shaka.ads.InterstitialAd.prototype.getCreativeAdId);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getAdId",shaka.ads.InterstitialAd.prototype.getAdId);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getVastMediaWidth",shaka.ads.InterstitialAd.prototype.getVastMediaWidth);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getVastMediaHeight",shaka.ads.InterstitialAd.prototype.getVastMediaHeight);
|
|
1633
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getVastMediaBitrate",shaka.ads.InterstitialAd.prototype.getVastMediaBitrate);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getDescription",shaka.ads.InterstitialAd.prototype.getDescription);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getTitle",shaka.ads.InterstitialAd.prototype.getTitle);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getPositionInSequence",shaka.ads.InterstitialAd.prototype.getPositionInSequence);
|
|
1634
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getSequenceLength",shaka.ads.InterstitialAd.prototype.getSequenceLength);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"setMuted",shaka.ads.InterstitialAd.prototype.setMuted);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"resize",shaka.ads.InterstitialAd.prototype.resize);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"isLinear",shaka.ads.InterstitialAd.prototype.isLinear);
|
|
1635
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"isMuted",shaka.ads.InterstitialAd.prototype.isMuted);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"setVolume",shaka.ads.InterstitialAd.prototype.setVolume);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getVolume",shaka.ads.InterstitialAd.prototype.getVolume);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"play",shaka.ads.InterstitialAd.prototype.play);
|
|
1636
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"pause",shaka.ads.InterstitialAd.prototype.pause);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"skip",shaka.ads.InterstitialAd.prototype.skip);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"canSkipNow",shaka.ads.InterstitialAd.prototype.canSkipNow);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getTimeUntilSkippable",shaka.ads.InterstitialAd.prototype.getTimeUntilSkippable);
|
|
1637
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"isSkippable",shaka.ads.InterstitialAd.prototype.isSkippable);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"isPaused",shaka.ads.InterstitialAd.prototype.isPaused);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getRemainingTime",shaka.ads.InterstitialAd.prototype.getRemainingTime);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getMinSuggestedDuration",shaka.ads.InterstitialAd.prototype.getMinSuggestedDuration);
|
|
1638
|
+
goog.exportProperty(shaka.ads.InterstitialAd.prototype,"getDuration",shaka.ads.InterstitialAd.prototype.getDuration);goog.exportProperty(shaka.ads.InterstitialAd.prototype,"needsSkipUI",shaka.ads.InterstitialAd.prototype.needsSkipUI);shaka.ads.InterstitialAdManager=function(a,b,c,d){var e=this;this.adContainer_=a;this.basePlayer_=b;this.baseVideo_=c;this.adVideo_=null;this.usingBaseVideo_=!0;this.video_=this.baseVideo_;this.onEvent_=d;this.interstitialIds_=new Set;this.interstitials_=new Set;this.preloadManagerInterstitials_=new Map;this.player_=new shaka.Player;this.updatePlayerConfig_();this.eventManager_=new shaka.util.EventManager;this.adEventManager_=new shaka.util.EventManager;this.playingAd_=!1;this.lastTime_=null;this.eventManager_.listen(this.baseVideo_,
|
|
1639
|
+
"timeupdate",function(){if(!e.playingAd_){var f=null==e.lastTime_||0==e.lastTime_;e.lastTime_=e.baseVideo_.currentTime;(f=e.getCurrentInterstitial_(f))&&e.setupAd_(f,1,1,Date.now())}});this.pollTimer_=(new shaka.util.Timer(function(){var f,g,h,k,l,m,n,p,q,r;return $jscomp.asyncExecutePromiseGeneratorProgram(function(t){switch(t.nextAddress){case 1:if(!e.interstitials_.size||e.playingAd_||null==e.lastTime_){t.jumpTo(0);break}f=!1;g=Array.from(e.interstitials_);h=e.basePlayer_.seekRange();k=$jscomp.makeIterator(g);
|
|
1638
1640
|
l=k.next();case 3:if(l.done){t.jumpTo(5);break}m=l.value;n=m.endTime||m.startTime;if(!(1<=h.start-n)){p=m.startTime-e.lastTime_;0<p&&10>=p&&(e.preloadManagerInterstitials_.has(m)||e.preloadManagerInterstitials_.set(m,e.player_.preload(m.uri)));t.jumpTo(4);break}if(!e.preloadManagerInterstitials_.has(m)){t.jumpTo(7);break}return t.yield(e.preloadManagerInterstitials_.get(m),8);case 8:(q=t.yieldResult)&&q.destroy(),e.preloadManagerInterstitials_.delete(m);case 7:r=JSON.stringify(m),e.interstitialIds_.has(r)&&
|
|
1639
1641
|
e.interstitialIds_.delete(r),e.interstitials_.delete(m),f=!0;case 4:l=k.next();t.jumpTo(3);break;case 5:f&&e.cuepointsChanged_(),t.jumpToEnd()}})})).tickEvery(1)};
|
|
1640
1642
|
shaka.ads.InterstitialAdManager.prototype.configure=function(a){this.adContainer_&&this.usingBaseVideo_==a.supportsMultipleMediaElements&&((this.usingBaseVideo_=!a.supportsMultipleMediaElements)?(this.video_=this.baseVideo_,this.adVideo_&&(this.adVideo_.parentElement&&this.adContainer_.removeChild(this.adVideo_),this.adVideo_=null)):(this.adVideo_||(this.adVideo_=this.createMediaElement_()),this.video_=this.adVideo_))};
|
|
@@ -1645,24 +1647,24 @@ e.next())(g=f.value,h=JSON.stringify(g),b.interstitialIds_.has(h))||(c=!0,b.inte
|
|
|
1645
1647
|
shaka.ads.InterstitialAdManager.prototype.createMediaElement_=function(){var a=document.createElement(this.baseVideo_.tagName);a.autoplay=!0;a.style.position="absolute";a.style.top="0";a.style.left="0";a.style.width="100%";a.style.height="100%";a.style.backgroundColor="rgb(0, 0, 0)";a.setAttribute("playsinline","");return a};
|
|
1646
1648
|
shaka.ads.InterstitialAdManager.prototype.getCurrentInterstitial_=function(a,b){b=void 0===b?0:b;var c=0,d=null;if(this.interstitials_.size&&null!=this.lastTime_){var e=this.baseVideo_.ended,f=Array.from(this.interstitials_).sort(function(k,l){return l.startTime-k.startTime});f=$jscomp.makeIterator(f);for(var g=f.next();!g.done;g=f.next()){g=g.value;var h=!1;a?h=g.pre:e?h=g.post:g.pre||g.post||(h=this.lastTime_-Math.round(1E3*g.startTime)/1E3,h=0<h&&(1>=h||!g.canJump));if(h){if(c==b){d=g;break}c++}}}return d};
|
|
1647
1649
|
shaka.ads.InterstitialAdManager.prototype.setupAd_=function(a,b,c,d,e){e=void 0===e?0:e;var f=this,g,h,k,l,m,n,p,q,r,t,y,w,u,x;return $jscomp.asyncExecutePromiseGeneratorProgram(function(v){switch(v.nextAddress){case 1:goog.asserts.assert(f.video_,"Must have video");g=Date.now();!f.video_.parentElement&&f.adContainer_&&f.adContainer_.appendChild(f.video_);1==c&&1==b&&(b=Array.from(f.interstitials_).filter(function(z){return a.pre?z.pre==a.pre:a.post?z.post==a.post:.001>Math.abs(z.startTime-a.startTime)}).length);
|
|
1648
|
-
a.once
|
|
1649
|
-
3):B.jumpTo(3);h.resolve();f.adEventManager_.unlisten(f.basePlayer_,"onstatechange",k);B.jumpToEnd()})};f.adEventManager_.listen(f.basePlayer_,"onstatechange",k);return v.yield(h,2);case 2:f.usingBaseVideo_||(f.baseVideo_.pause(),null!=a.resumeOffset&&0!=a.resumeOffset&&(f.baseVideo_.currentTime+=a.resumeOffset));l=!1;m=null;n=function(){if(!f.usingBaseVideo_&&null==a.resumeOffset)if(a.timelineRange&&a.endTime)f.baseVideo_.currentTime!=a.endTime&&(f.baseVideo_.currentTime=a.endTime);
|
|
1650
|
-
f.baseVideo_.currentTime+=(z-d)/1E3;d=z}};p=function(){var z,B;return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){if(1==A.nextAddress)return n(),m&&m.stop(),goog.asserts.assert("number"==typeof e,"Should be an number!"),(z=f.getCurrentInterstitial_(a.pre,c-e))?(f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED)),f.adEventManager_.removeAll(),f.setupAd_(z,b,++c,d,e),A.jumpTo(0)):f.usingBaseVideo_?A.yield(f.player_.detach(),4):A.yield(f.player_.unload(),
|
|
1651
|
-
(B=a.resumeOffset,null==B&&(B=a.timelineRange&&a.endTime?a.endTime-(f.lastTime_||0):(Date.now()-d)/1E3),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED,(new Map).set("offset",B))));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));f.adEventManager_.removeAll();f.playingAd_=!1;f.usingBaseVideo_||(n(),f.baseVideo_.ended||f.baseVideo_.play());A.jumpToEnd()})};q=function(z){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(l)return B.return();
|
|
1650
|
+
if(a.once||a.pre)e++,f.interstitials_.delete(a),f.cuepointsChanged_();f.playingAd_=!0;if(!f.usingBaseVideo_||1!=c){v.jumpTo(2);break}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_PAUSE_REQUESTED,(new Map).set("saveLivePosition",!0)));h=new shaka.util.PublicPromise;k=function(z){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(1==B.nextAddress)return"detach"!=z.state?B.jumpTo(0):shaka.util.Platform.isSmartTV()?B.yield(new Promise(function(A){return(new shaka.util.Timer(A)).tickAfter(.1)}),
|
|
1651
|
+
3):B.jumpTo(3);h.resolve();f.adEventManager_.unlisten(f.basePlayer_,"onstatechange",k);B.jumpToEnd()})};f.adEventManager_.listen(f.basePlayer_,"onstatechange",k);return v.yield(h,2);case 2:f.usingBaseVideo_||(f.baseVideo_.pause(),null!=a.resumeOffset&&0!=a.resumeOffset&&(f.baseVideo_.currentTime+=a.resumeOffset));l=!1;m=null;n=function(){if(!f.usingBaseVideo_&&null==a.resumeOffset)if(a.timelineRange&&a.endTime&&Infinity!=a.endTime)f.baseVideo_.currentTime!=a.endTime&&(f.baseVideo_.currentTime=a.endTime);
|
|
1652
|
+
else{var z=Date.now();f.baseVideo_.currentTime+=(z-d)/1E3;d=z}};p=function(){var z,B;return $jscomp.asyncExecutePromiseGeneratorProgram(function(A){if(1==A.nextAddress)return n(),m&&m.stop(),goog.asserts.assert("number"==typeof e,"Should be an number!"),(z=f.getCurrentInterstitial_(a.pre,c-e))?(f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED)),f.adEventManager_.removeAll(),f.setupAd_(z,b,++c,d,e),A.jumpTo(0)):f.usingBaseVideo_?A.yield(f.player_.detach(),4):A.yield(f.player_.unload(),
|
|
1653
|
+
4);f.usingBaseVideo_&&(B=a.resumeOffset,null==B&&(B=a.timelineRange&&a.endTime&&Infinity!=a.endTime?a.endTime-(f.lastTime_||0):(Date.now()-d)/1E3),f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_CONTENT_RESUME_REQUESTED,(new Map).set("offset",B))));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));f.adEventManager_.removeAll();f.playingAd_=!1;f.usingBaseVideo_||(n(),f.baseVideo_.ended||f.baseVideo_.play());A.jumpToEnd()})};q=function(z){return $jscomp.asyncExecutePromiseGeneratorProgram(function(B){if(l)return B.return();
|
|
1652
1654
|
l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_ERROR,(new Map).set("originalEvent",z)));return B.yield(p(),0)})};r=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){if(1==z.nextAddress){if(l)return z.return();l=!0;return z.yield(p(),2)}f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_COMPLETE));z.jumpToEnd()})};t=function(){return $jscomp.asyncExecutePromiseGeneratorProgram(function(z){if(l)return z.return();l=!0;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIPPED));
|
|
1653
1655
|
return z.yield(p(),0)})};y=new shaka.ads.InterstitialAd(f.video_,a.isSkippable,t,b,c);f.usingBaseVideo_||(y.setMuted(f.baseVideo_.muted),y.setVolume(f.baseVideo_.volume));f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STARTED,(new Map).set("ad",y)));if(y.canSkipNow())f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED));f.adEventManager_.listenOnce(f.player_,"error",q);f.adEventManager_.listenOnce(f.player_,"firstquartile",function(){n();f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_FIRST_QUARTILE))});
|
|
1654
1656
|
f.adEventManager_.listenOnce(f.player_,"midpoint",function(){n();f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MIDPOINT))});f.adEventManager_.listenOnce(f.player_,"thirdquartile",function(){n();f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_THIRD_QUARTILE))});f.adEventManager_.listenOnce(f.player_,"complete",r);f.adEventManager_.listen(f.video_,"play",function(){f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_RESUMED))});f.adEventManager_.listen(f.video_,"pause",function(){f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_PAUSED))});
|
|
1655
1657
|
f.adEventManager_.listen(f.video_,"volumechange",function(){if(f.video_.muted)f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MUTED));else f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_VOLUME_CHANGED))});v.setCatchFinallyBlocks(4);a.playoutLimit&&(m=(new shaka.util.Timer(function(){y.skip()})).tickAfter(a.playoutLimit));f.updatePlayerConfig_();return v.yield(f.player_.attach(f.video_),6);case 6:return f.preloadManagerInterstitials_.has(a)?v.yield(f.preloadManagerInterstitials_.get(a),
|
|
1656
1658
|
10):v.yield(f.player_.load(a.uri),8);case 10:return w=v.yieldResult,f.preloadManagerInterstitials_.delete(a),w?v.yield(f.player_.load(w),8):v.yield(f.player_.load(a.uri),8);case 8:u=(Date.now()-g)/1E3;f.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.ADS_LOADED,(new Map).set("loadTime",u)));f.usingBaseVideo_&&f.baseVideo_.play();v.leaveTryBlock(0);break;case 4:x=v.enterCatchBlock(),q(x),v.jumpToEnd()}})};
|
|
1657
1659
|
shaka.ads.InterstitialAdManager.prototype.getInterstitialsInfo_=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,q,r,t,y,w,u,x,v,z,B,A,D,H,I,E,C,F,G,K,L,M;return $jscomp.asyncExecutePromiseGeneratorProgram(function(J){switch(J.nextAddress){case 1:c=[];if(!a)return J.return(c);d=a.values.find(function(N){return"X-ASSET-URI"==N.key});e=a.values.find(function(N){return"X-ASSET-LIST"==N.key});if(!d&&!e)return J.return(c);f=a.values.find(function(N){return"X-RESTRICT"==N.key});h=g=!0;f&&f.data&&(k=f.data,
|
|
1658
|
-
g=!k.includes("SKIP"),h=!k.includes("JUMP"));l=null;if(m=a.values.find(function(N){return"X-RESUME-OFFSET"==N.key}))n=m.data,l=parseFloat(n),isNaN(l)&&(l=null);p=null;if(q=a.values.find(function(N){return"X-PLAYOUT-LIMIT"==N.key}))r=q.data,p=parseFloat(r),isNaN(p)&&(p=null);w=y=t=!1;if(u=a.values.find(function(N){return"CUE"==N.key}))x=u.data,t=x.includes("ONCE"),y=x.includes("PRE"),w=x.includes("POST");v=!
|
|
1659
|
-
!m&&b.basePlayer_.isLive()&&(v=!
|
|
1660
|
+
g=!k.includes("SKIP"),h=!k.includes("JUMP"));l=null;if(m=a.values.find(function(N){return"X-RESUME-OFFSET"==N.key}))n=m.data,l=parseFloat(n),isNaN(l)&&(l=null);p=null;if(q=a.values.find(function(N){return"X-PLAYOUT-LIMIT"==N.key}))r=q.data,p=parseFloat(r),isNaN(p)&&(p=null);w=y=t=!1;if(u=a.values.find(function(N){return"CUE"==N.key}))x=u.data,t=x.includes("ONCE"),y=x.includes("PRE"),w=x.includes("POST");v=!1;(z=a.values.find(function(N){return"X-TIMELINE-OCCUPIES"==N.key}))?(B=z.data,v=B.includes("RANGE")):
|
|
1661
|
+
!m&&b.basePlayer_.isLive()&&(v=!y&&!w);if(d){A=d.data;if(!A)return J.return(c);c.push({startTime:a.startTime,endTime:a.endTime,uri:A,isSkippable:g,canJump:h,resumeOffset:l,playoutLimit:p,once:t,pre:y,post:w,timelineRange:v});J.jumpTo(2);break}if(!e){J.jumpTo(2);break}D=e.data;if(!D)return J.return(c);H=shaka.net.NetworkingEngine.RequestType.ADS;I=shaka.net.NetworkingEngine.makeRequest([D],shaka.net.NetworkingEngine.defaultRetryParameters());E=b.basePlayer_.getNetworkingEngine().request(H,I);J.setCatchFinallyBlocks(4);
|
|
1660
1662
|
return J.yield(E.promise,6);case 6:C=J.yieldResult;F=shaka.util.StringUtils.fromUTF8(C.data);G=JSON.parse(F);K=$jscomp.makeIterator(G.ASSETS);for(L=K.next();!L.done;L=K.next())M=L.value,M.URI&&c.push({startTime:a.startTime,endTime:a.endTime,uri:M.URI,isSkippable:g,canJump:h,resumeOffset:l,playoutLimit:p,once:t,pre:y,post:w,timelineRange:v});J.leaveTryBlock(2);break;case 4:J.enterCatchBlock();case 2:return J.return(c)}})};
|
|
1661
1663
|
shaka.ads.InterstitialAdManager.prototype.cuepointsChanged_=function(){for(var a=[],b={},c=$jscomp.makeIterator(this.interstitials_),d=c.next();!d.done;b={$jscomp$loop$prop$shakaCuePoint$1025:b.$jscomp$loop$prop$shakaCuePoint$1025},d=c.next())d=d.value,b.$jscomp$loop$prop$shakaCuePoint$1025={start:d.startTime,end:null},d.pre?(b.$jscomp$loop$prop$shakaCuePoint$1025.start=0,b.$jscomp$loop$prop$shakaCuePoint$1025.end=null):d.post?(b.$jscomp$loop$prop$shakaCuePoint$1025.start=-1,b.$jscomp$loop$prop$shakaCuePoint$1025.end=
|
|
1662
1664
|
null):d.timelineRange&&(b.$jscomp$loop$prop$shakaCuePoint$1025.end=d.endTime),a.find(function(e){return function(f){return e.$jscomp$loop$prop$shakaCuePoint$1025.start==f.start&&e.$jscomp$loop$prop$shakaCuePoint$1025.end==f.end}}(b))||a.push(b.$jscomp$loop$prop$shakaCuePoint$1025);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.CUEPOINTS_CHANGED,(new Map).set("cuepoints",a)))};
|
|
1663
1665
|
shaka.ads.InterstitialAdManager.prototype.updatePlayerConfig_=function(){goog.asserts.assert(this.player_,"Must have player");goog.asserts.assert(this.basePlayer_,"Must have base player");this.player_.configure(this.basePlayer_.getNonDefaultConfiguration());var a=this.player_.getNetworkingEngine();goog.asserts.assert(a,"Need networking engine");a.clearAllRequestFilters();a.clearAllResponseFilters();this.basePlayer_.getNetworkingEngine().copyFiltersInto(a)};shaka.util.TextParser=function(a){this.data_=a||"";this.position_=0};shaka.util.TextParser.prototype.atEnd=function(){return this.position_==this.data_.length};shaka.util.TextParser.prototype.readLine=function(){return this.readRegexReturnCapture_(/(.*?)(\n|$)/gm,1)};shaka.util.TextParser.prototype.readWord=function(){return this.readRegexReturnCapture_(/[^ \t\n]*/gm,0)};shaka.util.TextParser.prototype.skipWhitespace=function(){this.readRegex(/[ \t]+/gm)};
|
|
1664
1666
|
shaka.util.TextParser.prototype.readRegex=function(a){a=this.indexOf_(a);if(this.atEnd()||null==a||a.position!=this.position_)return null;this.position_+=a.length;return a.results};shaka.util.TextParser.prototype.readRegexReturnCapture_=function(a,b){return this.atEnd()?null:(a=this.readRegex(a))?a[b]:null};
|
|
1665
|
-
shaka.util.TextParser.prototype.indexOf_=function(a){goog.asserts.assert(a.global,"global flag should be set");a.lastIndex=this.position_;a=a.exec(this.data_);return null==a?null:{position:a.index,length:a[0].length,results:a}};shaka.ads.MediaTailorAd=function(a,b,c,d,e){this.ad_=a;this.skipOffset_=this.parseTime_(this.ad_.skipOffset);this.video_=e;this.adPosition_=b;this.totalAds_=c;this.isLinear_=d;this.isSkipped_=!1};shaka.ads.MediaTailorAd.prototype.getDuration=function(){return this.ad_.durationInSeconds};shaka.ads.MediaTailorAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};
|
|
1667
|
+
shaka.util.TextParser.prototype.indexOf_=function(a){goog.asserts.assert(a.global,"global flag should be set");a.lastIndex=this.position_;a=a.exec(this.data_);return null==a?null:{position:a.index,length:a[0].length,results:a}};shaka.ads.MediaTailorAd=function(a,b,c,d,e){this.ad_=a;this.skipOffset_=this.parseTime_(this.ad_.skipOffset);this.video_=e;this.adPosition_=b;this.totalAds_=c;this.isLinear_=d;this.isSkipped_=!1};shaka.ads.MediaTailorAd.prototype.needsSkipUI=function(){return!0};shaka.ads.MediaTailorAd.prototype.getDuration=function(){return this.ad_.durationInSeconds};shaka.ads.MediaTailorAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};
|
|
1666
1668
|
shaka.ads.MediaTailorAd.prototype.getRemainingTime=function(){return this.ad_.startTimeInSeconds+this.ad_.durationInSeconds-this.video_.currentTime};shaka.ads.MediaTailorAd.prototype.isPaused=function(){return this.video_.paused};shaka.ads.MediaTailorAd.prototype.isSkippable=function(){return"number"==typeof this.skipOffset_?!0:!1};
|
|
1667
1669
|
shaka.ads.MediaTailorAd.prototype.getTimeUntilSkippable=function(){if("number"!=typeof this.skipOffset_)return this.getRemainingTime();var a=this.getRemainingTime()+this.skipOffset_-this.getDuration();return Math.max(a,0)};shaka.ads.MediaTailorAd.prototype.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};shaka.ads.MediaTailorAd.prototype.skip=function(){this.isSkipped_=!0;this.video_.currentTime+=this.getRemainingTime()};shaka.ads.MediaTailorAd.prototype.pause=function(){return this.video_.pause()};
|
|
1668
1670
|
shaka.ads.MediaTailorAd.prototype.play=function(){return this.video_.play()};shaka.ads.MediaTailorAd.prototype.getVolume=function(){return this.video_.volume};shaka.ads.MediaTailorAd.prototype.setVolume=function(a){this.video_.volume=a};shaka.ads.MediaTailorAd.prototype.isMuted=function(){return this.video_.muted};shaka.ads.MediaTailorAd.prototype.isLinear=function(){return this.isLinear_};shaka.ads.MediaTailorAd.prototype.resize=function(a,b){};
|
|
@@ -1677,7 +1679,7 @@ goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getSequenceLength",shaka.
|
|
|
1677
1679
|
goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isMuted",shaka.ads.MediaTailorAd.prototype.isMuted);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"setVolume",shaka.ads.MediaTailorAd.prototype.setVolume);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getVolume",shaka.ads.MediaTailorAd.prototype.getVolume);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"play",shaka.ads.MediaTailorAd.prototype.play);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"pause",shaka.ads.MediaTailorAd.prototype.pause);
|
|
1678
1680
|
goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"skip",shaka.ads.MediaTailorAd.prototype.skip);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"canSkipNow",shaka.ads.MediaTailorAd.prototype.canSkipNow);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getTimeUntilSkippable",shaka.ads.MediaTailorAd.prototype.getTimeUntilSkippable);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isSkippable",shaka.ads.MediaTailorAd.prototype.isSkippable);
|
|
1679
1681
|
goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"isPaused",shaka.ads.MediaTailorAd.prototype.isPaused);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getRemainingTime",shaka.ads.MediaTailorAd.prototype.getRemainingTime);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getMinSuggestedDuration",shaka.ads.MediaTailorAd.prototype.getMinSuggestedDuration);goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"getDuration",shaka.ads.MediaTailorAd.prototype.getDuration);
|
|
1680
|
-
shaka.ads.MediaTailorAd.timeFormat_=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;shaka.ads.MediaTailorAdManager=function(a,b,c,d){this.adContainer_=a;this.networkingEngine_=b;this.video_=c;this.streamPromise_=null;this.streamRequestStartTime_=NaN;this.onEvent_=d;this.isLive_=!1;this.snapForwardTime_=null;this.adBreaks_=[];this.playedAds_=[];this.mediaTailorAdBreak_=this.mediaTailorAd_=this.ad_=null;this.staticResources_=new Map;this.adListeners_=[];this.eventsSent=[];this.trackingUrl_="";this.firstTrackingRequest_=!0;this.backupUrl_="";this.currentCuePoints_=[];this.eventManager_=
|
|
1682
|
+
goog.exportProperty(shaka.ads.MediaTailorAd.prototype,"needsSkipUI",shaka.ads.MediaTailorAd.prototype.needsSkipUI);shaka.ads.MediaTailorAd.timeFormat_=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;shaka.ads.MediaTailorAdManager=function(a,b,c,d){this.adContainer_=a;this.networkingEngine_=b;this.video_=c;this.streamPromise_=null;this.streamRequestStartTime_=NaN;this.onEvent_=d;this.isLive_=!1;this.snapForwardTime_=null;this.adBreaks_=[];this.playedAds_=[];this.mediaTailorAdBreak_=this.mediaTailorAd_=this.ad_=null;this.staticResources_=new Map;this.adListeners_=[];this.eventsSent=[];this.trackingUrl_="";this.firstTrackingRequest_=!0;this.backupUrl_="";this.currentCuePoints_=[];this.eventManager_=
|
|
1681
1683
|
new shaka.util.EventManager};shaka.ads.MediaTailorAdManager.prototype.streamRequest=function(a,b,c){if(this.streamPromise_)return Promise.reject(new shaka.util.Error(shaka.util.Error.Severity.RECOVERABLE,shaka.util.Error.Category.ADS,shaka.util.Error.Code.CURRENT_DAI_REQUEST_NOT_FINISHED));this.streamPromise_=new shaka.util.PublicPromise;this.requestSessionInfo_(a,b);this.backupUrl_=c||"";this.streamRequestStartTime_=Date.now()/1E3;return this.streamPromise_};
|
|
1682
1684
|
shaka.ads.MediaTailorAdManager.prototype.addTrackingUrl=function(a){this.trackingUrl_=a;this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.ADS_LOADED,(new Map).set("loadTime",0)))};
|
|
1683
1685
|
shaka.ads.MediaTailorAdManager.prototype.stop=function(){for(var a=$jscomp.makeIterator(this.adListeners_),b=a.next();!b.done;b=a.next())b=b.value,this.eventManager_.unlisten(b.target,b.type,b.listener);this.onEnded_();this.adListeners_=[];this.eventsSent=[];this.trackingUrl_="";this.firstTrackingRequest_=!0;this.backupUrl_="";this.snapForwardTime_=null;this.adBreaks_=[];this.playedAds_=[];this.staticResources_.clear()};
|
|
@@ -1712,7 +1714,7 @@ shaka.ads.MediaTailorAdManager.prototype.sendTrackingEvent_=function(a){var b=th
|
|
|
1712
1714
|
break;case shaka.ads.MediaTailorAdManager.RESUME_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_RESUMED));break;case shaka.ads.MediaTailorAdManager.PAUSE_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_PAUSED));break;case shaka.ads.MediaTailorAdManager.FIRSTQUARTILE_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_FIRST_QUARTILE));break;case shaka.ads.MediaTailorAdManager.MIDPOINT_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MIDPOINT));break;case shaka.ads.MediaTailorAdManager.THIRDQUARTILE_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_THIRD_QUARTILE));
|
|
1713
1715
|
break;case shaka.ads.MediaTailorAdManager.COMPLETE_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_COMPLETE));this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));break;case shaka.ads.MediaTailorAdManager.SKIPPED_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIPPED));this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_STOPPED));break;case shaka.ads.MediaTailorAdManager.BREAKSTART_:this.adContainer_.setAttribute("ad-active","true");break;case shaka.ads.MediaTailorAdManager.BREAKEND_:this.adContainer_.removeAttribute("ad-active");
|
|
1714
1716
|
break;case shaka.ads.MediaTailorAdManager.SKIP_STATE_CHANGED_:this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_SKIP_STATE_CHANGED))}};shaka.ads.MediaTailorAdManager.IMPRESSION_="impression";shaka.ads.MediaTailorAdManager.START_="start";shaka.ads.MediaTailorAdManager.MUTE_="mute";shaka.ads.MediaTailorAdManager.UNMUTE_="unmute";shaka.ads.MediaTailorAdManager.RESUME_="resume";shaka.ads.MediaTailorAdManager.PAUSE_="pause";shaka.ads.MediaTailorAdManager.FIRSTQUARTILE_="firstQuartile";
|
|
1715
|
-
shaka.ads.MediaTailorAdManager.MIDPOINT_="midpoint";shaka.ads.MediaTailorAdManager.THIRDQUARTILE_="thirdQuartile";shaka.ads.MediaTailorAdManager.COMPLETE_="complete";shaka.ads.MediaTailorAdManager.SKIPPED_="skip";shaka.ads.MediaTailorAdManager.BREAKSTART_="breakStart";shaka.ads.MediaTailorAdManager.BREAKEND_="breakEnd";shaka.ads.MediaTailorAdManager.SKIP_STATE_CHANGED_="skipStateChanged";shaka.ads.ServerSideAd=function(a,b){this.ad_=a;this.adProgressData_=null;this.video_=b};shaka.ads.ServerSideAd.prototype.setProgressData=function(a){this.adProgressData_=a};shaka.ads.ServerSideAd.prototype.getDuration=function(){return this.adProgressData_?this.adProgressData_.duration:-1};shaka.ads.ServerSideAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};
|
|
1717
|
+
shaka.ads.MediaTailorAdManager.MIDPOINT_="midpoint";shaka.ads.MediaTailorAdManager.THIRDQUARTILE_="thirdQuartile";shaka.ads.MediaTailorAdManager.COMPLETE_="complete";shaka.ads.MediaTailorAdManager.SKIPPED_="skip";shaka.ads.MediaTailorAdManager.BREAKSTART_="breakStart";shaka.ads.MediaTailorAdManager.BREAKEND_="breakEnd";shaka.ads.MediaTailorAdManager.SKIP_STATE_CHANGED_="skipStateChanged";shaka.ads.ServerSideAd=function(a,b){this.ad_=a;this.adProgressData_=null;this.video_=b};shaka.ads.ServerSideAd.prototype.setProgressData=function(a){this.adProgressData_=a};shaka.ads.ServerSideAd.prototype.needsSkipUI=function(){return!0};shaka.ads.ServerSideAd.prototype.getDuration=function(){return this.adProgressData_?this.adProgressData_.duration:-1};shaka.ads.ServerSideAd.prototype.getMinSuggestedDuration=function(){return this.getDuration()};
|
|
1716
1718
|
shaka.ads.ServerSideAd.prototype.getRemainingTime=function(){return this.adProgressData_?this.adProgressData_.duration-this.adProgressData_.currentTime:-1};shaka.ads.ServerSideAd.prototype.isPaused=function(){return this.video_.paused};shaka.ads.ServerSideAd.prototype.isSkippable=function(){return this.ad_.isSkippable()};shaka.ads.ServerSideAd.prototype.getTimeUntilSkippable=function(){var a=this.ad_.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)};
|
|
1717
1719
|
shaka.ads.ServerSideAd.prototype.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};shaka.ads.ServerSideAd.prototype.skip=function(){this.video_.currentTime+=this.getRemainingTime()};shaka.ads.ServerSideAd.prototype.pause=function(){return this.video_.pause()};shaka.ads.ServerSideAd.prototype.play=function(){return this.video_.play()};shaka.ads.ServerSideAd.prototype.getVolume=function(){return this.video_.volume};
|
|
1718
1720
|
shaka.ads.ServerSideAd.prototype.setVolume=function(a){this.video_.volume=a};shaka.ads.ServerSideAd.prototype.isMuted=function(){return this.video_.muted};shaka.ads.ServerSideAd.prototype.isLinear=function(){return!0};shaka.ads.ServerSideAd.prototype.resize=function(a,b){};shaka.ads.ServerSideAd.prototype.setMuted=function(a){this.video_.muted=a};shaka.ads.ServerSideAd.prototype.getSequenceLength=function(){var a=this.ad_.getAdPodInfo();return null==a?1:a.getTotalAds()};
|
|
@@ -1725,7 +1727,8 @@ goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getVastMediaBitrate",shaka
|
|
|
1725
1727
|
goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getSequenceLength",shaka.ads.ServerSideAd.prototype.getSequenceLength);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"setMuted",shaka.ads.ServerSideAd.prototype.setMuted);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"resize",shaka.ads.ServerSideAd.prototype.resize);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"isLinear",shaka.ads.ServerSideAd.prototype.isLinear);
|
|
1726
1728
|
goog.exportProperty(shaka.ads.ServerSideAd.prototype,"isMuted",shaka.ads.ServerSideAd.prototype.isMuted);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"setVolume",shaka.ads.ServerSideAd.prototype.setVolume);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getVolume",shaka.ads.ServerSideAd.prototype.getVolume);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"play",shaka.ads.ServerSideAd.prototype.play);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"pause",shaka.ads.ServerSideAd.prototype.pause);
|
|
1727
1729
|
goog.exportProperty(shaka.ads.ServerSideAd.prototype,"skip",shaka.ads.ServerSideAd.prototype.skip);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"canSkipNow",shaka.ads.ServerSideAd.prototype.canSkipNow);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getTimeUntilSkippable",shaka.ads.ServerSideAd.prototype.getTimeUntilSkippable);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"isSkippable",shaka.ads.ServerSideAd.prototype.isSkippable);
|
|
1728
|
-
goog.exportProperty(shaka.ads.ServerSideAd.prototype,"isPaused",shaka.ads.ServerSideAd.prototype.isPaused);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getRemainingTime",shaka.ads.ServerSideAd.prototype.getRemainingTime);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getMinSuggestedDuration",shaka.ads.ServerSideAd.prototype.getMinSuggestedDuration);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getDuration",shaka.ads.ServerSideAd.prototype.getDuration);
|
|
1730
|
+
goog.exportProperty(shaka.ads.ServerSideAd.prototype,"isPaused",shaka.ads.ServerSideAd.prototype.isPaused);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getRemainingTime",shaka.ads.ServerSideAd.prototype.getRemainingTime);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getMinSuggestedDuration",shaka.ads.ServerSideAd.prototype.getMinSuggestedDuration);goog.exportProperty(shaka.ads.ServerSideAd.prototype,"getDuration",shaka.ads.ServerSideAd.prototype.getDuration);
|
|
1731
|
+
goog.exportProperty(shaka.ads.ServerSideAd.prototype,"needsSkipUI",shaka.ads.ServerSideAd.prototype.needsSkipUI);shaka.ads.ServerSideAdManager=function(a,b,c,d){var e=this;this.adContainer_=a;this.video_=b;this.streamPromise_=this.config_=null;this.streamRequestStartTime_=NaN;this.onEvent_=d;this.isLiveContent_=!1;this.adProgressData_=this.ad_=this.snapForwardTime_=null;this.backupUrl_="";this.currentCuePoints_=[];this.eventManager_=new shaka.util.EventManager;a=new google.ima.dai.api.UiSettings;a.setLocale(c);this.streamManager_=new google.ima.dai.api.StreamManager(this.video_,this.adContainer_,a);this.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.IMA_STREAM_MANAGER_LOADED,
|
|
1729
1732
|
(new Map).set("imaStreamManager",this.streamManager_)));this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.LOADED,function(f){shaka.log.info("Ad SS Loaded");e.onLoaded_(f)});this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.ERROR,function(){shaka.log.info("Ad SS Error");e.onError_()});this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,function(){shaka.log.info("Ad Break Started")});this.eventManager_.listen(this.streamManager_,
|
|
1730
1733
|
google.ima.dai.api.StreamEvent.Type.STARTED,function(f){shaka.log.info("Ad Started");e.onAdStart_(f)});this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,function(){shaka.log.info("Ad Break Ended");e.onAdBreakEnded_()});this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(f){e.onAdProgress_(f)});this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){shaka.log.info("Ad event: First Quartile");
|
|
1731
1734
|
e.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_FIRST_QUARTILE))});this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){shaka.log.info("Ad event: Midpoint");e.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_MIDPOINT))});this.eventManager_.listen(this.streamManager_,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){shaka.log.info("Ad event: Third Quartile");e.onEvent_(new shaka.util.FakeEvent(shaka.ads.Utils.AD_THIRD_QUARTILE))});
|
|
@@ -3166,7 +3169,7 @@ shaka.ui.SeekBar.prototype.update=function(){var a=this.config_.seekBarColors,b=
|
|
|
3166
3169
|
g||0,a=["to right",this.makeColor_(this.config_.showUnbufferedStart?a.base:a.played,c),this.makeColor_(a.played,c),this.makeColor_(a.played,b),this.makeColor_(a.buffered,b),this.makeColor_(a.buffered,e),this.makeColor_(a.base,e)],this.container.style.background="linear-gradient("+a.join(",")+")")):shaka.ui.Utils.setDisplay(this.container,!1)};
|
|
3167
3170
|
shaka.ui.SeekBar.prototype.markAdBreaks_=function(){if(this.adCuePoints_.length){for(var a=this.player.seekRange(),b=a.end-a.start,c=["to right"],d=[],e=this.config_.seekBarColors.adBreaks,f=!1,g=$jscomp.makeIterator(this.adCuePoints_),h=g.next();!h.done;h=g.next())if(h=h.value,-1==h.start&&!h.end)f=!0;else if(!h.end&&h.start>=a.start||"number"==typeof h.end&&h.end>a.start){var k=(Math.max(h.start,a.start)-a.start)/b||0,l=k+.01;h.end&&(l=(h.end-a.start)/b||0);d.push({start:k,end:l})}d=d.sort(function(m,
|
|
3168
3171
|
n){return m.start-n.start});a=$jscomp.makeIterator(d);for(h=a.next();!h.done;h=a.next())b=h.value,c.push(this.makeColor_("transparent",b.start)),c.push(this.makeColor_(e,b.start)),c.push(this.makeColor_(e,b.end)),c.push(this.makeColor_("transparent",b.end));f&&(c.push(this.makeColor_("transparent",.99)),c.push(this.makeColor_(e,.99)));this.adMarkerContainer_.style.background="linear-gradient("+c.join(",")+")"}else this.adMarkerContainer_.style.background="transparent",this.adBreaksTimer_.stop()};
|
|
3169
|
-
shaka.ui.SeekBar.prototype.makeColor_=function(a,b){return a+" "+100*b+"%"};shaka.ui.SeekBar.prototype.onAdCuePointsChanged_=function(){var a=this
|
|
3172
|
+
shaka.ui.SeekBar.prototype.makeColor_=function(a,b){return a+" "+100*b+"%"};shaka.ui.SeekBar.prototype.onAdCuePointsChanged_=function(){var a=this,b=function(){a.markAdBreaks_();var c=a.player.seekRange();c=c.end-c.start;var d=shaka.ui.Constants.MIN_SEEK_WINDOW_TO_SHOW_SEEKBAR;a.player.isLive()&&c>d&&a.adBreaksTimer_.tickEvery(.25)};this.player.isFullyLoaded()?b():this.eventManager.listenOnce(this.player,"loaded",b)};
|
|
3170
3173
|
shaka.ui.SeekBar.prototype.shouldBeDisplayed_=function(){var a=this.player.seekRange();a=a.end-a.start;return this.player.isLive()&&a<shaka.ui.Constants.MIN_SEEK_WINDOW_TO_SHOW_SEEKBAR?!1:null==this.ad||!this.ad.isLinear()};shaka.ui.SeekBar.prototype.updateAriaLabel_=function(){this.bar.ariaLabel=this.localization.resolve(shaka.ui.Locales.Ids.SEEK)};
|
|
3171
3174
|
shaka.ui.SeekBar.prototype.showTime_=function(a,b){var c=this.timeContainer_.clientWidth;this.timeContainer_.style.width="auto";this.timeContainer_.style.height="20px";this.timeContainer_.style.top="-30px";this.timeContainer_.style.left=Math.min(this.bar.offsetWidth-c,Math.max(0,a-c/2))+"px";this.timeContainer_.style.visibility="visible";this.player.isLive()?(a=this.player.seekRange().end-b,this.timeContainer_.textContent=1>a?this.localization.resolve(shaka.ui.Locales.Ids.LIVE):"-"+this.timeFormatter_(a)):
|
|
3172
3175
|
this.timeContainer_.textContent=this.timeFormatter_(b)};
|
|
@@ -3184,7 +3187,7 @@ shaka.ui.SeekBar.Factory.prototype.create=function(a,b){return new shaka.ui.Seek
|
|
|
3184
3187
|
this.button_.disabled=!0;shaka.ui.Utils.setDisplay(this.button_,!1);this.button_.classList.add("shaka-no-propagation");this.container_.appendChild(this.button_);this.updateAriaLabel_();this.updateLocalizedStrings_();this.timer_=new shaka.util.Timer(function(){c.onTimerTick_()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_UPDATED,function(){c.updateAriaLabel_();c.updateLocalizedStrings_()});this.eventManager.listen(this.localization,shaka.ui.Localization.LOCALE_CHANGED,
|
|
3185
3188
|
function(){c.updateAriaLabel_();c.updateLocalizedStrings_()});this.eventManager.listen(this.adManager,shaka.ads.Utils.AD_STARTED,function(){c.onAdStarted_()});this.eventManager.listen(this.adManager,shaka.ads.Utils.AD_SKIP_STATE_CHANGED,function(){c.onSkipStateChanged_()});this.eventManager.listen(this.adManager,shaka.ads.Utils.AD_STOPPED,function(){c.reset_()});this.eventManager.listen(this.button_,"click",function(){c.ad.skip()});if(this.ad)this.onAdStarted_()};
|
|
3186
3189
|
$jscomp.inherits(shaka.ui.SkipAdButton,shaka.ui.Element);shaka.ui.SkipAdButton.prototype.release=function(){this.timer_.stop();this.timer_=null;shaka.ui.Element.prototype.release.call(this)};shaka.ui.SkipAdButton.prototype.updateLocalizedStrings_=function(){this.button_.textContent=this.localization.resolve(shaka.ui.Locales.Ids.SKIP_AD)};shaka.ui.SkipAdButton.prototype.updateAriaLabel_=function(){};
|
|
3187
|
-
shaka.ui.SkipAdButton.prototype.onAdStarted_=function(){this.ad.isSkippable()&&(shaka.ui.Utils.setDisplay(this.button_,!0),shaka.ui.Utils.setDisplay(this.counter_,!0),this.counter_.textContent="",this.timer_.tickNow(),this.timer_.tickEvery(.5))};
|
|
3190
|
+
shaka.ui.SkipAdButton.prototype.onAdStarted_=function(){this.ad.isSkippable()&&this.ad.needsSkipUI()&&(shaka.ui.Utils.setDisplay(this.button_,!0),shaka.ui.Utils.setDisplay(this.counter_,!0),this.counter_.textContent="",this.timer_.tickNow(),this.timer_.tickEvery(.5))};
|
|
3188
3191
|
shaka.ui.SkipAdButton.prototype.onTimerTick_=function(){goog.asserts.assert(null!=this.ad,"this.ad should exist at this point");var a=Math.round(this.ad.getTimeUntilSkippable());0<a?this.counter_.textContent=a:(this.timer_.stop(),shaka.ui.Utils.setDisplay(this.counter_,!1))};shaka.ui.SkipAdButton.prototype.onSkipStateChanged_=function(){this.ad.canSkipNow()&&(this.button_.disabled=!1,this.timer_.stop(),shaka.ui.Utils.setDisplay(this.counter_,!1))};
|
|
3189
3192
|
shaka.ui.SkipAdButton.prototype.reset_=function(){this.timer_.stop();this.button_.disabled=!0;shaka.ui.Utils.setDisplay(this.button_,!1);shaka.ui.Utils.setDisplay(this.counter_,!1)};goog.exportSymbol("shaka.ui.SkipAdButton",shaka.ui.SkipAdButton);/*
|
|
3190
3193
|
@license
|