1var PLAYER=PLAYER||{};PLAYER.Vast=function(i){this.videoPlayer=i,this.options=this.videoPlayer.options,this.vastObj={},this.objVMAP,this.arrVAST=[],this.countVasts=0,this.countXMLS=0,this.maxcountXMLS=0,this.vastADCount=0,this.allVastMediaFilesArr=[],this.allVastNonLinearArr=[],this.allVastCompanionArr=[],this.is_VAST=!1,this.is_VMAP=!1,this.allVastPREROLLS={},this.prerollsCount=0,this.allVastMIDROLLS={},this.midrollsCount=0,this.allVastPOSTROLLS={},this.postrollsCount=0,this.allVastNONLINEARS={},this.nonlinearsCount=0,""!=this.options.vastUrl&&this.loadVastUrl(this.options.vastUrl)},PLAYER.Vast.prototype={},PLAYER.Vast.prototype.loadVastUrl=function(i,e){var t=this;jQuery.ajax({type:"GET",url:i,dataType:"xml",success:function(i){t.linear=jQuery(i).find("Linear").text(),t.nonLinear=jQuery(i).find("NonLinearAds").text();var n=t.xmlToJson(i);t.vast_array=new Array,jQuery(i).find("Ad").each(function(){var i=jQuery(this).attr("id");jQuery(this).attr("offset");jQuery(this).find("InLine").each(function(){var i=jQuery(this).find("AdSystem").text(),e=jQuery(this).find("AdTitle").text(),n=jQuery(this).find("Description").text(),a=jQuery(this).find("Error").text(),r=jQuery(this).find("Impression").text();jQuery(this).find("Creatives").text();t.creative={},jQuery(this).find("Creatives").each(function(){jQuery(this).find("Creative").each(function(i){var e=jQuery(this).attr("id"),n=jQuery(this).attr("sequence");jQuery(this).find("Linear").each(function(){t.duration={},t.trackingEvents={},t.videoClicks={},t.mediaFiles={},jQuery(this).find("Duration").each(function(){t.duration=jQuery(this).text()}),t.trackingEvents={},jQuery(this).find("TrackingEvents").each(function(){t.tracking={},jQuery(this).find("Tracking").each(function(){var i=jQuery(this).attr("event"),e=jQuery(this).text();t.tracking[i]={event:i,tracking:e}}),t.trackingEvents={tracking:t.tracking}}),t.videoClicks={},jQuery(this).find("VideoClicks").each(function(){jQuery(this).find("ClickThrough").each(function(){t.clickThrough=jQuery(this).text()}),t.videoClicks={clickThrough:t.clickThrough}}),t.mediaFiles={},jQuery(this).find("MediaFiles").each(function(){jQuery(this).find("MediaFile").each(function(){t.mediaFile=jQuery(this).text()}),t.mediaFiles={mediaFiles:t.mediaFile}}),t.linear={duration:t.duration,trackingEvents:t.trackingEvents,videoClicks:t.videoClicks,mediaFiles:t.mediaFiles}}),jQuery(this).find("NonLinearAds").each(function(){t.trackingEvents={},t.nonLinear={},jQuery(this).find("TrackingEvents").each(function(){t.tracking={},jQuery(this).find("Tracking").each(function(){var i=jQuery(this).attr("event"),e=jQuery(this).text();t.tracking[i]={event:i,tracking:e}}),t.trackingEvents={tracking:t.tracking}}),jQuery(this).find("NonLinear").each(function(){t.staticResource={},jQuery(this).find("StaticResource").each(function(){var i=jQuery(this).attr("creativeType"),e=jQuery(this).text();t.staticResource={creativeType:i,staticResource:e}}),jQuery(this).find("NonLinearClickThrough").each(function(){t.nonLinearClickThrough=jQuery(this).text()}),jQuery(this).find("NonLinearClickTracking").each(function(){t.nonLinearClickTracking=jQuery(this).text()}),t.nonLinear={staticResource:t.staticResource,nonLinearClickThrough:t.nonLinearClickThrough,nonLinearClickTracking:t.nonLinearClickTracking}}),t.nonLinearAds={trackingEvents:t.trackingEvents,nonLinear:t.nonLinear}}),jQuery(this).find("Linear").length>0&&(t.creative[i]={id:e,sequence:n,linear:t.linear}),jQuery(this).find("NonLinearAds").length>0&&(t.creative[i]={id:e,sequence:n,nonLinearAds:t.nonLinearAds})}),t.Creatives={Creative:t.creative}}),t.InLine={AdSystem:i,AdTitle:e,Description:n,Error:a,Impression:r,Creatives:t.Creatives}}),t.ad={id:i,InLine:t.InLine},t.vast_array.push(t.ad)}),t.handleLoadedXML(n,e)}})},PLAYER.Vast.prototype.xmlToJson=function(i){var e={};if(1==i.nodeType){if(i.attributes.length>0){e["@attributes"]={};for(var t=0;t<i.attributes.length;t++){var n=i.attributes.item(t);e["@attributes"][n.nodeName]=n.nodeValue}}}else 3==i.nodeType?e=i.nodeValue.trim():4==i.nodeType&&(e=i.nodeValue);if(i.hasChildNodes())for(var a=0;a<i.childNodes.length;a++){var r=i.childNodes.item(a),s=r.nodeName;if("undefined"==typeof e[s])e[s]=this.xmlToJson(r);else{if("undefined"==typeof e[s].length){var o=e[s];e[s]=[],e[s].push(o)}"object"==typeof e[s]&&e[s].push(this.xmlToJson(r))}}return e},PLAYER.Vast.prototype.convertTimeStringToSeconds=function(i){if(!i||!i.match(/^(\d){2}(:[0-5][0-9]){2}(.(\d){1,3})?$/))return!1;const e=i.split(":");return 3600*parseInt(e[0],10)+60*parseInt(e[1],10)+parseInt(e[2],10)},PLAYER.Vast.prototype.handleLoadedXML=function(i,e){if(this.countXMLS++,"undefined"!=typeof i["vmap:VMAP"]){this.is_VMAP=!0,this.objVMAP=i,i["vmap:VMAP"]["vmap:AdBreak"].length||(i["vmap:VMAP"]["vmap:AdBreak"]=[i["vmap:VMAP"]["vmap:AdBreak"]]),this.maxcount
1XMLS=1;for(var t=0;t<i["vmap:VMAP"]["vmap:AdBreak"].length;t++){this.countVasts++,this.maxcountXMLS++;var n=i["vmap:VMAP"]["vmap:AdBreak"][t]["@attributes"].timeOffset;this.loadVastUrl(i["vmap:VMAP"]["vmap:AdBreak"][t]["vmap:AdSource"]["vmap:AdTagURI"]["#cdata-section"],n)}}if("undefined"!=typeof i.VAST){if(0==this.countVasts?(this.vastObj[0]=i,this.maxcountXMLS=1,this.is_VAST=!0):this.countVasts>0&&this.arrVAST.push(i),void 0==i.VAST.Ad)return void alert("No <Ad> tag found in VAST url. Try refreshing the page.");i.VAST.Ad.length||(i.VAST.Ad=[i.VAST.Ad]);for(var t=0;t<i.VAST.Ad.length;t++){e&&this.is_VMAP&&(i.VAST.Ad[t]["@attributes"].timeOffset=e),void 0!==i.VAST.Ad[t]["@attributes"].timeOffset&&(e=i.VAST.Ad[t]["@attributes"].timeOffset),i.VAST.Ad[t].InLine.Creatives.Creative.length||(i.VAST.Ad[t].InLine.Creatives.Creative=[i.VAST.Ad[t].InLine.Creatives.Creative]);for(var a=0;a<i.VAST.Ad[t].InLine.Creatives.Creative.length;a++){if(i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear&&(i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear.MediaFiles.MediaFile.length||(i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear.MediaFiles.MediaFile=[i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear.MediaFiles.MediaFile]),this.allVastMediaFilesArr.push(i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear.MediaFiles.MediaFile[0]["#cdata-section"]),this.clickThrough=i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear.VideoClicks.ClickThrough["#cdata-section"],this.mediaFile=i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear.MediaFiles.MediaFile[0]["#cdata-section"],i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear.hasOwnProperty("@attributes")&&(this.skipoffset=i.VAST.Ad[t].InLine.Creatives.Creative[a].Linear["@attributes"].skipoffset),this.is_VMAP?this.handleROLLS(e,"linear"):void 0!==i.VAST.Ad[t]["@attributes"].timeOffset?this.handleROLLS(e,"linear"):(this.allVastPREROLLS[this.prerollsCount]={mediaFile:this.mediaFile,clickThrough:this.clickThrough,skipoffset:this.skipoffset},this.prerollsCount++)),i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds){i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear.length||(i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear=[i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear]);for(var r=0;r<i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear.length;r++){i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].StaticResource.length||(i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].StaticResource=[i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].StaticResource]),this.minSuggestedDuration=i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r]["@attributes"].minSuggestedDuration;for(var s=0;s<i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].StaticResource.length;s++)this.allVastNonLinearArr.push(i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].StaticResource[s]["#cdata-section"]);this.nonLinearClickThrough=i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].NonLinearClickThrough["#cdata-section"],this.nonLinearClickTracking=i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].NonLinearClickTracking["#cdata-section"],this.staticResource=i.VAST.Ad[t].InLine.Creatives.Creative[a].NonLinearAds.NonLinear[r].StaticResource[0]["#cdata-section"],this.handleROLLS(e,"nonlinear")}}i.VAST.Ad[t].InLine.Creatives.Creative[a].CompanionAds&&(i.VAST.Ad[t].InLine.Creatives.Creative[a].CompanionAds.Companion.length||(i.VAST.Ad[t].InLine.Creatives.Creative[a].CompanionAds.Companion=[i.VAST.Ad[t].InLine.Creatives.Creative[a].CompanionAds.Companion]),this.allVastCompanionArr.push(i.VAST.Ad[t].InLine.Creatives.Creative[a].CompanionAds.Companion[0].StaticResource["#cdata-section"]))}}}this.countXMLS==this.maxcountXMLS&&this.initData()},PLAYER.Vast.prototype.handleROLLS=function(i,e){"start"==i&&(this.allVastPREROLLS[this.prerollsCount]={mediaFile:this.mediaFile,clickThrough:this.clickThrough,skipoffset:this.skipoffset},this.prerollsCount++),"end"==i&&(this.allVastPOSTROLLS[this.postrollsCount]={mediaFile:this.mediaFile,clickThrough:this.clickThrough,skipoffset:this.skipoffset},this.postrollsCount++),"start"!==i&&"end"!==i&&("linear"===e&&(this.allVastMIDROLLS[this.midrollsCount]={mediaFile:this.mediaFile,clickThrough:this.clickThrough,skipoffset:this.skipoffset,timeOffset:i},this.midrollsCount++),"nonlinear"===e&&(this.allVastNONLINEARS[this.nonlinearsCount]={staticResource:this.staticResource,nonLinearClickThrough:this.nonLinearClickThrough,nonLinearClickTracking:this.nonLinearClickTracking,minSuggestedDuration:this.minSuggestedDuration,timeOffset:i},this.nonlinearsCount++))},PLAYER.Vast.prototype.initData=function(){if(this.arrVAST.length>0)for(var i=0;i<this.arrVAST.length;i++)this.vastObj[i]=this.arrVAST[i];this.videoPlayer.checkForPoints()};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.