{"version":3,"sources":["videojs-vast-vpaid.js","utilityFunctions.js","http.js","urlUtils.js","ads/vpaid/VPAIDAdUnitWrapper.js","ads/vpaid/VPAIDFlashTech.js","ads/vpaid/VPAIDHTML5Tech.js","ads/vpaid/VPAIDIntegrator.js","ads/vast/client/Ad.js","ads/vast/client/Creative.js","ads/vast/client/Inline.js","ads/vast/client/Linear.js","ads/vast/client/MediaFile.js","ads/vast/client/TrackingEvent.js","ads/vast/client/VASTClient.js","ads/vast/client/VASTError.js","ads/vast/client/VASTIntegrator.js","ads/vast/client/VASTTracker.js","ads/vast/client/VideoClicks.js","ads/vast/client/Wrapper.js","VPAIDFLASHClient.js","VPAIDHTML5Client.js","async.js","dom.js","playerUtils.js","xml.js","ads/videojs.vast.js","ads/components/ads-label.js","ads/components/black-poster.js","ads/vast/client/VASTResponse.js","ads/vast/client/vastUtil.js"],"names":["window","document","vjs","undefined","noop","isNull","o","isDefined","isUndefined","isObject","obj","isFunction","str","isNumber","num","isArray","array","Object","prototype","toString","call","isString","isEmptyString","length","isNotEmptyString","arrayLikeObjToArray","args","Array","slice","forEach","iterator","context","key","hasOwnProperty","isPrimitive","extend","arg","i","k","arguments","capitalize","s","charAt","toUpperCase","decapitalize","toLowerCase","transformArray","transformer","transformedArray","item","index","transformedItem","push","toFixedDigits","digits","formattedNum","parseInt","isNaN","NaN","throttle","callback","delay","previousCall","Date","getTime","time","apply","this","echoFn","val","isISO8601","value","iso8086Regex","test","trim","isOldIE","version","getInternetExplorerVersion","navigator","rv","appName","ua","userAgent","re","RegExp","res","exec","parseFloat","isIDevice","_UA","isIPhone","HttpRequestError","message","HttpRequest","createXhr","xhr","XMLHttpRequest","XDomainRequest","urlParts","url","href","msie","urlParsingNode","setAttribute","protocol","replace","host","search","hash","hostname","port","pathname","VPAIDAdUnitWrapper","vpaidAdUnit","opts","sanityCheck","adUnit","checkVPAIDInterface","VASTError","responseTimeout","options","_adUnit","VPAIDFlashTech","mediaFile","settings","src","name","containerEl","vpaidFlashClient","VPAIDHTML5Tech","INVALID_MEDIA_FILE","videoEl","vpaidHTMLClient","VPAIDIntegrator","player","createVPAIDContainerEl","createElement","dom","addClass","el","insertBefore","controlBar","VIEW_MODE","NORMAL","FULLSCREEN","THUMBNAIL","VPAID_VERSION","resizeAd","tech","querySelector","dimension","getDimension","MODE","isFullscreen","width","height","logError","error","console","log","Ad","adJTree","id","attr","sequence","inLine","InLine","wrapper","Wrapper","Creative","creativeJTree","adId","apiFramework","linear","Linear","inlineJTree","parseSurveys","inlineSurveys","survey","keyValue","uri","type","adTitle","xml","adSystem","impressions","vastUtil","parseImpressions","impression","creatives","parseCreatives","description","advertiser","surveys","pricing","extensions","linearJTree","parseTrackingEvents","trackingEvents","duration","trackings","trackingData","TrackingEvent","parseMediaFiles","mediaFilesJxonTree","mediaFiles","mfData","MediaFile","parseDuration","tracking","skipoffset","parseOffset","videoClicks","VideoClicks","adParameters","decode","mediaFileJTree","delivery","codec","bitrate","minBitrate","maxBitrate","scalable","maintainAspectRatio","trackingJTree","offset","VASTClient","defaultOptions","WRAPPER_LIMIT","errorURLMacros","code","VASTIntegrator","VASTTracker","assetURI","vastResponse","VASTResponse","response","progress","quartiles","firstQuartile","tracked","Math","round","midpoint","thirdQuartile","videoClickJTree","parseClickTrackings","clickTrackings","clickTrackingData","clickThrough","clickTracking","customClicks","customClick","wrapperJTree","VASTAdTagURI","vASTAdTagURI","followAdditionalWrappers","allowMultipleAds","fallbackOnNoAd","e","t","n","r","u","a","require","f","Error","l","exports",1,"module","_classCallCheck","instance","Constructor","TypeError","defineProperty","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","protoProps","staticProps","IVPAIDAdUnit","viewMode","desiredBitrate","AdParameters","flashVars","soundVolume",2,"_inherits","subClass","superClass","create","constructor","__proto__","_get","_x15","_x16","_x17","_again","object","property","receiver","desc","parent","getter","Function","getOwnPropertyDescriptor","get","getPrototypeOf","ALL_VPAID_METHODS","getOwnPropertyNames","filter","indexOf","VPAIDAdUnit","_IVPAIDAdUnit","flash","_destroyed","_flash","_this","methodName","removeCallbackByMethodName","EVENTS","event","offEvent","eventName","on","off","playerVPAIDVersion","callFlashMethod","creativeData","environmentVars","setSize","getWidth","getHeight","volume","./IVPAIDAdUnit",3,"$throwIfDestroyed","$loadPendedAdUnit","_loadLater","loadAdUnit","setStaticProperty","propertyName","VPAIDFLASHClient","JSFlashBridge","callbackTimeout","isPositiveInt","createElementWithID","uniqueVPAID","unique","FLASH_VERSION","vpaidParentEl","onError","setTimeout","swfConfig","data","params","wmode","salign","align","allowScriptAccess","scale","allowFullScreen","quality","vpaidOptions","debug","timeout","hasExternalDependencies","_vpaidParentEl","_flashID","movie","FlashVars","VPAID_FLASH_HANDLER","isSupported","swfobject","createSWF","handler","err","_destroyAdUnit","destroy","_adUnitLoad","removeCallback","_destroy","adURL","_this2","isReady","getFlashID","getFlashURL","hasFlashPlayerVersion","./VPAIDAdUnit","./jsFlashBridge","./utils",4,"$asyncCallback","callbackID","result","_this3","_callbacks","remove","stringEndsWith","SingleValueRegistry","MultipleValuesRegistry","registry","ERROR","flashURL","flashID","loadHandShake","_el","_flashURL","_width","_height","_handlers","_uniqueMethodIdentifier","_ready","_handShakeHandler","addInstance","add","removeByKey","removeAll","concat","_trigger","removeByValue","suffix","filterKeys","trigger","newWidth","newHeight","offAll","removeAllCallbacks","removeInstanceByID","parentElement","removeChild","typeID","typeName","getInstanceByID","_handShake","_callCallback","./jsFlashBridgeRegistry","./registry",5,"instances","JSFlashBridgeRegistry",6,"_registries","keys","splice","old","findByValue","map","_this4",7,"prefix","count","timer","onSuccess","onTimeout","clearTimeout","nEl","innerHTML","appendChild","newVal","oldVal","isFinite","string","endsWith","String","searchString","position","subjectString","lastIndex","creative","video","addStaticToInterface","Interface","METHODS","GETTERS","SETTERS","handshakeVersion","VPAIDVersion","initAd","startAd","stopAd","skipAd","pauseAd","resumeAd","expandAd","collapseAd","subscribe","unsubscribe","getAdLinear","getAdWidth","getAdHeight","getAdExpanded","getAdSkippableState","getAdRemainingTime","getAdDuration","getAdVolume","getAdCompanions","getAdIcons","setAdVolume","VPAID1_METHODS","method","every","VPAIDCreative","iframe","_isValid","_creative","_videoEl","_iframe","_subscribers","Subscriber","$addEventsSubscribers","FILTERED_EVENTS","$trigger","bind","$clickThruHook","AD_CLICK","documentElement","contentDocument","addEventListener","click","playerHandles","triggerSync","callOrTriggerEvent","subscribers","utils","isValidVPAIDAd","ignores","ariaty","pop","slot","videoSlot","validate","unsubscribeAll","./subscriber","VPAIDHTML5Client","templateConfig","_id","_frameContainer","createElementInEl","_vpaidOptions","_templateConfig","template","defaultTemplate","extraOptions","$removeEl","$adDestroyed","$removeAdElements","$unloadPreviousAdUnit","$destroyAdUnit","$destroyLoadListener","_onLoad","removeEventListener","clearCallbackTimeout","AD_STOPPED","isDestroyed","onLoad","origin","location","JSON","parse","getID","createAd","_frame","contentWindow","getVPAIDAd","adEl","frame","createIframeWithContent","iframeURL_JS","iframeID","unloadAdUnit","subscriber","that","isValid","func","timeouts","tagName","createIframe","setIframeContent","simpleTemplate","style","left","top","stringify","iframeEl","content","iframeDoc","write","toExtend","fromSource","async","setImmediate","fn","tasks","makeCallback","next","waterfall","wrapIterator","when","condition","isAllowed","unshift","isVisible","getComputedStyle","visibility","isHidden","display","isShown","hide","__prev_style_display_","show","hasClass","cssClass","classes","len","classList","contains","getAttribute","split","join","removeClass","newClasses","attachEvent","detachEvent","dispatchEvent","fireEvent","eventType","isDescendant","child","node","parentNode","getTextContent","textContent","text","prependChild","firstChild","isDomElement","Element","once","handlerWrap","element","rect","getBoundingClientRect","offsetWidth","offsetHeight","run","setHeaders","headers","setRequestHeader","requestError","timeoutId","open","withCredentials","onload","statusText","status","getAllResponseHeaders","responseText","onerror","onabort","send","abort","processResponse","headersString","isSuccess","http","playerUtils","getPlayerSnapshot","getSuppressedTracks","tracks","remoteTextTracks","tracks_","suppressedTracks","track","mode","snapshot","ended","currentSrc","currentTime","currentType","playing","paused","nativePoster","poster","restorePlayerSnapshot","ensureCanplayEvtGetsFired","one","hasSrcChanged","restoreTracks","trackSnapshot","tryToResume","resume","play","isReadyToResume","attempts","videojs","warn","load","readyState","seekable","prepareForAds","monkeyPatchPlayerApi","origPlay","callOrigPlay","firstPlay","volumeSnapshot","saveVolumeSnapshot","muted","isAdPlaying","vast","isFirstPlay","origPause","pause","callOrigPause","origPaused","callOrigPaused","isPaused","tryToTriggerFirstPlay","_firstPlay","resetFirstPlay","blackPoster","restoreContentVolume","restoreVolumeSnapshot","hideBlackPoster","addStyles","removeStyles","addChild","removeNativePoster","removeAttribute","events","listener","documentMode","strToXMLDoc","stringContainingXMLSource","parseString","parsedDocument","parser","DOMParser","parseFromString","isParseError","errorneousParse","parsererrorNS","getElementsByTagName","namespaceURI","getElementsByTagNameNS","xmlDocument","ActiveXObject","loadXML","parseText","sValue","JXONTree","oXMLParent","hasChildNodes","oNode","sProp","vContent","sCollectedTxt","nItem","childNodes","nodeType","nodeValue","nodeName","hasAttr","hasAttributes","attributes","oAttrib","nAttrib","toJXONTree","xmlString","xmlDoc","xmlObj","encode","plugin","tryToPlayPrerollAd","removeAdUnit","restoreVideoContent","setupContentEvents","evt","checkAdsEnabled","adsEnabled","preparePlayerForAd","canPlayPrerollAd","addSpinnerIcon","startAdCancelTimeout","iosPrerollCancelTimeout","clearAdCancelTimeout","adCancelTimeoutId","adsCanceled","trackAdError","adCancelTimeout","removeSpinnerIcon","playPrerollAd","cancelAds","getVastResponse","playAd","getVASTResponse","adTagUrl","adTagXML","addAdsLabel","adFinished","getChild","removeAdsLabel","preventManualProgress","adTimeupdateHandler","progressDelta","abs","previousTime","PROGRESS_THRESHOLD","skipad_attempts","stopPreventManualProgress","adIntegrator","isVPAID","defaultOpts","playAdAlways","autoResize","vpaidFlashLoaderPath","isEnabled","enable","disable","AdsLabel","Component","init","currentTimeComp","createEl","className","BlackPoster","posterImg","canSubscribeToEvents","canUnsubscribeFromEvents","VPAIDInterfaceMethods","adUnitAsyncCall","cb","wrapCallback","shift","evtName","waitForEvent","responseListener","adUnitData","getterName","supports","objectEl","container","flashClientOpts","INVALID_DOM_CONTAINER_EL","MISSING_CALLBACK","PREFIX","INVALID_DOM_VIDEO_EL","techs","triggerVpaidAdEnd","_findSupportedTech","_loadAdUnit","_playAdUnit","_finishPlaying","_trackError","_paused","getSrc","findSupportedTech","mediafile","VPAIDTech","vpaidMediaFiles","vjsTechEl","WrappedAdUnit","techClass","_handshake","_initAd","_setupEvents","_addSkipButton","_linkPlayerControls","_startAd","isSupportedVersion","majorNum","major","parts","notifyPlayToPlayer","notifyPauseToPlayer","pauseAdUnit","resumeAdUnit","adUnitSrc","tracker","trackSkip","trackImpressions","trackCreativeView","trackStart","trackResume","trackPause","trackFirstQuartile","trackMidpoint","trackThirdQuartile","trackComplete","generateClickThroughURL","clickThroughMacro","variables","ASSETURI","CONTENTPLAYHEAD","parseURLMacro","clickThruUrl","trackClick","trackAcceptInvitation","trackAcceptInvitationLinear","trackClose","trackCloseLinear","trackCollapse","trackErrorWithCode","lastVolume","currentVolume","trackMute","trackUnmute","updateViewSize","updateViewSizeThrottled","updateSkipButtonState","isSkippable","skipButton","addSkipButton","removeSkipButton","createSkipButton","onclick","Event","stopPropagation","linkVolumeControl","updateAdUnitVolume","vol","updatePlayerVolume","linkFullScreenControl","finishPlayingAd","errMsg","ERRORCODE","buildVASTResponse","adsChain","_buildVASTResponse","_getVASTAd","getAdWaterfall","requestVastXML","_requestVASTXml","buildVastWaterfall","xmlStr","vastTree","ads","ad","validateVASTTree","vastVersion","getAd","adChain","requestVASTAd","buildAd","adJxonTree","validateAd","errMsgPrefix","waterfallHandler","waterfallAds","requestHandler","addAdsToResponse","addAd","validateResponse","progressEvents","hasLinear","progressEvent","addErrorUrlMacros","_selectAdSource","_createVASTTracker","_addClickThrough","_playSelectedAd","_src","source","playerWidth","sort","b","deltaA","deltaB","selectSource","adMediaFile","unbindEvents","trackFullscreenChange","trackProgress","trackVolumeChange","trackFullscreen","trackExitFullscreen","currentTimeInMs","previouslyMuted","addSkipButtonToPlayer","skipOffset","updateSkipButton","timeLeft","ceil","skipOffsetInSec","createClickThroughBlocker","blocker","updateBlockerURL","formatProgress","removeBlocker","updateBlocker","preload","_linearAdded","appendToArray","items","_addInLine","_addWrapper","_addErrorTrackUrl","errorURL","_addImpressions","_addClickTrackings","_addCustomClicks","_addTrackingEvents","eventsMap","trackingEvent","_addTitle","title","_addDuration","_addVideoClicks","_addMediaFiles","_addSkipoffset","_addAdParameters","_addLinear","trackURLs","urls","trackEvent","trackOnce","getEventUris","uris","newProgressInMs","hasRewound","currentProgress","newProgress","REWIND_THRESHOLD","addTrackEvent","canBeAdded","addQuartileEvents","trackQuartile","quartileName","quartile","canBeTracked","ONCE","quartileTime","trackProgressEvents","pendingProgressEvts","trackEvents","ALWAYS","errorcode","URLMacros","sources","parseURLMacros","trackImgs","img","Image","parsedURLs","random","URLMacro","_parseURLMacro","durationStr","parseHoursToMs","hourStr","parseMinToMs","minStr","parseSecToMs","secStr","match","durationInMs","durationRegex","creativesJTree","creativesData","hours","minutes","seconds","milliseconds","floor","isPercentage","percentageRegex","calculatePercentage","percentStr","calcPercent","quantity","percent"],"mappings":"CAAA,SAAAA,EAAAC,EAAAC,EAAAC,GCKA,QAAAC,MAEA,QAAAC,GAAAC,GACA,MAAA,QAAAA,EAGA,QAAAC,GAAAD,GACA,MAAAA,KAAAH,EAGA,QAAAK,GAAAF,GACA,MAAAA,KAAAH,EAGA,QAAAM,GAAAC,GACA,MAAA,gBAAAA,GAGA,QAAAC,GAAAC,GACA,MAAA,kBAAAA,GAGA,QAAAC,GAAAC,GACA,MAAA,gBAAAA,GAOA,QAAAC,GAAAC,GACA,MAAA,mBAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,GAkBA,QAAAK,GAAAT,GACA,MAAA,gBAAAA,GAGA,QAAAU,GAAAV,GACA,MAAAS,GAAAT,IAAA,IAAAA,EAAAW,OAGA,QAAAC,GAAAZ,GACA,MAAAS,GAAAT,IAAA,I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AAC,EAAAC,GACA,MAAAD,GAAAC,EAAA,IAnBA,MAAAN,GAAA90B,GACAg1B,EAAAh1B,EAAA1B,GAEAb,GAAAsB,cAAAiB,IAoBAilB,QAAA,SAAAvrB,GACA,QAAAA,GAAA,UAAAA,EAAAiD,gBAEA5K,OAAAC,SAAA6rB","file":"videojs-vast-vpaid.min.js","sourcesContent":["(function (window, document, vjs, undefined) {(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0) {\n callback(event);\n }\n }, 0);\n }\n });\n }\n }, {\n key: '_callCallback',\n value: function _callCallback(methodName, callbackID, err, result) {\n\n var callback = this._callbacks.get(callbackID);\n\n //not all methods callback's are mandatory\n //but if there exist an error, fire the error event\n if (!callback) {\n if (err && callbackID === '') {\n this.trigger(ERROR, err);\n }\n return;\n }\n\n $asyncCallback.call(this, callbackID, err, result);\n }\n }, {\n key: '_handShake',\n value: function _handShake(err, data) {\n this._ready = true;\n if (this._handShakeHandler) {\n this._handShakeHandler(err, data);\n delete this._handShakeHandler;\n }\n }\n }, {\n key: 'getSize',\n\n //methods like properties specific to this implementation of VPAID\n value: function getSize() {\n return { width: this._width, height: this._height };\n }\n }, {\n key: 'setSize',\n value: function setSize(newWidth, newHeight) {\n this._width = isPositiveInt(newWidth, this._width);\n this._height = isPositiveInt(newHeight, this._height);\n this._el.setAttribute('width', this._width);\n this._el.setAttribute('height', this._height);\n }\n }, {\n key: 'getWidth',\n value: function getWidth() {\n return this._width;\n }\n }, {\n key: 'setWidth',\n value: function setWidth(newWidth) {\n this.setSize(newWidth, this._height);\n }\n }, {\n key: 'getHeight',\n value: function getHeight() {\n return this._height;\n }\n }, {\n key: 'setHeight',\n value: function setHeight(newHeight) {\n this.setSize(this._width, newHeight);\n }\n }, {\n key: 'getFlashID',\n value: function getFlashID() {\n return this._flashID;\n }\n }, {\n key: 'getFlashURL',\n value: function getFlashURL() {\n return this._flashURL;\n }\n }, {\n key: 'isReady',\n value: function isReady() {\n return this._ready;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.offAll();\n this.removeAllCallbacks();\n registry.removeInstanceByID(this._flashID);\n if (this._el.parentElement) {\n this._el.parentElement.removeChild(this._el);\n }\n }\n }]);\n\n return JSFlashBridge;\n})();\n\nexports.JSFlashBridge = JSFlashBridge;\n\nfunction $asyncCallback(callbackID, err, result) {\n var _this3 = this;\n\n setTimeout(function () {\n var callback = _this3._callbacks.get(callbackID);\n if (callback) {\n _this3._callbacks.remove(callbackID);\n callback(err, result);\n }\n }, 0);\n}\n\nObject.defineProperty(JSFlashBridge, 'VPAID_FLASH_HANDLER', {\n writable: false,\n configurable: false,\n value: VPAID_FLASH_HANDLER\n});\n\n/**\n * External interface handler\n *\n * @param {string} flashID identifier of the flash who call this\n * @param {string} typeID what type of message is, can be 'event' or 'callback'\n * @param {string} typeName if the typeID is a event the typeName will be the eventName, if is a callback the typeID is the methodName that is related this callback\n * @param {string} callbackID only applies when the typeID is 'callback', identifier of the callback to call\n * @param {object} error error object\n * @param {object} data\n */\nwindow[VPAID_FLASH_HANDLER] = function (flashID, typeID, typeName, callbackID, error, data) {\n var instance = registry.getInstanceByID(flashID);\n if (!instance) return;\n if (typeName === 'handShake') {\n instance._handShake(error, data);\n } else {\n if (typeID !== 'event') {\n instance._callCallback(typeName, callbackID, error, data);\n } else {\n instance._trigger(typeName, data);\n }\n }\n};\n\n},{\"./jsFlashBridgeRegistry\":5,\"./registry\":6,\"./utils\":7}],5:[function(require,module,exports){\n'use strict';\n\nvar SingleValueRegistry = require('./registry').SingleValueRegistry;\nvar instances = new SingleValueRegistry();\n\nvar JSFlashBridgeRegistry = {};\nObject.defineProperty(JSFlashBridgeRegistry, 'addInstance', {\n writable: false,\n configurable: false,\n value: function value(id, instance) {\n instances.add(id, instance);\n }\n});\n\nObject.defineProperty(JSFlashBridgeRegistry, 'getInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.get(id);\n }\n});\n\nObject.defineProperty(JSFlashBridgeRegistry, 'removeInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.remove(id);\n }\n});\n\nmodule.exports = JSFlashBridgeRegistry;\n\n},{\"./registry\":6}],6:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar MultipleValuesRegistry = (function () {\n function MultipleValuesRegistry() {\n _classCallCheck(this, MultipleValuesRegistry);\n\n this._registries = {};\n }\n\n _createClass(MultipleValuesRegistry, [{\n key: 'add',\n value: function add(id, value) {\n if (!this._registries[id]) {\n this._registries[id] = [];\n }\n if (this._registries[id].indexOf(value) === -1) {\n this._registries[id].push(value);\n }\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id] || [];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this = this;\n\n var keys = Object.keys(this._registries).filter(function (key) {\n return _this._registries[key].indexOf(value) !== -1;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(key, value) {\n if (!this._registries[key]) {\n return;\n }\n\n var index = this._registries[key].indexOf(value);\n\n if (index < 0) {\n return;\n }\n return this._registries[key].splice(index, 1);\n }\n }, {\n key: 'removeByKey',\n value: function removeByKey(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this2 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function (key) {\n return _this2.remove(key, value);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return MultipleValuesRegistry;\n})();\n\nexports.MultipleValuesRegistry = MultipleValuesRegistry;\n\nvar SingleValueRegistry = (function () {\n function SingleValueRegistry() {\n _classCallCheck(this, SingleValueRegistry);\n\n this._registries = {};\n }\n\n _createClass(SingleValueRegistry, [{\n key: 'add',\n value: function add(id, value) {\n this._registries[id] = value;\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this3 = this;\n\n var keys = Object.keys(this._registries).filter(function (key) {\n return _this3._registries[key] === value;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this4 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function (key) {\n return _this4.remove(key);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return SingleValueRegistry;\n})();\n\nexports.SingleValueRegistry = SingleValueRegistry;\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports.unique = unique;\nexports.noop = noop;\nexports.callbackTimeout = callbackTimeout;\nexports.createElementWithID = createElementWithID;\nexports.isPositiveInt = isPositiveInt;\nexports.stringEndsWith = stringEndsWith;\n\nfunction unique(prefix) {\n var count = -1;\n return function (f) {\n return prefix + '_' + ++count;\n };\n}\n\nfunction noop() {}\n\nfunction callbackTimeout(timer, onSuccess, onTimeout) {\n\n var timeout = setTimeout(function () {\n\n onSuccess = noop;\n onTimeout();\n }, timer);\n\n return function () {\n clearTimeout(timeout);\n onSuccess.apply(this, arguments);\n };\n}\n\nfunction createElementWithID(parent, id) {\n var nEl = document.createElement('div');\n nEl.id = id;\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n}\n\nfunction isPositiveInt(newVal, oldVal) {\n return !isNaN(parseFloat(newVal)) && isFinite(newVal) && newVal > 0 ? newVal : oldVal;\n}\n\nvar endsWith = (function () {\n if (String.prototype.endsWith) return String.prototype.endsWith;\n return function endsWith(searchString, position) {\n var subjectString = this.toString();\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n})();\n\nfunction stringEndsWith(string, search) {\n return endsWith.call(string, search);\n}\n\n},{}]},{},[3])\n\n\n//# sourceMappingURL=VPAIDFLASHClient.js.map\n;\n/*jshint unused:false */\n\"use strict\";\n\nvar NODE_TYPE_ELEMENT = 1;\n\nfunction noop(){ }\n\nfunction isNull(o) {\n return o === null;\n}\n\nfunction isDefined(o){\n return o !== undefined;\n}\n\nfunction isUndefined(o){\n return o === undefined;\n}\n\nfunction isObject(obj) {\n return typeof obj === 'object';\n}\n\nfunction isFunction(str){\n return typeof str === 'function';\n}\n\nfunction isNumber(num){\n return typeof num === 'number';\n}\n\nfunction isWindow(obj) {\n return isObject(obj) && obj.window === obj;\n}\n\nfunction isArray(array){\n return Object.prototype.toString.call( array ) === '[object Array]';\n}\n\nfunction isArrayLike(obj) {\n if (obj === null || isWindow(obj) || isFunction(obj) || isUndefined(obj)) {\n return false;\n }\n\n var length = obj.length;\n\n if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n return true;\n }\n\n return isString(obj) || isArray(obj) || length === 0 ||\n typeof length === 'number' && length > 0 && (length - 1) in obj;\n}\n\nfunction isString(str){\n return typeof str === 'string';\n}\n\nfunction isEmptyString(str) {\n return isString(str) && str.length === 0;\n}\n\nfunction isNotEmptyString(str) {\n return isString(str) && str.length !== 0;\n}\n\nfunction arrayLikeObjToArray(args) {\n return Array.prototype.slice.call(args);\n}\n\nfunction forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n // Need to check if hasOwnProperty exists,\n // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n if (key !== 'prototype' && key !== 'length' && key !== 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else {\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n}\n\nfunction isValidEmail(email){\n if(!isString(email)){\n return false;\n }\n var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;\n return EMAIL_REGEXP.test(email.trim());\n}\n\nfunction extend (obj) {\n var arg, i, k;\n for (i = 1; i < arguments.length; i++) {\n arg = arguments[i];\n for (k in arg) {\n if (arg.hasOwnProperty(k)) {\n if(isObject(obj[k]) && !isNull(obj[k]) && isObject(arg[k])){\n obj[k] = extend({}, obj[k], arg[k]);\n }else {\n obj[k] = arg[k];\n }\n }\n }\n }\n return obj;\n}\n\nfunction capitalize(s){\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nfunction decapitalize(s) {\n return s.charAt(0).toLowerCase() + s.slice(1);\n}\n\n/**\n * This method works the same way array.prototype.map works but if the transformer returns undefine, then\n * it won't be added to the transformed Array.\n */\nfunction transformArray(array, transformer) {\n var transformedArray = [];\n\n array.forEach(function(item, index){\n var transformedItem = transformer(item, index);\n if(isDefined(transformedItem)) {\n transformedArray.push(transformedItem);\n }\n });\n\n return transformedArray;\n}\n\nfunction toFixedDigits(num, digits) {\n var formattedNum = num + '';\n digits = isNumber(digits) ? digits : 0;\n num = isNumber(num) ? num : parseInt(num, 10);\n if(isNumber(num) && !isNaN(num)){\n formattedNum = num + '';\n while(formattedNum.length < digits) {\n formattedNum = '0' + formattedNum;\n }\n return formattedNum;\n }\n return NaN + '';\n}\n\nfunction throttle(callback, delay) {\n var previousCall = new Date().getTime() - (delay + 1);\n return function() {\n var time = new Date().getTime();\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(this, arguments);\n }\n };\n}\n\nfunction debounce (callback, wait) {\n var timeoutId;\n\n return function (){\n if(timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(function(){\n callback.apply(this, arguments);\n timeoutId = undefined;\n }, wait);\n };\n}\n\n// a function designed to blow up the stack in a naive way\n// but it is ok for videoJs children components\nfunction treeSearch(root, getChildren, found){\n var children = getChildren(root);\n for (var i = 0; i < children.length; i++){\n if (found(children[i])) {\n return children[i];\n }\n else {\n var el = treeSearch(children[i], getChildren, found);\n if (el){\n return el;\n }\n }\n }\n}\n\nfunction echoFn(val) {\n return function () {\n return val;\n };\n}\n\n//Note: Supported formats come from http://www.w3.org/TR/NOTE-datetime\n// and the iso8601 regex comes from http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/\nfunction isISO8601(value) {\n if(isNumber(value)){\n value = value + ''; //we make sure that we are working with strings\n }\n\n if(!isString(value)){\n return false;\n }\n\n /*jslint maxlen: 500 */\n var iso8086Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n return iso8086Regex.test(value.trim());\n}\n\n/**\n * Checks if the Browser is IE9 and below\n * @returns {boolean}\n */\nfunction isOldIE() {\n var version = getInternetExplorerVersion(navigator);\n if (version === -1) {\n return false;\n }\n\n return version < 10;\n}\n\n/**\n * Returns the version of Internet Explorer or a -1 (indicating the use of another browser).\n * Source: https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx\n * @returns {number} the version of Internet Explorer or a -1 (indicating the use of another browser).\n */\nfunction getInternetExplorerVersion(navigator) {\n var rv = -1;\n\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n var res = re.exec(ua);\n if (res !== null) {\n rv = parseFloat(res[1]);\n }\n }\n\n return rv;\n}\n\n/*** Mobile Utility functions ***/\nvar _UA = navigator.userAgent;\nfunction isIDevice() {\n return /iP(hone|ad)/.test(_UA);\n}\n\nfunction isMobile() {\n return /iP(hone|ad|od)|Android|Windows Phone/.test(_UA);\n}\n\nfunction isIPhone() {\n return /iP(hone|od)/.test(_UA);\n}\n\nfunction isAndroid() {\n return /Android/.test(_UA);\n}\n\n;\n(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o\\n\\n\\n \\n\\n\\n \\n \\n
\\n
\\n\\n\\n\";\n\nvar AD_STOPPED = 'AdStopped';\n\n/**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n/**\n * VPAIDHTML5Client\n * @class\n *\n * @param {HTMLElement} el that will contain the iframe to load adUnit and a el to add to adUnit slot\n * @param {HTMLVideoElement} video default video element to be used by adUnit\n * @param {object} [templateConfig] template: html template to be used instead of the default, extraOptions: to be used when rendering the template\n * @param {object} [vpaidOptions] timeout: when loading adUnit\n */\nfunction VPAIDHTML5Client(el, video, templateConfig, vpaidOptions) {\n templateConfig = templateConfig || {};\n\n this._id = unique();\n this._destroyed = false;\n\n this._frameContainer = utils.createElementInEl(el, 'div');\n this._videoEl = video;\n this._vpaidOptions = vpaidOptions || {timeout: 10000};\n\n this._templateConfig = {\n template: templateConfig.template || defaultTemplate,\n extraOptions: templateConfig.extraOptions || {}\n };\n\n}\n\n/**\n * destroy\n *\n */\nVPAIDHTML5Client.prototype.destroy = function destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n $unloadPreviousAdUnit.call(this);\n};\n\n/**\n * isDestroyed\n *\n * @return {boolean}\n */\nVPAIDHTML5Client.prototype.isDestroyed = function isDestroyed() {\n return this._destroyed;\n};\n\n/**\n * loadAdUnit\n *\n * @param {string} adURL url of the js of the adUnit\n * @param {nodeStyleCallback} callback\n */\nVPAIDHTML5Client.prototype.loadAdUnit = function loadAdUnit(adURL, callback) {\n $throwIfDestroyed.call(this);\n $unloadPreviousAdUnit.call(this);\n\n var frame = utils.createIframeWithContent(\n this._frameContainer,\n this._templateConfig.template,\n utils.extend({\n iframeURL_JS: adURL,\n iframeID: this.getID()\n }, this._templateConfig.extraOptions)\n );\n this._frame = frame;\n\n this._onLoad = utils.callbackTimeout(\n this._vpaidOptions.timeout,\n onLoad.bind(this),\n onTimeout.bind(this)\n );\n\n window.addEventListener('message', this._onLoad);\n\n function onLoad (e) {\n /*jshint validthis: false */\n //don't clear timeout\n if (e.origin !== window.location.origin) return;\n var result = JSON.parse(e.data);\n\n //don't clear timeout\n if (result.id !== this.getID()) return;\n\n var adUnit, error, createAd;\n if (!this._frame.contentWindow) {\n\n error = 'the iframe is not anymore in the DOM tree';\n\n } else {\n createAd = this._frame.contentWindow.getVPAIDAd;\n error = utils.validate(typeof createAd === 'function', 'the ad didn\\'t return a function to create an ad');\n }\n\n if (!error) {\n var adEl = this._frame.contentWindow.document.querySelector('.ad-element');\n adUnit = new VPAIDAdUnit(createAd(), adEl, this._videoEl, this._frame);\n adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(this));\n error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');\n }\n\n this._adUnit = adUnit;\n $destroyLoadListener.call(this);\n callback(error, error ? null : adUnit);\n\n //clear timeout\n return true;\n }\n\n function onTimeout() {\n callback('timeout', null);\n }\n};\n\n/**\n * unloadAdUnit\n *\n */\nVPAIDHTML5Client.prototype.unloadAdUnit = function unloadAdUnit() {\n $unloadPreviousAdUnit.call(this);\n};\n\n/**\n * getID will return the unique id\n *\n * @return {string}\n */\nVPAIDHTML5Client.prototype.getID = function () {\n return this._id;\n};\n\n\n/**\n * $removeEl\n *\n * @param {string} key\n */\nfunction $removeEl(key) {\n var el = this[key];\n if (el) {\n el.remove();\n delete this[key];\n }\n}\n\nfunction $adDestroyed() {\n $removeAdElements.call(this);\n delete this._adUnit;\n}\n\nfunction $unloadPreviousAdUnit() {\n $removeAdElements.call(this);\n $destroyAdUnit.call(this);\n}\n\nfunction $removeAdElements() {\n $removeEl.call(this, '_frame');\n $destroyLoadListener.call(this);\n}\n\n/**\n * $destroyLoadListener\n *\n */\nfunction $destroyLoadListener() {\n if (this._onLoad) {\n window.removeEventListener('message', this._onLoad);\n utils.clearCallbackTimeout(this._onLoad);\n delete this._onLoad;\n }\n}\n\n\nfunction $destroyAdUnit() {\n if (this._adUnit) {\n this._adUnit.stopAd();\n delete this._adUnit;\n }\n}\n\n/**\n * $throwIfDestroyed\n *\n */\nfunction $throwIfDestroyed() {\n if (this._destroyed) {\n throw new Error ('VPAIDHTML5Client already destroyed!');\n }\n}\n\nmodule.exports = VPAIDHTML5Client;\nwindow.VPAIDHTML5Client = VPAIDHTML5Client;\n\n\n},{\"./VPAIDAdUnit\":2,\"./utils\":5}],4:[function(require,module,exports){\n'use strict';\n\nfunction Subscriber() {\n this._subscribers = {};\n}\n\nSubscriber.prototype.subscribe = function subscribe(handler, eventName, context) {\n this.get(eventName).push({handler: handler, context: context});\n};\n\nSubscriber.prototype.unsubscribe = function unsubscribe(handler, eventName) {\n this._subscribers[eventName] = this.get(eventName).filter(function (subscriber) {\n return handler === subscriber.handler;\n });\n};\n\nSubscriber.prototype.unsubscribeAll = function unsubscribeAll() {\n this._subscribers = {};\n};\n\nSubscriber.prototype.trigger = function(eventName, data) {\n var that = this;\n that.get(eventName).forEach(function (subscriber) {\n setTimeout(function () {\n if (that.get(eventName)) {\n subscriber.handler.call(subscriber.context, data);\n }\n }, 0);\n });\n};\n\nSubscriber.prototype.triggerSync = function(eventName, data) {\n this.get(eventName).forEach(function (subscriber) {\n subscriber.handler.call(subscriber.context, data);\n });\n};\n\nSubscriber.prototype.get = function get(eventName) {\n if (!this._subscribers[eventName]) {\n this._subscribers[eventName] = [];\n }\n return this._subscribers[eventName];\n};\n\nmodule.exports = Subscriber;\n\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\n/**\n * noop a empty function\n */\nfunction noop() {}\n\n/**\n * validate if is not validate will return an Error with the message\n *\n * @param {boolean} isValid\n * @param {string} message\n */\nfunction validate(isValid, message) {\n return isValid ? null : new Error(message);\n}\n\nvar timeouts = {};\n/**\n * clearCallbackTimeout\n *\n * @param {function} func handler to remove\n */\nfunction clearCallbackTimeout(func) {\n var timeout = timeouts[func];\n if (timeout) {\n clearTimeout(timeout);\n delete timeouts[func];\n }\n}\n\n/**\n * callbackTimeout if the onSuccess is not called and returns true in the timelimit then onTimeout will be called\n *\n * @param {number} timer\n * @param {function} onSuccess\n * @param {function} onTimeout\n */\nfunction callbackTimeout(timer, onSuccess, onTimeout) {\n var callback, timeout;\n\n timeout = setTimeout(function () {\n onSuccess = noop;\n delete timeout[callback];\n onTimeout();\n }, timer);\n\n callback = function () {\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n if (onSuccess.apply(this, arguments)) {\n clearCallbackTimeout(callback);\n }\n };\n\n timeouts[callback] = timeout;\n\n return callback;\n}\n\n\n/**\n * createElementInEl\n *\n * @param {HTMLElement} parent\n * @param {string} tagName\n * @param {string} id\n */\nfunction createElementInEl(parent, tagName, id) {\n var nEl = document.createElement(tagName);\n if (id) nEl.id = id;\n parent.appendChild(nEl);\n return nEl;\n}\n\n/**\n * createIframeWithContent\n *\n * @param {HTMLElement} parent\n * @param {string} template simple template using {{var}}\n * @param {object} data\n */\nfunction createIframeWithContent(parent, template, data) {\n var iframe = createIframe(parent);\n if (!setIframeContent(iframe, simpleTemplate(template, data))) return;\n return iframe;\n}\n\n/**\n * createIframe\n *\n * @param {HTMLElement} parent\n * @param {string} url\n */\nfunction createIframe(parent, url) {\n var nEl = document.createElement('iframe');\n nEl.src = url || 'about:blank';\n nEl.width = '100%';\n nEl.height = '100%';\n nEl.style.position = 'absolute';\n nEl.style.left = '0';\n nEl.style.top = '0';\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n}\n\n/**\n * simpleTemplate\n *\n * @param {string} template\n * @param {object} data\n */\nfunction simpleTemplate(template, data) {\n Object.keys(data).forEach(function (key) {\n var value = (typeof value === 'object') ? JSON.stringify(data[key]) : data[key];\n template = template.replace(new RegExp('{{' + key + '}}', 'g'), value);\n });\n return template;\n}\n\n/**\n * setIframeContent\n *\n * @param {HTMLIframeElement} iframeEl\n * @param content\n */\nfunction setIframeContent(iframeEl, content) {\n var iframeDoc = iframeEl.contentWindow && iframeEl.contentWindow.document;\n if (!iframeDoc) return false;\n\n iframeDoc.write(content);\n\n return true;\n}\n\n\n/**\n * extend object with keys from another object\n *\n * @param {object} toExtend\n * @param {object} fromSource\n */\nfunction extend(toExtend, fromSource) {\n Object.keys(fromSource).forEach(function(key) {\n toExtend[key] = fromSource[key];\n });\n return toExtend;\n}\n\n\n/**\n * unique will create a unique string everytime is called, sequentially and prefixed\n *\n * @param {string} prefix\n */\nfunction unique(prefix) {\n var count = -1;\n return function () {\n return prefix + '_' + (++count);\n };\n}\n\nmodule.exports = {\n noop: noop,\n validate: validate,\n clearCallbackTimeout: clearCallbackTimeout,\n callbackTimeout: callbackTimeout,\n createElementInEl: createElementInEl,\n createIframeWithContent: createIframeWithContent,\n createIframe: createIframe,\n simpleTemplate: simpleTemplate,\n setIframeContent: setIframeContent,\n extend: extend,\n unique: unique\n};\n\n\n},{}]},{},[3])\n\n\n//# sourceMappingURL=VPAIDHTML5Client.js.map\n;\n//Small subset of async\nvar async = {};\n\nasync.setImmediate = function (fn) {\n setTimeout(fn, 0);\n};\n\nasync.iterator = function (tasks) {\n var makeCallback = function (index) {\n var fn = function () {\n if (tasks.length) {\n tasks[index].apply(null, arguments);\n }\n return fn.next();\n };\n fn.next = function () {\n return (index < tasks.length - 1) ? makeCallback(index + 1) : null;\n };\n return fn;\n };\n return makeCallback(0);\n};\n\n\nasync.waterfall = function (tasks, callback) {\n callback = callback || function () { };\n if (!isArray(tasks)) {\n var err = new Error('First argument to waterfall must be an array of functions');\n return callback(err);\n }\n if (!tasks.length) {\n return callback();\n }\n var wrapIterator = function (iterator) {\n return function (err) {\n if (err) {\n callback.apply(null, arguments);\n callback = function () {\n };\n }\n else {\n var args = Array.prototype.slice.call(arguments, 1);\n var next = iterator.next();\n if (next) {\n args.push(wrapIterator(next));\n }\n else {\n args.push(callback);\n }\n async.setImmediate(function () {\n iterator.apply(null, args);\n });\n }\n };\n };\n wrapIterator(async.iterator(tasks))();\n};\n\nasync.when = function (condition, callback) {\n if (!isFunction(callback)) {\n throw new Error(\"async.when error: missing callback argument\");\n }\n\n var isAllowed = isFunction(condition) ? condition : function () {\n return !!condition;\n };\n\n return function () {\n var args = arrayLikeObjToArray(arguments);\n var next = args.pop();\n\n if (isAllowed.apply(null, args)) {\n return callback.apply(this, arguments);\n }\n\n args.unshift(null);\n return next.apply(null, args);\n };\n};\n\n\n\n;\n\"use strict\";\n\nvar dom = {};\n\ndom.isVisible = function isVisible(el) {\n var style = window.getComputedStyle(el);\n return style.visibility !== 'hidden';\n};\n\ndom.isHidden = function isHidden(el) {\n var style = window.getComputedStyle(el);\n return style.display === 'none';\n};\n\ndom.isShown = function isShown(el) {\n return !dom.isHidden(el);\n};\n\ndom.hide = function hide(el) {\n el.__prev_style_display_ = el.style.display;\n el.style.display = 'none';\n};\n\ndom.show = function show(el) {\n if (dom.isHidden(el)) {\n el.style.display = el.__prev_style_display_;\n }\n el.__prev_style_display_ = undefined;\n};\n\ndom.hasClass = function hasClass(el, cssClass) {\n var classes, i, len;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.contains(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n cssClass = (cssClass || '');\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (classes[i] === cssClass) {\n return true;\n }\n }\n }\n return false;\n};\n\ndom.addClass = function (el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.add(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n classes.push(cssClass);\n el.setAttribute('class', classes.join(' '));\n }\n }\n};\n\ndom.removeClass = function (el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.remove(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n var newClasses = [];\n var i, len;\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (cssClass !== classes[i]) {\n newClasses.push(classes[i]);\n }\n }\n el.setAttribute('class', newClasses.join(' '));\n }\n }\n};\n\ndom.addEventListener = function addEventListener(el, type, handler) {\n if(isArray(el)){\n forEach(el, function(e) {\n dom.addEventListener(e, type, handler);\n });\n return;\n }\n\n if(isArray(type)){\n forEach(type, function(t) {\n dom.addEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.addEventListener) {\n el.addEventListener(type, handler, false);\n } else if (el.attachEvent) {\n // WARNING!!! this is a very naive implementation !\n // the event object that should be passed to the handler\n // would not be there for IE8\n // we should use \"window.event\" and then \"event.srcElement\"\n // instead of \"event.target\"\n el.attachEvent(\"on\" + type, handler);\n }\n};\n\ndom.removeEventListener = function removeEventListener(el, type, handler) {\n if(isArray(el)){\n forEach(el, function(e) {\n dom.removeEventListener(e, type, handler);\n });\n return;\n }\n\n if(isArray(type)){\n forEach(type, function(t) {\n dom.removeEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.removeEventListener) {\n el.removeEventListener(type, handler, false);\n } else if (el.detachEvent) {\n el.detachEvent(\"on\" + type, handler);\n } else {\n el[\"on\" + type] = null;\n }\n};\n\ndom.dispatchEvent = function dispatchEvent(el, event) {\n if (el.dispatchEvent) {\n el.dispatchEvent(event);\n } else {\n el.fireEvent(\"on\" + event.eventType, event);\n }\n};\n\ndom.isDescendant = function isDescendant(parent, child) {\n var node = child.parentNode;\n while (node !== null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n};\n\ndom.getTextContent = function getTextContent(el){\n return el.textContent || el.text;\n};\n\ndom.prependChild = function prependChild(parent, child) {\n if(child.parentNode){\n child.parentNode.removeChild(child);\n }\n return parent.insertBefore(child, parent.firstChild);\n};\n\ndom.remove = function removeNode(node){\n if(node && node.parentNode){\n node.parentNode.removeChild(node);\n }\n};\n\ndom.isDomElement = function isDomElement(o) {\n return o instanceof Element;\n};\n\ndom.click = function(el, handler) {\n dom.addEventListener(el, 'click', handler);\n};\n\ndom.once = function(el, type, handler) {\n function handlerWrap() {\n handler.apply(null, arguments);\n dom.removeEventListener(el, type, handlerWrap);\n }\n\n dom.addEventListener(el, type, handlerWrap);\n};\n\n//Note: there is no getBoundingClientRect on iPad so we need a fallback\ndom.getDimension = function getDimension(element) {\n var rect;\n\n //On IE9 and below getBoundingClientRect does not work consistently\n if(!isOldIE() && element.getBoundingClientRect) {\n rect = element.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height\n };\n }\n\n return {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n};\n\n;\n\"use strict\";\n\nfunction HttpRequestError(message) {\n this.message = 'HttpRequest Error: ' + (message || '');\n}\nHttpRequestError.prototype = new Error();\nHttpRequestError.prototype.name = \"HttpRequest Error\";\n\nfunction HttpRequest(createXhr) {\n if (!isFunction(createXhr)) {\n throw new HttpRequestError('Missing XMLHttpRequest factory method');\n }\n\n this.createXhr = createXhr;\n}\n\nHttpRequest.prototype.run = function (method, url, callback, options) {\n sanityCheck(url, callback, options);\n var timeout, timeoutId;\n var xhr = this.createXhr();\n options = options || {};\n timeout = isNumber(options.timeout) ? options.timeout : 0;\n\n xhr.open(method, urlParts(url).href, true);\n\n if (options.headers) {\n setHeaders(xhr, options.headers);\n }\n\n if (options.withCredentials) {\n xhr.withCredentials = true;\n }\n\n xhr.onload = function () {\n var statusText, response, status;\n\n /**\n * The only way to do a secure request on IE8 and IE9 is with the XDomainRequest object. Unfortunately, microsoft is\n * so nice that decided that the status property and the 'getAllResponseHeaders' method where not needed so we have to\n * fake them. If the request gets done with an XDomainRequest instance, we will assume that there are no headers and\n * the status will always be 200. If you don't like it, DO NOT USE ANCIENT BROWSERS!!!\n *\n * For mor info go to: https://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx\n */\n if (!xhr.getAllResponseHeaders) {\n xhr.getAllResponseHeaders = function () {\n return null;\n };\n }\n\n if (!xhr.status) {\n xhr.status = 200;\n }\n\n if (isDefined(timeoutId)) {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n\n statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n status = xhr.status === 1223 ? 204 : xhr.status;\n\n callback(\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText);\n };\n\n xhr.onerror = requestError;\n xhr.onabort = requestError;\n\n xhr.send();\n\n if (timeout > 0) {\n timeoutId = setTimeout(function () {\n xhr && xhr.abort();\n }, timeout);\n }\n\n function sanityCheck(url, callback, options) {\n if (!isString(url) || isEmptyString(url)) {\n throw new HttpRequestError(\"Invalid url '\" + url + \"'\");\n }\n\n if (!isFunction(callback)) {\n throw new HttpRequestError(\"Invalid handler '\" + callback + \"' for the http request\");\n }\n\n if (isDefined(options) && !isObject(options)) {\n throw new HttpRequestError(\"Invalid options map '\" + options + \"'\");\n }\n }\n\n function setHeaders(xhr, headers) {\n forEach(headers, function (value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n }\n\n function requestError() {\n callback(-1, null, null, '');\n }\n};\n\nHttpRequest.prototype.get = function (url, callback, options) {\n this.run('GET', url, processResponse, options);\n\n function processResponse(status, response, headersString, statusText) {\n if (isSuccess(status)) {\n callback(null, response, status, headersString, statusText);\n } else {\n callback(new HttpRequestError(statusText), response, status, headersString, statusText);\n }\n }\n\n function isSuccess(status) {\n return 200 <= status && status < 300;\n }\n};\n\nfunction createXhr() {\n var xhr = new XMLHttpRequest();\n if (!(\"withCredentials\" in xhr)) {\n // XDomainRequest for IE.\n xhr = new XDomainRequest();\n }\n return xhr;\n}\n\nvar http = new HttpRequest(createXhr);\n\n;\nvar playerUtils = {};\n\n/**\n * Returns an object that captures the portions of player state relevant to\n * video playback. The result of this function can be passed to\n * restorePlayerSnapshot with a player to return the player to the state it\n * was in when this function was invoked.\n * @param {object} player The videojs player object\n */\nplayerUtils.getPlayerSnapshot = function getPlayerSnapshot(player) {\n var tech = player.el().querySelector('.vjs-tech');\n var snapshot = {\n ended: player.ended(),\n src: player.currentSrc(),\n currentTime: player.currentTime(),\n type: player.currentType(),\n playing: !player.paused(),\n suppressedTracks: getSuppressedTracks(player)\n };\n\n if (tech) {\n snapshot.nativePoster = tech.poster;\n snapshot.style = tech.getAttribute('style');\n }\n\n return snapshot;\n\n /**** Local Functions ****/\n function getSuppressedTracks(player) {\n var tracks = player.remoteTextTracks ? player.remoteTextTracks() : [];\n\n if (tracks && isArray(tracks.tracks_)) {\n tracks = tracks.tracks_;\n }\n\n if (!isArray(tracks)) {\n tracks = [];\n }\n\n var suppressedTracks = [];\n tracks.forEach(function (track) {\n suppressedTracks.push({\n track: track,\n mode: track.mode\n });\n track.mode = 'disabled';\n });\n\n return suppressedTracks;\n }\n};\n\n/**\n * Attempts to modify the specified player so that its state is equivalent to\n * the state of the snapshot.\n * @param {object} snapshot - the player state to apply\n */\nplayerUtils.restorePlayerSnapshot = function restorePlayerSnapshot(player, snapshot) {\n var tech = player.el().querySelector('.vjs-tech');\n var attempts = 20; // the number of remaining attempts to restore the snapshot\n\n if (snapshot.nativePoster) {\n tech.poster = snapshot.nativePoster;\n }\n\n if ('style' in snapshot) {\n // overwrite all css style properties to restore state precisely\n tech.setAttribute('style', snapshot.style || '');\n }\n\n if (hasSrcChanged(player, snapshot)) {\n // on ios7, fiddling with textTracks too early will cause safari to crash\n player.one('contentloadedmetadata', restoreTracks);\n\n player.one('canplay', tryToResume);\n ensureCanplayEvtGetsFired();\n\n // if the src changed for ad playback, reset it\n player.src({src: snapshot.src, type: snapshot.type});\n\n // safari requires a call to `load` to pick up a changed source\n player.load();\n\n } else {\n restoreTracks();\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n /*** Local Functions ***/\n\n /**\n * Sometimes firefox does not trigger the 'canplay' evt.\n * This code ensure that it always gets triggered triggered.\n */\n function ensureCanplayEvtGetsFired() {\n var timeoutId = setTimeout(function() {\n player.trigger('canplay');\n }, 1000);\n\n player.one('canplay', function(){\n clearTimeout(timeoutId);\n });\n }\n\n /**\n * Determine whether the player needs to be restored to its state\n * before ad playback began. With a custom ad display or burned-in\n * ads, the content player state hasn't been modified and so no\n * restoration is required\n */\n function hasSrcChanged(player, snapshot) {\n if (player.src()) {\n return player.src() !== snapshot.src;\n }\n // the player was configured through source element children\n return player.currentSrc() !== snapshot.src;\n }\n\n function restoreTracks() {\n var suppressedTracks = snapshot.suppressedTracks;\n suppressedTracks.forEach(function (trackSnapshot) {\n trackSnapshot.track.mode = trackSnapshot.mode;\n });\n }\n\n /**\n * Determine if the video element has loaded enough of the snapshot source\n * to be ready to apply the rest of the state\n */\n function tryToResume() {\n if (playerUtils.isReadyToResume(tech)) {\n // if some period of the video is seekable, resume playback\n return resume();\n }\n\n // delay a bit and then check again unless we're out of attempts\n if (attempts--) {\n setTimeout(tryToResume, 50);\n } else {\n (function () {\n try {\n resume();\n } catch (e) {\n videojs.log.warn('Failed to resume the content after an advertisement', e);\n }\n })();\n }\n\n\n /*** Local functions ***/\n function resume() {\n player.currentTime(snapshot.currentTime);\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n }\n};\n\nplayerUtils.isReadyToResume = function (tech) {\n if (tech.readyState > 1) {\n // some browsers and media aren't \"seekable\".\n // readyState greater than 1 allows for seeking without exceptions\n return true;\n }\n\n if (tech.seekable === undefined) {\n // if the tech doesn't expose the seekable time ranges, try to\n // resume playback immediately\n return true;\n }\n\n if (tech.seekable.length > 0) {\n // if some period of the video is seekable, resume playback\n return true;\n }\n\n return false;\n};\n\n/**\n * This function prepares the player to display ads.\n * Adding convenience events like the 'vast.firsPlay' that gets fired when the video is first played\n * and ads the blackPoster to the player to prevent content from being displayed before the preroll ad.\n *\n * @param player\n */\nplayerUtils.prepareForAds = function (player) {\n var blackPoster = player.addChild('blackPoster');\n var _firstPlay = true;\n var volumeSnapshot;\n\n\n monkeyPatchPlayerApi();\n\n player.on('play', tryToTriggerFirstPlay);\n player.on('vast.reset', resetFirstPlay);//Every time we change the sources we reset the first play.\n player.on('vast.firstPlay', restoreContentVolume);\n player.on('error', hideBlackPoster);//If there is an error in the player we remove the blackposter to show the err msg\n player.on('vast.adStart', hideBlackPoster);\n player.on('vast.adsCancel', hideBlackPoster);\n player.on('vast.adError', hideBlackPoster);\n player.on('vast.adStart', addStyles);\n player.on('vast.adEnd', removeStyles);\n player.on('vast.adsCancel', removeStyles);\n\n /*** Local Functions ***/\n\n /**\n What this function does is ugly and horrible and I should think twice before calling myself a good developer. With that said,\n it is the best solution I could find to mute the video until the 'play' event happens (on mobile devices) and the plugin can decide whether\n to play the ad or not.\n\n We also need this monkeypatch to be able to pause and resume an ad using the player's API\n\n If you have a better solution please do tell me.\n */\n function monkeyPatchPlayerApi() {\n\n /**\n * Monkey patch needed to handle firstPlay and resume of playing ad.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are restoring a VAST ad.\n * @returns {player}\n */\n var origPlay = player.play;\n player.play = function (callOrigPlay) {\n if (isFirstPlay()) {\n firstPlay.call(this);\n } else {\n resume.call(this, callOrigPlay);\n }\n\n return this;\n\n /*** local functions ***/\n function firstPlay() {\n if (!isIPhone()) {\n volumeSnapshot = saveVolumeSnapshot();\n player.muted(true);\n }\n\n origPlay.apply(this, arguments);\n }\n\n function resume(callOrigPlay) {\n if (isAdPlaying() && !callOrigPlay) {\n player.vast.adUnit.resumeAd();\n } else {\n origPlay.apply(this, arguments);\n }\n }\n };\n\n\n /**\n * Needed monkey patch to handle pause of playing ad.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPause = player.pause;\n player.pause = function (callOrigPause) {\n if (isAdPlaying() && !callOrigPause) {\n player.vast.adUnit.pauseAd();\n } else {\n origPause.apply(this, arguments);\n }\n return this;\n };\n\n\n /**\n * Needed monkey patch to handle paused state of the player when ads are playing.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPaused = player.paused;\n player.paused = function (callOrigPaused) {\n if (isAdPlaying() && !callOrigPaused) {\n return player.vast.adUnit.isPaused();\n }\n return origPaused.apply(this, arguments);\n };\n }\n\n function isAdPlaying() {\n return player.vast && player.vast.adUnit;\n }\n\n function tryToTriggerFirstPlay() {\n if (isFirstPlay()) {\n _firstPlay = false;\n player.trigger('vast.firstPlay');\n }\n }\n\n function resetFirstPlay() {\n _firstPlay = true;\n blackPoster.show();\n restoreContentVolume();\n }\n\n function isFirstPlay() {\n return _firstPlay;\n }\n\n function saveVolumeSnapshot() {\n return {\n muted: player.muted(),\n volume: player.volume()\n };\n }\n\n function restoreContentVolume() {\n if (volumeSnapshot) {\n player.currentTime(0);\n restoreVolumeSnapshot(volumeSnapshot);\n volumeSnapshot = null;\n }\n }\n\n function restoreVolumeSnapshot(snapshot) {\n if (isObject(snapshot)) {\n player.volume(snapshot.volume);\n player.muted(snapshot.muted);\n }\n }\n\n function hideBlackPoster() {\n if (!dom.hasClass(blackPoster.el(), 'vjs-hidden')) {\n blackPoster.hide();\n }\n }\n\n function addStyles() {\n dom.addClass(player.el(), 'vjs-ad-playing');\n }\n\n function removeStyles() {\n dom.removeClass(player.el(), 'vjs-ad-playing');\n }\n};\n\n/**\n * Remove the poster attribute from the video element tech, if present. When\n * reusing a video element for multiple videos, the poster image will briefly\n * reappear while the new source loads. Removing the attribute ahead of time\n * prevents the poster from showing up between videos.\n * @param {object} player The videojs player object\n */\nplayerUtils.removeNativePoster = function (player) {\n var tech = player.el().querySelector('.vjs-tech');\n if (tech) {\n tech.removeAttribute('poster');\n }\n};\n\n/**\n * Helper function to listen to many events until one of them gets fired, then we\n * execute the handler and unsubscribe all the event listeners;\n *\n * @param player specific player from where to listen for the events\n * @param events array of events\n * @param handler function to execute once one of the events fires\n */\nplayerUtils.once = function once(player, events, handler) {\n function listener() {\n handler.apply(null, arguments);\n\n events.forEach(function (event) {\n player.off(event, listener);\n });\n }\n\n events.forEach(function (event) {\n player.on(event, listener);\n });\n};\n\n;\n'use strict';\n\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nvar msie = document.documentMode;\n\n/**\n *\n * IMPORTANT NOTE: This function comes from angularJs and was originally called urlResolve\n * you can take a look at the original code here https://github.com/angular/angular.js/blob/master/src/ng/urlUtils.js\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one\n * uses the inner HTML approach to assign the URL as part of an HTML snippet -\n * http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL.\n * Unfortunately, setting img[src] to something like \"javascript:foo\" on IE throws an exception.\n * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that\n * method and IE < 8 is unsupported.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|----------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol including the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol\n * | hostname | The hostname\n * | port | The port, without \":\"\n * | pathname | The pathname, beginning with \"/\"\n *\n */\n\nvar urlParsingNode = document.createElement(\"a\");\n\nfunction urlParts(url) {\n var href = url;\n\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute(\"href\", href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: isNotEmptyString(urlParsingNode.port)? urlParsingNode.port: 80,\n pathname: (urlParsingNode.pathname.charAt(0) === '/')\n ? urlParsingNode.pathname\n : '/' + urlParsingNode.pathname\n };\n}\n\n\n/**\n * This function accepts a query string (search part of a url) and returns a dictionary with\n * the different key value pairs\n * @param {string} qs queryString\n */\nfunction queryStringToObj(qs, cond) {\n var pairs, qsObj;\n\n cond = isFunction(cond)? cond : function() {\n return true;\n };\n\n qs = qs.trim().replace(/^\\?/, '');\n pairs = qs.split('&');\n qsObj = {};\n\n forEach(pairs, function (pair) {\n var keyValue, key, value;\n if (pair !== '') {\n keyValue = pair.split('=');\n key = keyValue[0];\n value = keyValue[1];\n if(cond(key, value)){\n qsObj[key] = value;\n }\n }\n });\n\n return qsObj;\n}\n\n/**\n * This function accepts an object and serializes it into a query string without the leading '?'\n * @param obj\n * @returns {string}\n */\nfunction objToQueryString(obj) {\n var pairs = [];\n forEach(obj, function (value, key) {\n pairs.push(key + '=' + value);\n });\n return pairs.join('&');\n}\n\n\n;\nvar xml = {};\n\nxml.strToXMLDoc = function strToXMLDoc(stringContainingXMLSource){\n //IE 8\n if(typeof window.DOMParser === 'undefined'){\n var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');\n xmlDocument.async = false;\n xmlDocument.loadXML(stringContainingXMLSource);\n return xmlDocument;\n }\n\n return parseString(stringContainingXMLSource);\n\n function parseString(stringContainingXMLSource){\n var parser = new DOMParser();\n var parsedDocument;\n\n //Note: This try catch is to deal with the fact that on IE parser.parseFromString does throw an error but the rest of the browsers don't.\n try {\n parsedDocument = parser.parseFromString(stringContainingXMLSource, \"application/xml\");\n\n if(isParseError(parsedDocument) || isEmptyString(stringContainingXMLSource)){\n throw new Error();\n }\n }catch(e){\n throw new Error(\"xml.strToXMLDOC: Error parsing the string: '\" + stringContainingXMLSource + \"'\");\n }\n\n return parsedDocument;\n }\n\n function isParseError(parsedDocument) {\n try { // parser and parsererrorNS could be cached on startup for efficiency\n var parser = new DOMParser(),\n errorneousParse = parser.parseFromString('INVALID', 'text/xml'),\n parsererrorNS = errorneousParse.getElementsByTagName(\"parsererror\")[0].namespaceURI;\n\n if (parsererrorNS === 'http://www.w3.org/1999/xhtml') {\n // In PhantomJS the parseerror element doesn't seem to have a special namespace, so we are just guessing here :(\n return parsedDocument.getElementsByTagName(\"parsererror\").length > 0;\n }\n\n return parsedDocument.getElementsByTagNameNS(parsererrorNS, 'parsererror').length > 0;\n } catch (e) {\n //Note on IE parseString throws an error by itself and it will never reach this code. Because it will have failed before\n }\n }\n};\n\nxml.parseText = function parseText (sValue) {\n if (/^\\s*$/.test(sValue)) { return null; }\n if (/^(?:true|false)$/i.test(sValue)) { return sValue.toLowerCase() === \"true\"; }\n if (isFinite(sValue)) { return parseFloat(sValue); }\n if (isISO8601(sValue)) { return new Date(sValue); }\n return sValue.trim();\n};\n\nxml.JXONTree = function JXONTree (oXMLParent) {\n var parseText = xml.parseText;\n\n //The document object is an especial object that it may miss some functions or attrs depending on the browser.\n //To prevent this problem with create the JXONTree using the root childNode which is a fully fleshed node on all supported\n //browsers.\n if(oXMLParent.documentElement){\n return new xml.JXONTree(oXMLParent.documentElement);\n }\n\n if (oXMLParent.hasChildNodes()) {\n var sCollectedTxt = \"\";\n for (var oNode, sProp, vContent, nItem = 0; nItem < oXMLParent.childNodes.length; nItem++) {\n oNode = oXMLParent.childNodes.item(nItem);\n /*jshint bitwise: false*/\n if ((oNode.nodeType - 1 | 1) === 3) { sCollectedTxt += oNode.nodeType === 3 ? oNode.nodeValue.trim() : oNode.nodeValue; }\n else if (oNode.nodeType === 1 && !oNode.prefix) {\n sProp = decapitalize(oNode.nodeName);\n vContent = new xml.JXONTree(oNode);\n if (this.hasOwnProperty(sProp)) {\n if (this[sProp].constructor !== Array) { this[sProp] = [this[sProp]]; }\n this[sProp].push(vContent);\n } else { this[sProp] = vContent; }\n }\n }\n if (sCollectedTxt) { this.keyValue = parseText(sCollectedTxt); }\n }\n\n //IE8 Stupid fix\n var hasAttr = typeof oXMLParent.hasAttributes === 'undefined'? oXMLParent.attributes.length > 0: oXMLParent.hasAttributes();\n if (hasAttr) {\n var oAttrib;\n for (var nAttrib = 0; nAttrib < oXMLParent.attributes.length; nAttrib++) {\n oAttrib = oXMLParent.attributes.item(nAttrib);\n this[\"@\" + decapitalize(oAttrib.name)] = parseText(oAttrib.value.trim());\n }\n }\n};\n\nxml.JXONTree.prototype.attr = function(attr) {\n return this['@' + decapitalize(attr)];\n};\n\nxml.toJXONTree = function toJXONTree(xmlString){\n var xmlDoc = xml.strToXMLDoc(xmlString);\n return new xml.JXONTree(xmlDoc);\n};\n\n/**\n * Helper function to extract the keyvalue of a JXONTree obj\n *\n * @param xmlObj {JXONTree}\n * return the key value or undefined;\n */\nxml.keyValue = function getKeyValue(xmlObj) {\n if(xmlObj){\n return xmlObj.keyValue;\n }\n return undefined;\n};\n\nxml.attr = function getAttrValue(xmlObj, attr) {\n if(xmlObj) {\n return xmlObj['@' + decapitalize(attr)];\n }\n return undefined;\n};\n\nxml.encode = function encodeXML(str) {\n return str.replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n};\n\nxml.decode = function decodeXML(str) {\n return str.replace(/'/g, \"'\")\n .replace(/"/g, '\"')\n .replace(/>/g, '>')\n .replace(/</g, '<')\n .replace(/&/g, '&');\n};\n;\nvjs.plugin('vastClient', function VASTPlugin(options) {\n var snapshot;\n var player = this;\n var vast = new VASTClient();\n var adsCanceled = false;\n var defaultOpts = {\n // maximum amount of time in ms to wait to receive `adsready` from the ad\n // implementation after play has been requested. Ad implementations are\n // expected to load any dynamic libraries and make any requests to determine\n // ad policies for a video during this time.\n timeout: 500,\n\n //TODO:finish this IOS FIX\n //Whenever you play an add on IOS, the native player kicks in and we loose control of it. On very heavy pages the 'play' event\n // May occur after the video content has already started. This is wrong if you want to play a preroll ad that needs to happen before the user\n // starts watching the content. To prevent this usec\n iosPrerollCancelTimeout: 2000,\n\n // maximun amount of time for the ad to actually start playing. If this timeout gets\n // triggered the ads will be cancelled\n adCancelTimeout: 3000,\n\n // Boolean flag that configures the player to play a new ad before the user sees the video again\n // the current video\n playAdAlways: false,\n\n // Flag to enable or disable the ads by default.\n adsEnabled: true,\n\n // Boolean flag to enable or disable the resize with window.resize or orientationchange\n autoResize: true,\n\n // Path to the VPAID flash ad's loader\n vpaidFlashLoaderPath: '/VPAIDFlash.swf'\n };\n\n var settings = extend({}, defaultOpts, options || {});\n\n if(isUndefined(settings.adTagUrl) && isDefined(settings.url)){\n settings.adTagUrl = settings.url;\n }\n\n if (isString(settings.adTagUrl)) {\n settings.adTagUrl = echoFn(settings.adTagUrl);\n }\n\n if (isDefined(settings.adTagXML) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, the passed adTagXML option does not contain a function'));\n }\n\n if (!isDefined(settings.adTagUrl) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, missing adTagUrl on options object'));\n }\n\n playerUtils.prepareForAds(player);\n\n if (settings.playAdAlways) {\n // No matter what happens we play a new ad before the user sees the video again.\n player.on('vast.contentEnd', function () {\n setTimeout(function () {\n player.trigger('vast.reset');\n }, 0);\n });\n }\n\n player.on('vast.firstPlay', tryToPlayPrerollAd);\n\n player.on('vast.reset', function () {\n //If we are reseting the plugin, we don't want to restore the content\n snapshot = null;\n cancelAds();\n });\n\n player.vast = {\n isEnabled: function () {\n return settings.adsEnabled;\n },\n\n enable: function () {\n settings.adsEnabled = true;\n },\n\n disable: function () {\n settings.adsEnabled = false;\n }\n };\n\n return player.vast;\n\n /**** Local functions ****/\n function tryToPlayPrerollAd() {\n //We remove the poster to prevent flickering whenever the content starts playing\n playerUtils.removeNativePoster(player);\n\n playerUtils.once(player, ['vast.adsCancel', 'vast.adEnd'], function () {\n removeAdUnit();\n restoreVideoContent();\n });\n\n async.waterfall([\n checkAdsEnabled,\n preparePlayerForAd,\n playPrerollAd\n ], function (error, response) {\n if (error) {\n trackAdError(error, response);\n } else {\n player.trigger('vast.adEnd');\n }\n });\n\n /*** Local functions ***/\n\n function removeAdUnit() {\n if (player.vast && player.vast.adUnit) {\n player.vast.adUnit = null; //We remove the adUnit\n }\n }\n\n function restoreVideoContent() {\n setupContentEvents();\n if (snapshot) {\n playerUtils.restorePlayerSnapshot(player, snapshot);\n snapshot = null;\n }\n }\n\n function setupContentEvents() {\n playerUtils.once(player, ['playing', 'vast.reset', 'vast.firstPlay'], function (evt) {\n if (evt.type !== 'playing') {\n return;\n }\n\n player.trigger('vast.contentStart');\n\n playerUtils.once(player, ['ended', 'vast.reset', 'vast.firstPlay'], function (evt) {\n if (evt.type === 'ended') {\n player.trigger('vast.contentEnd');\n }\n });\n });\n }\n\n function checkAdsEnabled(next) {\n if (settings.adsEnabled) {\n return next(null);\n }\n next(new VASTError('Ads are not enabled'));\n }\n\n function preparePlayerForAd(next) {\n if (canPlayPrerollAd()) {\n snapshot = playerUtils.getPlayerSnapshot(player);\n player.pause();\n addSpinnerIcon();\n startAdCancelTimeout();\n next(null);\n } else {\n next(new VASTError('video content has been playing before preroll ad'));\n }\n }\n\n function canPlayPrerollAd() {\n return !isIPhone() || player.currentTime() <= settings.iosPrerollCancelTimeout;\n }\n\n function startAdCancelTimeout() {\n var adCancelTimeoutId;\n adsCanceled = false;\n\n adCancelTimeoutId = setTimeout(function () {\n trackAdError(new VASTError('timeout while waiting for the video to start playing', 402));\n }, settings.adCancelTimeout);\n\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], clearAdCancelTimeout);\n\n /*** local functions ***/\n function clearAdCancelTimeout() {\n if (adCancelTimeoutId) {\n clearTimeout(adCancelTimeoutId);\n adCancelTimeoutId = null;\n }\n }\n }\n\n function addSpinnerIcon() {\n dom.addClass(player.el(), 'vjs-vast-ad-loading');\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], removeSpinnerIcon);\n }\n\n function removeSpinnerIcon() {\n //IMPORTANT NOTE: We remove the spinnerIcon asynchronously to give time to the browser to start the video.\n // If we remove it synchronously we see a flash of the content video before the ad starts playing.\n setTimeout(function () {\n dom.removeClass(player.el(), 'vjs-vast-ad-loading');\n }, 100);\n }\n\n }\n\n function cancelAds() {\n player.trigger('vast.adsCancel');\n adsCanceled = true;\n }\n\n function playPrerollAd(callback) {\n async.waterfall([\n getVastResponse,\n playAd\n ], callback);\n }\n\n function getVastResponse(callback) {\n vast.getVASTResponse(settings.adTagUrl ? settings.adTagUrl() : settings.adTagXML, callback);\n }\n\n function playAd(vastResponse, callback) {\n //TODO: Find a better way to stop the play. The 'playPrerollWaterfall' ends in an inconsistent situation\n //If the state is not 'preroll?' it means the ads were canceled therefore, we break the waterfall\n if (adsCanceled) {\n return;\n }\n\n var adIntegrator = isVPAID(vastResponse) ? new VPAIDIntegrator(player, settings) : new VASTIntegrator(player);\n var adFinished = false;\n\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], function (evt) {\n if (evt.type === 'vast.adStart') {\n addAdsLabel();\n }\n });\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeAdsLabel);\n\n if (isIDevice()) {\n preventManualProgress();\n }\n\n player.vast.adUnit = adIntegrator.playAd(vastResponse, callback);\n\n /*** Local functions ****/\n function addAdsLabel() {\n if (adFinished || player.controlBar.getChild('AdsLabel')) {\n return;\n }\n player.controlBar.addChild('AdsLabel');\n }\n\n function removeAdsLabel() {\n player.controlBar.removeChild('AdsLabel');\n adFinished = true;\n }\n\n function preventManualProgress() {\n //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that the user forwarded/rewound the ad\n var PROGRESS_THRESHOLD = 3;\n var previousTime = 0;\n var tech = player.el().querySelector('.vjs-tech');\n var skipad_attempts = 0;\n\n player.on('timeupdate', adTimeupdateHandler);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adError'], stopPreventManualProgress);\n\n /*** Local functions ***/\n function adTimeupdateHandler() {\n var currentTime = player.currentTime();\n var progressDelta = Math.abs(currentTime - previousTime);\n\n if (progressDelta > PROGRESS_THRESHOLD) {\n skipad_attempts += 1;\n if (skipad_attempts >= 2) {\n player.pause();\n }\n player.currentTime(previousTime);\n } else {\n previousTime = currentTime;\n }\n }\n\n function stopPreventManualProgress() {\n player.off('timeupdate', adTimeupdateHandler);\n }\n }\n }\n\n function trackAdError(error, vastResponse) {\n player.trigger({type: 'vast.adError', error: error});\n cancelAds();\n if (console && console.log) {\n console.log('AD ERROR:', error.message, error, vastResponse);\n }\n }\n\n function isVPAID(vastResponse) {\n var i, len;\n var mediaFiles = vastResponse.mediaFiles;\n for (i = 0, len = mediaFiles.length; i < len; i++) {\n if (vastUtil.isVPAID(mediaFiles[i])) {\n return true;\n }\n }\n return false;\n }\n});\n\n;\nvjs.AdsLabel = vjs.Component.extend({\n /** @constructor */\n init: function (player, options) {\n vjs.Component.call(this, player, options);\n\n var that = this;\n\n // We asynchronously reposition the ads label element\n setTimeout(function () {\n var currentTimeComp = player.controlBar &&( player.controlBar.getChild(\"timerControls\") || player.controlBar.getChild(\"currentTimeDisplay\") );\n if(currentTimeComp) {\n player.controlBar.el().insertBefore(that.el(), currentTimeComp.el());\n }\n dom.removeClass(that.el(), 'vjs-label-hidden');\n }, 0);\n }\n});\n\nvjs.AdsLabel.prototype.createEl = function(){\n return vjs.Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-ads-label vjs-control vjs-label-hidden',\n innerHTML: 'Advertisement'\n });\n};\n;\n/**\n * The component that shows a black screen until the ads plugin has decided if it can or it can not play the ad.\n *\n * Note: In case you wonder why instead of this black poster we don't just show the spinner loader.\n * IOS devices do not work well with animations and the browser chrashes from time to time That is why we chose to\n * have a secondary black poster.\n *\n * It also makes it much more easier for the users of the plugin since it does not change the default behaviour of the\n * spinner and the player works the same way with and without the plugin.\n *\n * @param {vjs.Player|Object} player\n * @param {Object=} options\n * @constructor\n */\nvjs.BlackPoster = vjs.Component.extend({\n /** @constructor */\n init: function(player, options){\n vjs.Component.call(this, player, options);\n\n var posterImg = player.getChild('posterImage');\n\n //We need to do it asynchronously to be sure that the black poster el is on the dom.\n setTimeout(function() {\n if(posterImg) {\n player.el().insertBefore(this.el(), posterImg.el());\n }\n }.bind(this), 0);\n }\n});\n\n/**\n * Create the black poster div element\n * @return {Element}\n */\nvjs.BlackPoster.prototype.createEl = function(){\n return vjs.createEl('div', {\n className: 'vjs-black-poster'\n });\n};\n;\nfunction VPAIDAdUnitWrapper(vpaidAdUnit, opts) {\n if (!(this instanceof VPAIDAdUnitWrapper)) {\n return new VPAIDAdUnitWrapper(vpaidAdUnit, opts);\n }\n sanityCheck(vpaidAdUnit, opts);\n\n this.options = extend({}, opts);\n\n this._adUnit = vpaidAdUnit;\n\n /*** Local Functions ***/\n function sanityCheck(adUnit, opts) {\n if (!adUnit || !VPAIDAdUnitWrapper.checkVPAIDInterface(adUnit)) {\n throw new VASTError('on VPAIDAdUnitWrapper, the passed VPAID adUnit does not fully implement the VPAID interface');\n }\n\n if (!isObject(opts)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected options hash but got '\" + opts + \"'\");\n }\n\n if (!(\"responseTimeout\" in opts) || !isNumber(opts.responseTimeout) ){\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected responseTimeout in options\");\n }\n }\n}\n\nVPAIDAdUnitWrapper.checkVPAIDInterface = function checkVPAIDInterface(VPAIDAdUnit) {\n //NOTE: skipAd is not part of the method list because it only appears in VPAID 2.0 and we support VPAID 1.0\n var VPAIDInterfaceMethods = [\n 'handshakeVersion', 'initAd', 'startAd', 'stopAd', 'resizeAd', 'pauseAd', 'expandAd', 'collapseAd'\n ];\n\n for (var i = 0, len = VPAIDInterfaceMethods.length; i < len; i++) {\n if (!VPAIDAdUnit || !isFunction(VPAIDAdUnit[VPAIDInterfaceMethods[i]])) {\n return false;\n }\n }\n\n\n return canSubscribeToEvents(VPAIDAdUnit) && canUnsubscribeFromEvents(VPAIDAdUnit);\n\n /*** Local Functions ***/\n\n function canSubscribeToEvents(adUnit) {\n return isFunction(adUnit.subscribe) || isFunction(adUnit.addEventListener) || isFunction(adUnit.on);\n }\n\n function canUnsubscribeFromEvents(adUnit) {\n return isFunction(adUnit.unsubscribe) || isFunction(adUnit.removeEventListener) || isFunction(adUnit.off);\n\n }\n};\n\nVPAIDAdUnitWrapper.prototype.adUnitAsyncCall = function () {\n var args = arrayLikeObjToArray(arguments);\n var method = args.shift();\n var cb = args.pop();\n var timeoutId;\n\n sanityCheck(method, cb, this._adUnit);\n args.push(wrapCallback());\n\n this._adUnit[method].apply(this._adUnit, args);\n timeoutId = setTimeout(function () {\n timeoutId = null;\n cb(new VASTError(\"on VPAIDAdUnitWrapper, timeout while waiting for a response on call '\" + method + \"'\"));\n cb = noop;\n }, this.options.responseTimeout);\n\n /*** Local functions ***/\n function sanityCheck(method, cb, adUnit) {\n if (!isString(method) || !isFunction(adUnit[method])) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, invalid method name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, missing callback\");\n }\n }\n\n function wrapCallback() {\n return function () {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n cb.apply(this, arguments);\n };\n }\n};\n\nVPAIDAdUnitWrapper.prototype.on = function (evtName, handler) {\n var addEventListener = this._adUnit.addEventListener || this._adUnit.subscribe || this._adUnit.on;\n addEventListener.call(this._adUnit, evtName, handler);\n};\n\nVPAIDAdUnitWrapper.prototype.off = function (evtName, handler) {\n var removeEventListener = this._adUnit.removeEventListener || this._adUnit.unsubscribe || this._adUnit.off;\n removeEventListener.call(this._adUnit, evtName, handler);\n};\n\nVPAIDAdUnitWrapper.prototype.waitForEvent = function (evtName, cb, context) {\n var timeoutId;\n sanityCheck(evtName, cb);\n context = context || null;\n\n this.on(evtName, responseListener);\n\n timeoutId = setTimeout(function () {\n cb(new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, timeout while waiting for event '\" + evtName + \"'\"));\n timeoutId = null;\n cb = noop;\n }, this.options.responseTimeout);\n\n /*** Local functions ***/\n function sanityCheck(evtName, cb) {\n if (!isString(evtName)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing evt name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing callback\");\n }\n }\n\n function responseListener() {\n var args = arrayLikeObjToArray(arguments);\n\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n args.unshift(null);\n cb.apply(context, args);\n }\n};\n\n// VPAID METHODS\nVPAIDAdUnitWrapper.prototype.handshakeVersion = function (version, cb) {\n this.adUnitAsyncCall('handshakeVersion', version, cb);\n};\n\n/* jshint maxparams:6 */\nVPAIDAdUnitWrapper.prototype.initAd = function (width, height, viewMode, desiredBitrate, adUnitData, cb) {\n this.waitForEvent('AdLoaded', cb);\n this._adUnit.initAd(width, height, viewMode, desiredBitrate, adUnitData);\n};\n\nVPAIDAdUnitWrapper.prototype.resizeAd = function (width, height, viewMode, cb) {\n // NOTE: AdSizeChange event is only supported on VPAID 2.0 so for the moment we are not going to use it\n // and will assume that everything is fine after the async call\n this.adUnitAsyncCall('resizeAd', width, height, viewMode, cb);\n};\n\nVPAIDAdUnitWrapper.prototype.startAd = function (cb) {\n this.waitForEvent('AdStarted', cb);\n this._adUnit.startAd();\n};\n\nVPAIDAdUnitWrapper.prototype.stopAd = function (cb) {\n this.waitForEvent('AdStopped', cb);\n this._adUnit.stopAd();\n};\n\nVPAIDAdUnitWrapper.prototype.pauseAd = function (cb) {\n this.waitForEvent('AdPaused', cb);\n this._adUnit.pauseAd();\n};\n\nVPAIDAdUnitWrapper.prototype.resumeAd = function (cb) {\n this.waitForEvent('AdPlaying', cb);\n this._adUnit.resumeAd();\n};\n\nVPAIDAdUnitWrapper.prototype.expandAd = function (cb) {\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.expandAd();\n};\n\nVPAIDAdUnitWrapper.prototype.collapseAd = function (cb) {\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.collapseAd();\n};\n\nVPAIDAdUnitWrapper.prototype.skipAd = function (cb) {\n this.waitForEvent('AdSkipped', cb);\n this._adUnit.skipAd();\n};\n\n//VPAID property getters\n[\n 'adLinear',\n 'adWidth',\n 'adHeight',\n 'adExpanded',\n 'adSkippableState',\n 'adRemainingTime',\n 'adDuration',\n 'adVolume',\n 'adCompanions',\n 'adIcons'\n].forEach(function (property) {\n var getterName = 'get' + capitalize(property);\n\n VPAIDAdUnitWrapper.prototype[getterName] = function (cb) {\n this.adUnitAsyncCall(getterName, cb);\n };\n});\n\n//VPAID property setters\nVPAIDAdUnitWrapper.prototype.setAdVolume = function(volume, cb){\n this.adUnitAsyncCall('setAdVolume',volume, cb);\n};\n\n;\nfunction VPAIDFlashTech(mediaFile, settings) {\n if (!(this instanceof VPAIDFlashTech)) {\n return new VPAIDFlashTech(mediaFile);\n }\n sanityCheck(mediaFile);\n this.name = 'vpaid-flash';\n this.mediaFile = mediaFile;\n this.containerEl = null;\n this.vpaidFlashClient = null;\n this.settings = settings;\n\n /*** local functions ***/\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError('on VPAIDFlashTech, invalid MediaFile');\n }\n }\n}\n\nVPAIDFlashTech.supports = function (type) {\n return type === 'application/x-shockwave-flash' && VPAIDFLASHClient.isSupported();\n};\n\nVPAIDFlashTech.prototype.loadAdUnit = function loadFlashCreative(containerEl, objectEl, callback) {\n var that = this;\n var flashClientOpts = this.settings && this.settings.vpaidFlashLoaderPath ? {data: this.settings.vpaidFlashLoaderPath} : undefined;\n sanityCheck(containerEl, callback);\n\n this.containerEl = containerEl;\n this.vpaidFlashClient = new VPAIDFLASHClient(containerEl, function (error) {\n if (error) {\n return callback(error);\n }\n\n that.vpaidFlashClient.loadAdUnit(that.mediaFile.src, callback);\n }, flashClientOpts);\n\n /*** Local Functions ***/\n function sanityCheck(container, cb) {\n\n if (!dom.isDomElement(container)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, invalid dom container element');\n }\n\n if (!isFunction(cb)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, missing valid callback');\n }\n }\n};\n\nVPAIDFlashTech.prototype.unloadAdUnit = function () {\n if (this.vpaidFlashClient) {\n try{\n this.vpaidFlashClient.destroy();\n } catch(e){\n if(console && isFunction(console.log)){\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n this.vpaidFlashClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n};\n\n;\nfunction VPAIDHTML5Tech(mediaFile) {\n\n if(!(this instanceof VPAIDHTML5Tech)) {\n return new VPAIDHTML5Tech(mediaFile);\n }\n\n sanityCheck(mediaFile);\n\n this.name = 'vpaid-html5';\n this.containerEl = null;\n this.videoEl = null;\n this.vpaidHTMLClient = null;\n\n this.mediaFile = mediaFile;\n\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_MEDIA_FILE);\n }\n }\n}\n\nVPAIDHTML5Tech.supports = function (type) {\n return !isOldIE() && type === 'application/javascript';\n};\n\nVPAIDHTML5Tech.prototype.loadAdUnit = function loadAdUnit(containerEl, videoEl, callback) {\n sanityCheck(containerEl, videoEl, callback);\n\n this.containerEl = containerEl;\n this.videoEl = videoEl;\n this.vpaidHTMLClient = new VPAIDHTML5Client(containerEl, videoEl, {});\n this.vpaidHTMLClient.loadAdUnit(this.mediaFile.src, callback);\n\n function sanityCheck(container, video, cb) {\n if (!dom.isDomElement(container)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!dom.isDomElement(video) || video.tagName.toLowerCase() !== 'video') {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(VPAIDHTML5Tech.MISSING_CALLBACK);\n }\n }\n};\n\nVPAIDHTML5Tech.prototype.unloadAdUnit = function unloadAdUnit() {\n if (this.vpaidHTMLClient) {\n try {\n this.vpaidHTMLClient.destroy();\n } catch(e) {\n if (console && isFunction(console.log)) {\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n\n this.vpaidHTMLClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n};\n\nvar PREFIX = 'on VPAIDHTML5Tech';\nVPAIDHTML5Tech.INVALID_MEDIA_FILE = PREFIX + ', invalid MediaFile';\nVPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL = PREFIX + ', invalid container HtmlElement';\nVPAIDHTML5Tech.INVALID_DOM_VIDEO_EL = PREFIX + ', invalid HTMLVideoElement';\nVPAIDHTML5Tech.MISSING_CALLBACK = PREFIX + ', missing valid callback';\n\n\n;\nfunction VPAIDIntegrator(player, settings) {\n if (!(this instanceof VPAIDIntegrator)) {\n return new VPAIDIntegrator(player);\n }\n\n this.VIEW_MODE = {\n NORMAL: 'normal',\n FULLSCREEN: \"fullscreen\",\n THUMBNAIL: \"thumbnail\"\n };\n this.player = player;\n this.containerEl = createVPAIDContainerEl(player);\n this.options = {\n responseTimeout: 5000,\n VPAID_VERSION: '2.0'\n };\n this.settings = settings;\n\n /*** Local functions ***/\n\n function createVPAIDContainerEl() {\n var containerEl = document.createElement('div');\n dom.addClass(containerEl, 'VPAID-container');\n player.el().insertBefore(containerEl, player.controlBar.el());\n return containerEl;\n\n }\n}\n\n//List of supported VPAID technologies\nVPAIDIntegrator.techs = [\n VPAIDFlashTech,\n VPAIDHTML5Tech\n];\n\nVPAIDIntegrator.prototype.playAd = function playVPaidAd(vastResponse, callback) {\n var that = this;\n var tech;\n var player = this.player;\n\n callback = callback || noop;\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('on VASTIntegrator.playAd, missing required VASTResponse'));\n }\n\n tech = this._findSupportedTech(vastResponse, this.settings);\n dom.addClass(player.el(), 'vjs-vpaid-ad');\n\n player.on('vast.adsCancel', triggerVpaidAdEnd);\n player.one('vpaid.adEnd', function(){\n player.off('vast.adsCancel', triggerVpaidAdEnd);\n removeAdUnit();\n });\n\n if (tech) {\n async.waterfall([\n function (next) {\n next(null, tech, vastResponse);\n },\n this._loadAdUnit.bind(this),\n this._playAdUnit.bind(this),\n this._finishPlaying.bind(this)\n\n ], function (error, adUnit, vastResponse) {\n if (error) {\n that._trackError(vastResponse);\n }\n player.trigger('vpaid.adEnd');\n callback(error, vastResponse);\n });\n\n this._adUnit = {\n _paused: true,\n type: 'VPAID',\n pauseAd: function() {\n player.trigger('vpaid.pauseAd');\n player.pause(true);//we make sure that the video content gets stopped.\n },\n resumeAd: function() {\n player.trigger('vpaid.resumeAd');\n },\n isPaused: function() {\n return this._paused;\n },\n getSrc: function() {\n return tech.mediaFile;\n }\n };\n\n return this._adUnit;\n }\n\n callback(new VASTError('on VPAIDIntegrator.playAd, could not find a supported mediaFile'));\n\n return null;\n /*** Local functions ***/\n function triggerVpaidAdEnd(){\n player.trigger('vpaid.adEnd');\n }\n\n function removeAdUnit() {\n if (tech) {\n tech.unloadAdUnit();\n }\n dom.removeClass(player.el(), 'vjs-vpaid-ad');\n }\n};\n\nVPAIDIntegrator.prototype._findSupportedTech = function (vastResponse, settings) {\n if (!(vastResponse instanceof VASTResponse)) {\n return null;\n }\n\n var vpaidMediaFiles = vastResponse.mediaFiles.filter(vastUtil.isVPAID);\n var i, len, mediaFile, VPAIDTech;\n\n for (i = 0, len = vpaidMediaFiles.length; i < len; i += 1) {\n mediaFile = vpaidMediaFiles[i];\n VPAIDTech = findSupportedTech(mediaFile);\n if (VPAIDTech) {\n return new VPAIDTech(mediaFile, settings);\n }\n }\n\n return null;\n\n /*** Local functions ***/\n function findSupportedTech(mediafile) {\n var type = mediafile.type;\n var i, len, VPAIDTech;\n\n for (i = 0, len = VPAIDIntegrator.techs.length; i < len; i += 1) {\n VPAIDTech = VPAIDIntegrator.techs[i];\n if (VPAIDTech.supports(type)) {\n return VPAIDTech;\n }\n }\n return null;\n }\n};\n\nVPAIDIntegrator.prototype._loadAdUnit = function (tech, vastResponse, next) {\n var player = this.player;\n var vjsTechEl = player.el().querySelector('.vjs-tech');\n var responseTimeout = this.settings.responseTimeout || this.options.responseTimeout;\n tech.loadAdUnit(this.containerEl, vjsTechEl, function (error, adUnit) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n try {\n var WrappedAdUnit = new VPAIDAdUnitWrapper(adUnit, {src: tech.mediaFile.src, responseTimeout: responseTimeout});\n var techClass = 'vjs-' + tech.name + '-ad';\n dom.addClass(player.el(), techClass);\n player.one('vpaid.adEnd', function() {\n dom.removeClass(player.el(),techClass);\n });\n next(null, WrappedAdUnit, vastResponse);\n } catch (e) {\n next(e, adUnit, vastResponse);\n }\n });\n};\n\nVPAIDIntegrator.prototype._playAdUnit = function (adUnit, vastResponse, callback) {\n async.waterfall([\n function (next) {\n next(null, adUnit, vastResponse);\n },\n this._handshake.bind(this),\n this._initAd.bind(this),\n this._setupEvents.bind(this),\n this._addSkipButton.bind(this),\n this._linkPlayerControls.bind(this),\n this._startAd.bind(this)\n ], callback);\n};\n\nVPAIDIntegrator.prototype._handshake = function handshake(adUnit, vastResponse, next) {\n adUnit.handshakeVersion(this.options.VPAID_VERSION, function (error, version) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n if (version && isSupportedVersion(version)) {\n return next(null, adUnit, vastResponse);\n }\n\n return next(new VASTError('on VPAIDIntegrator._handshake, unsupported version \"' + version + '\"'), adUnit, vastResponse);\n });\n\n function isSupportedVersion(version) {\n var majorNum = major(version);\n return majorNum >= 1 && majorNum <= 2;\n }\n\n function major(version) {\n var parts = version.split('.');\n return parseInt(parts[0], 10);\n }\n};\n\nVPAIDIntegrator.prototype._initAd = function (adUnit, vastResponse, next) {\n var tech = this.player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, {AdParameters: vastResponse.adParameters || ''}, function (error) {\n next(error, adUnit, vastResponse);\n });\n};\n\nVPAIDIntegrator.prototype._setupEvents = function (adUnit, vastResponse, next) {\n var adUnitSrc = adUnit.options.src;\n var tracker = new VASTTracker(adUnitSrc, vastResponse);\n var player = this.player;\n var that = this;\n\n adUnit.on('AdSkipped', function () {\n player.trigger('vpaid.AdSkipped');\n tracker.trackSkip();\n });\n\n adUnit.on('AdImpression', function () {\n player.trigger('vpaid.AdImpression');\n tracker.trackImpressions();\n });\n\n adUnit.on('AdStarted', function () {\n player.trigger('vpaid.AdStarted');\n tracker.trackCreativeView();\n notifyPlayToPlayer();\n });\n\n adUnit.on('AdVideoStart', function () {\n player.trigger('vpaid.AdVideoStart');\n tracker.trackStart();\n notifyPlayToPlayer();\n });\n\n adUnit.on('AdPlaying', function () {\n player.trigger('vpaid.AdPlaying');\n tracker.trackResume();\n notifyPlayToPlayer();\n });\n\n adUnit.on('AdPaused', function () {\n player.trigger('vpaid.AdPaused');\n tracker.trackPause();\n notifyPauseToPlayer();\n });\n\n function notifyPlayToPlayer(){\n if(that._adUnit && that._adUnit.isPaused()){\n that._adUnit._paused = false;\n }\n player.trigger('play');\n\n }\n\n function notifyPauseToPlayer() {\n if(that._adUnit){\n that._adUnit._paused = true;\n }\n player.trigger('pause');\n }\n\n adUnit.on('AdVideoFirstQuartile', function () {\n player.trigger('vpaid.AdVideoFirstQuartile');\n tracker.trackFirstQuartile();\n });\n\n adUnit.on('AdVideoMidpoint', function () {\n player.trigger('vpaid.AdVideoMidpoint');\n tracker.trackMidpoint();\n });\n\n adUnit.on('AdVideoThirdQuartile', function () {\n player.trigger('vpaid.AdVideoThirdQuartile');\n tracker.trackThirdQuartile();\n });\n\n adUnit.on('AdVideoComplete', function () {\n player.trigger('vpaid.AdVideoComplete');\n tracker.trackComplete();\n });\n\n adUnit.on('AdClickThru', function (data) {\n player.trigger('vpaid.AdClickThru');\n var url = data.url;\n var playerHandles = data.playerHandles;\n var clickThruUrl = isNotEmptyString(url) ? url : generateClickThroughURL(vastResponse.clickThrough);\n\n tracker.trackClick();\n if (playerHandles && clickThruUrl) {\n window.open(clickThruUrl, '_blank');\n }\n\n function generateClickThroughURL(clickThroughMacro) {\n var variables = {\n ASSETURI: adUnit.options.src,\n CONTENTPLAYHEAD: 0 //In VPAID there is no method to know the current time from the adUnit\n };\n\n return clickThroughMacro ? vastUtil.parseURLMacro(clickThroughMacro, variables) : null;\n }\n });\n\n adUnit.on('AdUserAcceptInvitation', function () {\n player.trigger('vpaid.AdUserAcceptInvitation');\n tracker.trackAcceptInvitation();\n tracker.trackAcceptInvitationLinear();\n });\n\n adUnit.on('AdUserClose', function () {\n player.trigger('vpaid.AdUserClose');\n tracker.trackClose();\n tracker.trackCloseLinear();\n });\n\n adUnit.on('AdUserMinimize', function () {\n player.trigger('vpaid.AdUserMinimize');\n tracker.trackCollapse();\n });\n\n adUnit.on('AdError', function () {\n player.trigger('vpaid.AdError');\n //NOTE: we track errors code 901, as noted in VAST 3.0\n tracker.trackErrorWithCode(901);\n });\n\n adUnit.on('AdVolumeChange', function () {\n player.trigger('vpaid.AdVolumeChange');\n var lastVolume = player.volume();\n adUnit.getAdVolume(function (error, currentVolume) {\n if (currentVolume === 0 && lastVolume > 0) {\n tracker.trackMute();\n }\n\n if (currentVolume > 0 && lastVolume === 0) {\n tracker.trackUnmute();\n }\n\n player.volume(currentVolume);\n });\n });\n\n var updateViewSize = resizeAd.bind(this, player, adUnit, this.VIEW_MODE);\n var updateViewSizeThrottled = throttle(updateViewSize, 100);\n var autoResize = this.settings.autoResize;\n\n if (autoResize) {\n dom.addEventListener(window, 'resize', updateViewSizeThrottled);\n dom.addEventListener(window, 'orientationchange', updateViewSizeThrottled);\n }\n\n player.on('vast.resize', updateViewSize);\n player.on('vpaid.pauseAd', pauseAdUnit);\n player.on('vpaid.resumeAd', resumeAdUnit);\n\n player.one('vpaid.adEnd', function () {\n player.off('vast.resize', updateViewSize);\n player.off('vpaid.pauseAd', pauseAdUnit);\n player.off('vpaid.resumeAd', resumeAdUnit);\n\n if (autoResize) {\n dom.removeEventListener(window, 'resize', updateViewSizeThrottled);\n dom.removeEventListener(window, 'orientationchange', updateViewSizeThrottled);\n }\n });\n\n next(null, adUnit, vastResponse);\n\n /*** Local Functions ***/\n function pauseAdUnit() {\n adUnit.pauseAd(noop);\n }\n\n function resumeAdUnit() {\n adUnit.resumeAd(noop);\n }\n};\n\nVPAIDIntegrator.prototype._addSkipButton = function (adUnit, vastResponse, next) {\n var skipButton;\n var player = this.player;\n\n adUnit.on('AdSkippableStateChange', updateSkipButtonState);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeSkipButton);\n\n next(null, adUnit, vastResponse);\n\n /*** Local function ***/\n function updateSkipButtonState() {\n player.trigger('vpaid.AdSkippableStateChange');\n adUnit.getAdSkippableState(function (error, isSkippable) {\n if (isSkippable) {\n if (!skipButton) {\n addSkipButton(player);\n }\n } else {\n removeSkipButton(player);\n }\n });\n }\n\n function addSkipButton(player) {\n skipButton = createSkipButton(player);\n player.el().appendChild(skipButton);\n }\n\n function removeSkipButton() {\n dom.remove(skipButton);\n skipButton = null;\n }\n\n function createSkipButton() {\n var skipButton = window.document.createElement(\"div\");\n dom.addClass(skipButton, \"vast-skip-button\");\n dom.addClass(skipButton, \"enabled\");\n skipButton.innerHTML = \"Skip ad\";\n\n skipButton.onclick = function (e) {\n adUnit.skipAd(noop);//We skip the adUnit\n\n //We prevent event propagation to avoid problems with the clickThrough and so on\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n } else {\n return false;\n }\n };\n\n return skipButton;\n }\n};\n\nVPAIDIntegrator.prototype._linkPlayerControls = function (adUnit, vastResponse, next) {\n linkVolumeControl(this.player, adUnit);\n linkFullScreenControl(this.player, adUnit, this.VIEW_MODE);\n\n next(null, adUnit, vastResponse);\n\n /*** Local functions ***/\n function linkVolumeControl(player, adUnit) {\n player.on('volumechange', updateAdUnitVolume);\n adUnit.on('AdVolumeChange', updatePlayerVolume);\n\n player.one('vpaid.adEnd', function () {\n player.off('volumechange', updateAdUnitVolume);\n });\n\n\n /*** local functions ***/\n function updateAdUnitVolume() {\n var vol = player.muted() ? 0 : player.volume();\n adUnit.setAdVolume(vol, logError);\n }\n\n function updatePlayerVolume() {\n player.trigger('vpaid.AdVolumeChange');\n adUnit.getAdVolume(function (error, vol) {\n if (error) {\n logError(error);\n } else {\n player.volume(vol);\n }\n });\n }\n }\n\n function linkFullScreenControl(player, adUnit, VIEW_MODE) {\n var updateViewSize = resizeAd.bind(this, player, adUnit, VIEW_MODE);\n\n player.on('fullscreenchange', updateViewSize);\n\n player.one('vpaid.adEnd', function () {\n player.off('fullscreenchange', updateViewSize);\n });\n }\n};\n\nVPAIDIntegrator.prototype._startAd = function (adUnit, vastResponse, next) {\n var player = this.player;\n\n adUnit.startAd(function (error) {\n if (!error) {\n player.trigger('vast.adStart');\n }\n next(error, adUnit, vastResponse);\n });\n};\n\nVPAIDIntegrator.prototype._finishPlaying = function (adUnit, vastResponse, next) {\n var player = this.player;\n adUnit.on('AdStopped', function () {\n player.trigger('vpaid.AdStopped');\n finishPlayingAd(null);\n });\n\n adUnit.on('AdError', function (error) {\n var errMsg = error? error.message : 'on VPAIDIntegrator, error while waiting for the adUnit to finish playing';\n finishPlayingAd(new VASTError(errMsg));\n });\n\n /*** local functions ***/\n function finishPlayingAd(error) {\n next(error, adUnit, vastResponse);\n }\n};\n\nVPAIDIntegrator.prototype._trackError = function trackError(response) {\n vastUtil.track(response.errorURLMacros, {ERRORCODE: 901});\n};\n\nfunction resizeAd(player, adUnit, VIEW_MODE) {\n var tech = player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n var MODE = player.isFullscreen() ? VIEW_MODE.FULLSCREEN : VIEW_MODE.NORMAL;\n adUnit.resizeAd(dimension.width, dimension.height, MODE, logError);\n}\n\nfunction logError(error) {\n if (error && console && console.log) {\n console.log('ERROR: ' + error.message, error);\n }\n}\n\n;\nfunction Ad(adJTree) {\n if (!(this instanceof Ad)) {\n return new Ad(adJTree);\n }\n\n this.id = adJTree.attr('id');\n this.sequence = adJTree.attr('sequence');\n\n if(adJTree.inLine) {\n this.inLine = new InLine(adJTree.inLine);\n }\n\n if(adJTree.wrapper){\n this.wrapper = new Wrapper(adJTree.wrapper);\n }\n}\n;\n\nfunction Creative(creativeJTree) {\n if(!(this instanceof Creative)) {\n return new Creative(creativeJTree);\n }\n\n this.id = creativeJTree.attr('id');\n this.sequence = creativeJTree.attr('sequence');\n this.adId = creativeJTree.attr('adId');\n this.apiFramework = creativeJTree.attr('apiFramework');\n\n if(creativeJTree.linear) {\n this.linear = new Linear(creativeJTree.linear);\n }\n}\n;\nfunction InLine(inlineJTree) {\n if (!(this instanceof InLine)) {\n return new InLine(inlineJTree);\n }\n\n //Required Fields\n this.adTitle = xml.keyValue(inlineJTree.adTitle);\n this.adSystem = xml.keyValue(inlineJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(inlineJTree.impression);\n this.creatives = vastUtil.parseCreatives(inlineJTree.creatives);\n\n //Optional Fields\n this.description = xml.keyValue(inlineJTree.description);\n this.advertiser = xml.keyValue(inlineJTree.advertiser);\n this.surveys = parseSurveys(inlineJTree.survey);\n this.error = xml.keyValue(inlineJTree.error);\n this.pricing = xml.keyValue(inlineJTree.pricing);\n this.extensions = inlineJTree.extensions;\n\n /*** Local Functions ***/\n function parseSurveys(inlineSurveys) {\n if (inlineSurveys) {\n return transformArray(isArray(inlineSurveys) ? inlineSurveys : [inlineSurveys], function (survey) {\n if(isNotEmptyString(survey.keyValue)){\n return {\n uri: survey.keyValue,\n type: survey.attr('type')\n };\n }\n\n return undefined;\n });\n }\n return [];\n }\n}\n;\nfunction Linear(linearJTree) {\n if (!(this instanceof Linear)) {\n return new Linear(linearJTree);\n }\n\n //Required Elements\n this.duration = vastUtil.parseDuration(xml.keyValue(linearJTree.duration));\n this.mediaFiles = parseMediaFiles(linearJTree.mediaFiles && linearJTree.mediaFiles.mediaFile);\n\n //Optional fields\n this.trackingEvents = parseTrackingEvents(linearJTree.trackingEvents && linearJTree.trackingEvents.tracking, this.duration);\n this.skipoffset = vastUtil.parseOffset(xml.attr(linearJTree, 'skipoffset'), this.duration);\n\n if (linearJTree.videoClicks) {\n this.videoClicks = new VideoClicks(linearJTree.videoClicks);\n }\n \n if(linearJTree.adParameters) {\n this.adParameters = xml.keyValue(linearJTree.adParameters);\n\n if(xml.attr(linearJTree.adParameters, 'xmlEncoded')){\n this.adParameters = xml.decode(this.adParameters);\n }\n }\n\n /*** Local functions ***/\n function parseTrackingEvents(trackingEvents, duration) {\n var trackings = [];\n if (isDefined(trackingEvents)) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function (trackingData) {\n trackings.push(new TrackingEvent(trackingData, duration));\n });\n }\n return trackings;\n }\n\n function parseMediaFiles(mediaFilesJxonTree) {\n var mediaFiles = [];\n if (isDefined(mediaFilesJxonTree)) {\n mediaFilesJxonTree = isArray(mediaFilesJxonTree) ? mediaFilesJxonTree : [mediaFilesJxonTree];\n\n mediaFilesJxonTree.forEach(function (mfData) {\n mediaFiles.push(new MediaFile(mfData));\n });\n }\n return mediaFiles;\n }\n}\n;\nfunction MediaFile(mediaFileJTree) {\n if (!(this instanceof MediaFile)) {\n return new MediaFile(mediaFileJTree);\n }\n\n //Required attributes\n this.src = xml.keyValue(mediaFileJTree);\n this.delivery = mediaFileJTree.attr('delivery');\n this.type = mediaFileJTree.attr('type');\n this.width = mediaFileJTree.attr('width');\n this.height = mediaFileJTree.attr('height');\n\n //Optional attributes\n this.codec = mediaFileJTree.attr('codec');\n this.id = mediaFileJTree.attr('id');\n this.bitrate = mediaFileJTree.attr('bitrate');\n this.minBitrate = mediaFileJTree.attr('minBitrate');\n this.maxBitrate = mediaFileJTree.attr('maxBitrate');\n this.scalable = mediaFileJTree.attr('scalable');\n this.maintainAspectRatio = mediaFileJTree.attr('maintainAspectRatio');\n this.apiFramework = mediaFileJTree.attr('apiFramework');\n}\n;\nfunction TrackingEvent(trackingJTree, duration) {\n if (!(this instanceof TrackingEvent)) {\n return new TrackingEvent(trackingJTree, duration);\n }\n\n this.name = trackingJTree.attr('event');\n this.uri = xml.keyValue(trackingJTree);\n\n if('progress' === this.name) {\n this.offset = vastUtil.parseOffset(trackingJTree.attr('offset'), duration);\n }\n}\n\n;\nfunction VASTClient(options) {\n if (!(this instanceof VASTClient)) {\n return new VASTClient(options);\n }\n var defaultOptions = {\n WRAPPER_LIMIT: 5\n };\n\n options = options || {};\n this.settings = extend({}, options, defaultOptions);\n this.errorURLMacros = [];\n}\n\nVASTClient.prototype.getVASTResponse = function getVASTResponse(adTagUrl, callback) {\n var that = this;\n\n var error = sanityCheck(adTagUrl, callback);\n if (error) {\n if (isFunction(callback)) {\n return callback(error);\n }\n throw error;\n }\n\n async.waterfall([\n this._getVASTAd.bind(this, adTagUrl),\n buildVASTResponse\n ],\n callback);\n\n /*** Local functions ***/\n function buildVASTResponse(adsChain, cb) {\n try {\n var response = that._buildVASTResponse(adsChain);\n cb(null, response);\n } catch (e) {\n cb(e);\n }\n }\n\n function sanityCheck(adTagUrl, cb) {\n if (!adTagUrl) {\n return new VASTError('on VASTClient.getVASTResponse, missing ad tag URL');\n }\n\n if (!isFunction(cb)) {\n return new VASTError('on VASTClient.getVASTResponse, missing callback function');\n }\n }\n};\n\nVASTClient.prototype._getVASTAd = function (adTagUrl, callback) {\n var that = this;\n\n getAdWaterfall(adTagUrl, function (error, vastTree) {\n var waterfallAds = vastTree && isArray(vastTree.ads) ? vastTree.ads : null;\n if (error) {\n that._trackError(error, waterfallAds);\n return callback(error, waterfallAds);\n }\n\n getAd(waterfallAds.shift(), [], waterfallHandler);\n\n /*** Local functions ***/\n function waterfallHandler(error, adChain) {\n if (error) {\n that._trackError(error, adChain);\n if (waterfallAds.length > 0) {\n getAd(waterfallAds.shift(),[], waterfallHandler);\n } else {\n callback(error, adChain);\n }\n } else {\n callback(null, adChain);\n }\n }\n });\n\n /*** Local functions ***/\n function getAdWaterfall(adTagUrl, callback) {\n var requestVastXML = that._requestVASTXml.bind(that, adTagUrl);\n async.waterfall([\n requestVastXML,\n buildVastWaterfall\n ], callback);\n }\n\n function buildVastWaterfall(xmlStr, callback) {\n var vastTree;\n try {\n vastTree = xml.toJXONTree(xmlStr);\n vastTree.ads = isArray(vastTree.ad) ? vastTree.ad : [vastTree.ad];\n callback(validateVASTTree(vastTree), vastTree);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.buildVastWaterfall, error parsing xml\", 100), null);\n }\n }\n\n function validateVASTTree(vastTree) {\n var vastVersion = xml.attr(vastTree, 'version');\n\n if (!vastTree.ad) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, no Ad in VAST tree', 303);\n }\n\n if (vastVersion && (vastVersion != 3 && vastVersion != 2)) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, not supported VAST version \"' + vastVersion + '\"', 102);\n }\n\n return null;\n }\n\n function getAd(adTagUrl, adChain, callback) {\n if (adChain.length >= that.WRAPPER_LIMIT) {\n return callback(new VASTError(\"on VASTClient.getVASTAd.getAd, players wrapper limit reached (the limit is \" + that.WRAPPER_LIMIT + \")\", 302), adChain);\n }\n\n async.waterfall([\n function (next) {\n if (isString(adTagUrl)) {\n requestVASTAd(adTagUrl, next);\n } else {\n next(null, adTagUrl);\n }\n },\n buildAd\n ], function (error, ad) {\n if (ad) {\n adChain.push(ad);\n }\n\n if (error) {\n return callback(error, adChain);\n }\n\n if (ad.wrapper) {\n return getAd(ad.wrapper.VASTAdTagURI, adChain, callback);\n }\n\n return callback(null, adChain);\n });\n }\n\n function buildAd(adJxonTree, callback) {\n try {\n var ad = new Ad(adJxonTree);\n callback(validateAd(ad), ad);\n } catch (e) {\n callback(new VASTError('on VASTClient.getVASTAd.buildAd, error parsing xml', 100), null);\n }\n }\n\n function validateAd(ad) {\n var wrapper = ad.wrapper;\n var inLine = ad.inLine;\n var errMsgPrefix = 'on VASTClient.getVASTAd.validateAd, ';\n\n if (inLine && wrapper) {\n return new VASTError(errMsgPrefix +\"InLine and Wrapper both found on the same Ad\", 101);\n }\n\n if (!inLine && !wrapper) {\n return new VASTError(errMsgPrefix + \"nor wrapper nor inline elements found on the Ad\", 101);\n }\n\n if (inLine && inLine.creatives.length === 0) {\n return new VASTError(errMsgPrefix + \"missing creative in InLine element\", 101);\n }\n\n if (wrapper && !wrapper.VASTAdTagURI) {\n return new VASTError(errMsgPrefix + \"missing 'VASTAdTagURI' in wrapper\", 101);\n }\n }\n\n function requestVASTAd(adTagUrl, callback) {\n that._requestVASTXml(adTagUrl, function (error, xmlStr) {\n if (error) {\n return callback(error);\n }\n try {\n var vastTree = xml.toJXONTree(xmlStr);\n callback(validateVASTTree(vastTree), vastTree.ad);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.requestVASTAd, error parsing xml\", 100));\n }\n });\n }\n};\n\nVASTClient.prototype._requestVASTXml = function requestVASTXml(adTagUrl, callback) {\n try {\n if (isFunction(adTagUrl)) {\n adTagUrl(requestHandler);\n } else {\n http.get(adTagUrl, requestHandler, {\n withCredentials: true\n });\n }\n } catch (e) {\n callback(e);\n }\n\n /*** Local functions ***/\n function requestHandler(error, response, status) {\n if (error) {\n var errMsg = isDefined(status) ?\n \"on VASTClient.requestVastXML, HTTP request error with status '\" + status + \"'\" :\n \"on VASTClient.requestVastXML, Error getting the the VAST XML with he passed adTagXML fn\";\n return callback(new VASTError(errMsg, 301), null);\n }\n\n callback(null, response);\n }\n};\n\nVASTClient.prototype._buildVASTResponse = function buildVASTResponse(adsChain) {\n var response = new VASTResponse();\n addAdsToResponse(response, adsChain);\n validateResponse(response);\n\n return response;\n\n //*** Local function ****\n function addAdsToResponse(response, ads) {\n ads.forEach(function (ad) {\n response.addAd(ad);\n });\n }\n\n function validateResponse(response) {\n var progressEvents = response.trackingEvents.progress;\n\n if (!response.hasLinear()) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Received an Ad type that is not supported\", 200);\n }\n\n if (response.duration === undefined) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Missing duration field in VAST response\", 101);\n }\n\n if (progressEvents) {\n progressEvents.forEach(function (progressEvent) {\n if (!isNumber(progressEvent.offset)) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, missing or wrong offset attribute on progress tracking event\", 101);\n }\n });\n }\n }\n};\n\nVASTClient.prototype._trackError = function (error, adChain) {\n if (!isArray(adChain) || adChain.length === 0) { //There is nothing to track\n return;\n }\n\n var errorURLMacros = [];\n adChain.forEach(addErrorUrlMacros);\n vastUtil.track(errorURLMacros, {ERRORCODE: error.code || 900}); //900 <== Undefined error\n\n /*** Local functions ***/\n function addErrorUrlMacros(ad) {\n if (ad.wrapper && ad.wrapper.error) {\n errorURLMacros.push(ad.wrapper.error);\n }\n\n if (ad.inLine && ad.inLine.error) {\n errorURLMacros.push(ad.inLine.error);\n }\n }\n};\n\n;\nvar VAST = {};\n\nfunction VASTError(message, code) {\n this.message = 'VAST Error: ' + (message || '');\n if (code) {\n this.code = code;\n }\n}\n\nVASTError.prototype = new Error();\nVASTError.prototype.name = \"VAST Error\";\n;\n/**\n * Inner helper class that deals with the logic of the individual steps needed to setup an ad in the player.\n *\n * @param player {object} instance of the player that will play the ad. It assumes that the videojs-contrib-ads plugin\n * has been initialized when you use its utility functions.\n *\n * @constructor\n */\nfunction VASTIntegrator(player) {\n if (!(this instanceof VASTIntegrator)) {\n return new VASTIntegrator(player);\n }\n\n this.player = player;\n}\n\nVASTIntegrator.prototype.playAd = function playAd(vastResponse, callback) {\n var that = this;\n callback = callback || noop;\n\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('On VASTIntegrator, missing required VASTResponse'));\n }\n\n async.waterfall([\n function (next) {\n next(null, vastResponse);\n },\n this._selectAdSource.bind(this),\n this._createVASTTracker.bind(this),\n this._addClickThrough.bind(this),\n this._addSkipButton.bind(this),\n this._setupEvents.bind(this),\n this._playSelectedAd.bind(this)\n ], function (error, response) {\n if (error && response) {\n that._trackError(error, response);\n }\n callback(error, response);\n });\n\n this._adUnit = {\n _src: null,\n type: 'VAST',\n pauseAd: function () {\n that.player.pause(true);\n },\n\n resumeAd: function () {\n that.player.play(true);\n },\n\n isPaused: function () {\n return that.player.paused(true);\n },\n\n getSrc: function () {\n return this._src;\n }\n };\n\n return this._adUnit;\n};\n\nVASTIntegrator.prototype._selectAdSource = function selectAdSource(response, callback) {\n var source;\n\n var playerWidth = dom.getDimension(this.player.el()).width;\n response.mediaFiles.sort(function compareTo(a, b) {\n var deltaA = Math.abs(playerWidth - a.width);\n var deltaB = Math.abs(playerWidth - b.width);\n return deltaA - deltaB;\n });\n\n source = this.player.selectSource(response.mediaFiles).source;\n\n if (source) {\n if (this._adUnit) {\n this._adUnit._src = source;\n }\n return callback(null, source, response);\n }\n\n // code 403 <== Couldn't find MediaFile that is supported by this video player\n callback(new VASTError(\"Could not find Ad mediafile supported by this player\", 403), response);\n};\n\nVASTIntegrator.prototype._createVASTTracker = function createVASTTracker(adMediaFile, response, callback) {\n try {\n callback(null, adMediaFile, new VASTTracker(adMediaFile.src, response), response);\n } catch (e) {\n callback(e, response);\n }\n};\n\nVASTIntegrator.prototype._setupEvents = function setupEvents(adMediaFile, tracker, response, callback) {\n var previouslyMuted;\n var player = this.player;\n player.on('fullscreenchange', trackFullscreenChange);\n player.on('vast.adStart', trackImpressions);\n player.on('pause', trackPause);\n player.on('timeupdate', trackProgress);\n player.on('volumechange', trackVolumeChange);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], unbindEvents);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adSkip'], function(evt){\n if(evt.type === 'vast.adEnd'){\n tracker.trackComplete();\n }\n });\n\n return callback(null, adMediaFile, response);\n\n /*** Local Functions ***/\n function unbindEvents() {\n player.off('fullscreenchange', trackFullscreenChange);\n player.off('vast.adStart', trackImpressions);\n player.off('pause', trackPause);\n player.off('timeupdate', trackProgress);\n player.off('volumechange', trackVolumeChange);\n }\n\n function trackFullscreenChange() {\n if (player.isFullscreen()) {\n tracker.trackFullscreen();\n } else {\n tracker.trackExitFullscreen();\n }\n }\n\n function trackPause() {\n //NOTE: whenever a video ends the video Element triggers a 'pause' event before the 'ended' event.\n // We should not track this pause event because it makes the VAST tracking confusing again we use a\n // Threshold of 2 seconds to prevent false positives on IOS.\n if (Math.abs(player.duration() - player.currentTime()) < 2) {\n return;\n }\n\n tracker.trackPause();\n playerUtils.once(player, ['play', 'vast.adEnd', 'vast.adsCancel'], function (evt) {\n if(evt.type === 'play'){\n tracker.trackResume();\n }\n });\n }\n\n function trackProgress() {\n var currentTimeInMs = player.currentTime() * 1000;\n tracker.trackProgress(currentTimeInMs);\n }\n\n function trackImpressions() {\n tracker.trackImpressions();\n tracker.trackCreativeView();\n }\n\n function trackVolumeChange() {\n var muted = player.muted();\n if (muted) {\n tracker.trackMute();\n } else if (previouslyMuted) {\n tracker.trackUnmute();\n }\n previouslyMuted = muted;\n }\n};\n\nVASTIntegrator.prototype._addSkipButton = function addSkipButton(source, tracker, response, callback) {\n var skipOffsetInSec;\n\n if (isNumber(response.skipoffset)) {\n skipOffsetInSec = response.skipoffset / 1000;\n addSkipButtonToPlayer(this.player, skipOffsetInSec);\n }\n callback(null, source, tracker, response);\n\n /*** Local function ***/\n function addSkipButtonToPlayer(player, skipOffset) {\n var skipButton = createSkipButton(player);\n var updateSkipButton = updateSkipButtonState.bind(this, skipButton, skipOffset, player);\n\n player.el().appendChild(skipButton);\n player.on('timeupdate', updateSkipButton);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeSkipButton);\n\n function removeSkipButton() {\n player.off('timeupdate', updateSkipButton);\n dom.remove(skipButton);\n }\n }\n\n function createSkipButton(player) {\n var skipButton = window.document.createElement(\"div\");\n dom.addClass(skipButton, \"vast-skip-button\");\n\n skipButton.onclick = function (e) {\n if (dom.hasClass(skipButton, 'enabled')) {\n tracker.trackSkip();\n player.trigger('vast.adSkip');\n }\n\n //We prevent event propagation to avoid problems with the clickThrough and so on\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n } else {\n return false;\n }\n };\n\n return skipButton;\n }\n\n function updateSkipButtonState(skipButton, skipOffset, player) {\n var timeLeft = Math.ceil(skipOffset - player.currentTime());\n if (timeLeft > 0) {\n skipButton.innerHTML = \"Skip in \" + toFixedDigits(timeLeft, 2) + \"...\";\n } else {\n if (!dom.hasClass(skipButton, 'enabled')) {\n dom.addClass(skipButton, 'enabled');\n skipButton.innerHTML = \"Skip ad\";\n }\n }\n }\n};\n\nVASTIntegrator.prototype._addClickThrough = function addClickThrough(mediaFile, tracker, response, callback) {\n var player = this.player;\n var blocker = createClickThroughBlocker(player, tracker, response);\n var updateBlocker = updateBlockerURL.bind(this, blocker, response, player);\n\n player.el().insertBefore(blocker, player.controlBar.el());\n player.on('timeupdate', updateBlocker);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeBlocker);\n\n return callback(null, mediaFile, tracker, response);\n\n /*** Local Functions ***/\n\n function createClickThroughBlocker(player, tracker, response) {\n var blocker = window.document.createElement(\"a\");\n var clickThroughMacro = response.clickThrough;\n\n dom.addClass(blocker, 'vast-blocker');\n blocker.href = generateClickThroughURL(clickThroughMacro, player);\n\n if (isString(clickThroughMacro)) {\n blocker.target = \"_blank\";\n }\n\n blocker.onclick = function (e) {\n if (player.paused()) {\n player.play();\n\n //We prevent event propagation to avoid problems with the player's normal pause mechanism\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n }\n return false;\n }\n\n player.pause();\n tracker.trackClick();\n };\n\n return blocker;\n }\n\n function updateBlockerURL(blocker, response, player) {\n blocker.href = generateClickThroughURL(response.clickThrough, player);\n }\n\n function generateClickThroughURL(clickThroughMacro, player) {\n var variables = {\n ASSETURI: mediaFile.src,\n CONTENTPLAYHEAD: vastUtil.formatProgress(player.currentTime() * 1000)\n };\n\n return clickThroughMacro ? vastUtil.parseURLMacro(clickThroughMacro, variables) : '#';\n }\n\n function removeBlocker() {\n player.off('timeupdate', updateBlocker);\n dom.remove(blocker);\n }\n};\n\nVASTIntegrator.prototype._playSelectedAd = function playSelectedAd(source, response, callback) {\n var player = this.player;\n\n player.preload(\"auto\"); //without preload=auto the durationchange event is never fired\n player.src(source);\n\n playerUtils.once(player, ['durationchange', 'error', 'vast.adsCancel'], function (evt) {\n if (evt.type === 'durationchange') {\n playAd();\n } else if(evt.type === 'error') {\n callback(new VASTError(\"on VASTIntegrator, Player is unable to play the Ad\", 400), response);\n }\n //NOTE: If the ads get canceled we do nothing/\n });\n\n /**** local functions ******/\n function playAd() {\n player.play();\n playerUtils.once(player, ['playing', 'vast.adsCancel'], function (evt) {\n if(evt.type === 'vast.adsCancel'){\n return;\n }\n\n player.trigger('vast.adStart');\n\n playerUtils.once(player, ['ended', 'vast.adsCancel', 'vast.adSkip'], function (evt) {\n if(evt.type === 'ended' || evt.type === 'vast.adSkip'){\n callback(null, response);\n }\n //NOTE: if the ads get cancel we do nothing\n });\n });\n }\n};\n\nVASTIntegrator.prototype._trackError = function trackError(error, response) {\n vastUtil.track(response.errorURLMacros, {ERRORCODE: error.code || 900});\n};\n\n;\n(function (window) {\n \"use strict\";\n\n\n function VASTResponse() {\n if (!(this instanceof VASTResponse)) {\n return new VASTResponse();\n }\n\n this._linearAdded = false;\n this.ads = [];\n this.errorURLMacros = [];\n this.impressions = [];\n this.clickTrackings = [];\n this.customClicks = [];\n this.trackingEvents = {};\n this.mediaFiles = [];\n this.clickThrough = undefined;\n this.adTitle = '';\n this.duration = undefined;\n this.skipoffset = undefined;\n }\n\n VASTResponse.prototype.addAd = function (ad) {\n var inLine, wrapper;\n\n if (ad instanceof Ad) {\n inLine = ad.inLine;\n wrapper = ad.wrapper;\n\n this.ads.push(ad);\n\n if (inLine) {\n this._addInLine(inLine);\n }\n\n if (wrapper) {\n this._addWrapper(wrapper);\n }\n }\n };\n\n VASTResponse.prototype._addErrorTrackUrl = function (error) {\n var errorURL = error instanceof xml.JXONTree ? xml.keyValue(error) : error;\n if (errorURL) {\n this.errorURLMacros.push(errorURL);\n }\n };\n\n VASTResponse.prototype._addImpressions = function (impressions) {\n isArray(impressions) && appendToArray(this.impressions, impressions);\n };\n\n VASTResponse.prototype._addClickThrough = function (clickThrough) {\n if (isNotEmptyString(clickThrough)) {\n this.clickThrough = clickThrough;\n }\n };\n\n VASTResponse.prototype._addClickTrackings = function (clickTrackings) {\n isArray(clickTrackings) && appendToArray(this.clickTrackings, clickTrackings);\n };\n\n VASTResponse.prototype._addCustomClicks = function (customClicks) {\n isArray(customClicks) && appendToArray(this.customClicks, customClicks);\n };\n\n VASTResponse.prototype._addTrackingEvents = function (trackingEvents) {\n var eventsMap = this.trackingEvents;\n\n if (trackingEvents) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function (trackingEvent) {\n if (!eventsMap[trackingEvent.name]) {\n eventsMap[trackingEvent.name] = [];\n }\n eventsMap[trackingEvent.name].push(trackingEvent);\n });\n }\n };\n\n VASTResponse.prototype._addTitle = function (title) {\n if (isNotEmptyString(title)) {\n this.adTitle = title;\n }\n };\n\n VASTResponse.prototype._addDuration = function (duration) {\n if (isNumber(duration)) {\n this.duration = duration;\n }\n };\n\n VASTResponse.prototype._addVideoClicks = function (videoClicks) {\n if (videoClicks instanceof VideoClicks) {\n this._addClickThrough(videoClicks.clickThrough);\n this._addClickTrackings(videoClicks.clickTrackings);\n this._addCustomClicks(videoClicks.customClicks);\n }\n };\n\n VASTResponse.prototype._addMediaFiles = function (mediaFiles) {\n isArray(mediaFiles) && appendToArray(this.mediaFiles, mediaFiles);\n };\n\n VASTResponse.prototype._addSkipoffset = function (offset) {\n if (offset) {\n this.skipoffset = offset;\n }\n };\n\n VASTResponse.prototype._addAdParameters = function (adParameters) {\n if (adParameters) {\n this.adParameters = adParameters;\n }\n };\n\n VASTResponse.prototype._addLinear = function (linear) {\n if (linear instanceof Linear) {\n this._addDuration(linear.duration);\n this._addTrackingEvents(linear.trackingEvents);\n this._addVideoClicks(linear.videoClicks);\n this._addMediaFiles(linear.mediaFiles);\n this._addSkipoffset(linear.skipoffset);\n this._addAdParameters(linear.adParameters);\n this._linearAdded = true;\n }\n };\n\n VASTResponse.prototype._addInLine = function (inLine) {\n var that = this;\n\n if (inLine instanceof InLine) {\n this._addTitle(inLine.adTitle);\n this._addErrorTrackUrl(inLine.error);\n this._addImpressions(inLine.impressions);\n\n inLine.creatives.forEach(function (creative) {\n if (creative.linear) {\n that._addLinear(creative.linear);\n }\n });\n }\n };\n\n VASTResponse.prototype._addWrapper = function (wrapper) {\n var that = this;\n\n if (wrapper instanceof Wrapper) {\n this._addErrorTrackUrl(wrapper.error);\n this._addImpressions(wrapper.impressions);\n\n wrapper.creatives.forEach(function (creative) {\n var linear = creative.linear;\n if (linear) {\n that._addVideoClicks(linear.videoClicks);\n that.clickThrough = undefined;//We ensure that no clickThrough has been added\n that._addTrackingEvents(linear.trackingEvents);\n }\n });\n }\n };\n\n VASTResponse.prototype.hasLinear = function(){\n return this._linearAdded;\n };\n\n function appendToArray(array, items) {\n items.forEach(function (item) {\n array.push(item);\n });\n }\n\n window.VASTResponse = VASTResponse;\n})(window);\n\n;\nfunction VASTTracker(assetURI, vastResponse) {\n if (!(this instanceof VASTTracker)) {\n return new VASTTracker(assetURI, vastResponse);\n }\n\n sanityCheck(assetURI, vastResponse);\n this.response = vastResponse;\n this.assetURI = assetURI;\n this.progress = 0;\n this.quartiles = {\n firstQuartile: {tracked: false, time: Math.round(25 * vastResponse.duration) / 100},\n midpoint: {tracked: false, time: Math.round(50 * vastResponse.duration) / 100},\n thirdQuartile: {tracked: false, time: Math.round(75 * vastResponse.duration) / 100}\n };\n\n /*** Local Functions ***/\n function sanityCheck(assetURI, vastResponse) {\n if (!isString(assetURI) || isEmptyString(assetURI)) {\n throw new VASTError('on VASTTracker constructor, missing required the URI of the ad asset being played');\n }\n\n if (!(vastResponse instanceof VASTResponse)) {\n throw new VASTError('on VASTTracker constructor, missing required VAST response');\n }\n }\n}\n\nVASTTracker.prototype.trackURLs = function trackURLs(urls, variables) {\n if (isArray(urls) && urls.length > 0) {\n variables = extend({\n ASSETURI: this.assetURI,\n CONTENTPLAYHEAD: vastUtil.formatProgress(this.progress)\n }, variables || {});\n\n vastUtil.track(urls, variables);\n }\n};\n\nVASTTracker.prototype.trackEvent = function trackEvent(eventName, trackOnce) {\n this.trackURLs(getEventUris(this.response.trackingEvents[eventName]));\n if (trackOnce) {\n this.response.trackingEvents[eventName] = undefined;\n }\n\n /*** Local function ***/\n function getEventUris(trackingEvents) {\n var uris;\n\n if (trackingEvents) {\n uris = [];\n trackingEvents.forEach(function (event) {\n uris.push(event.uri);\n });\n }\n return uris;\n }\n};\n\nVASTTracker.prototype.trackProgress = function trackProgress(newProgressInMs) {\n var events = [];\n var ONCE = true;\n var ALWAYS = false;\n var trackingEvents = this.response.trackingEvents;\n\n if (isNumber(newProgressInMs)) {\n addTrackEvent('start', ONCE, newProgressInMs > 0);\n addTrackEvent('rewind', ALWAYS, hasRewound(this.progress, newProgressInMs));\n addQuartileEvents.call(this, newProgressInMs);\n trackProgressEvents.call(this, newProgressInMs);\n trackEvents.call(this);\n this.progress = newProgressInMs;\n }\n\n /*** Local function ***/\n function hasRewound(currentProgress, newProgress) {\n var REWIND_THRESHOLD = 3000; //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that there was a rewind an that it was on purpose.\n return currentProgress > newProgressInMs && Math.abs(newProgress - currentProgress) > REWIND_THRESHOLD;\n }\n\n function addTrackEvent(eventName, trackOnce, canBeAdded) {\n if (trackingEvents[eventName] && canBeAdded) {\n events.push({\n name: eventName,\n trackOnce: !!trackOnce\n });\n }\n }\n\n function addQuartileEvents(progress) {\n var quartiles = this.quartiles;\n var firstQuartile = this.quartiles.firstQuartile;\n var midpoint = this.quartiles.midpoint;\n var thirdQuartile = this.quartiles.thirdQuartile;\n\n if (!firstQuartile.tracked) {\n trackQuartile('firstQuartile', progress);\n } else if (!midpoint.tracked) {\n trackQuartile('midpoint', progress);\n } else {\n trackQuartile('thirdQuartile', progress);\n }\n\n /*** Local function ***/\n function trackQuartile(quartileName, progress){\n var quartile = quartiles[quartileName];\n if(canBeTracked(quartile, progress)){\n quartile.tracked = true;\n addTrackEvent(quartileName, ONCE, true);\n }\n }\n }\n\n function canBeTracked(quartile, progress) {\n var quartileTime = quartile.time;\n //We only fire the quartile event if the progress is bigger than the quartile time by 5 seconds at most.\n return progress >= quartileTime && progress <= (quartileTime + 5000);\n }\n\n function trackProgressEvents(progress) {\n if (!isArray(trackingEvents.progress)) {\n return; //Nothing to track\n }\n\n var pendingProgressEvts = [];\n var that = this;\n\n trackingEvents.progress.forEach(function (evt) {\n if (evt.offset <= progress) {\n that.trackURLs([evt.uri]);\n } else {\n pendingProgressEvts.push(evt);\n }\n });\n trackingEvents.progress = pendingProgressEvts;\n }\n\n function trackEvents() {\n events.forEach(function (event) {\n this.trackEvent(event.name, event.trackOnce);\n }, this);\n }\n};\n\n[\n 'rewind',\n 'fullscreen',\n 'exitFullscreen',\n 'pause',\n 'resume',\n 'mute',\n 'unmute',\n 'acceptInvitation',\n 'acceptInvitationLinear',\n 'collapse',\n 'expand'\n].forEach(function (eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function () {\n this.trackEvent(eventName);\n };\n });\n\n[\n 'start',\n 'skip',\n 'close',\n 'closeLinear'\n].forEach(function (eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function () {\n this.trackEvent(eventName, true);\n };\n });\n\n[\n 'firstQuartile',\n 'midpoint',\n 'thirdQuartile'\n].forEach(function (quartile) {\n VASTTracker.prototype['track' + capitalize(quartile)] = function () {\n this.quartiles[quartile].tracked = true;\n this.trackEvent(quartile, true);\n };\n });\n\nVASTTracker.prototype.trackComplete = function () {\n if(this.quartiles.thirdQuartile.tracked){\n this.trackEvent('complete', true);\n }\n};\n\nVASTTracker.prototype.trackErrorWithCode = function trackErrorWithCode(errorcode) {\n if (isNumber(errorcode)) {\n this.trackURLs(this.response.errorURLMacros, {ERRORCODE: errorcode});\n }\n};\n\nVASTTracker.prototype.trackImpressions = function trackImpressions() {\n this.trackURLs(this.response.impressions);\n};\n\nVASTTracker.prototype.trackCreativeView = function trackCreativeView() {\n this.trackEvent('creativeView');\n};\n\nVASTTracker.prototype.trackClick = function trackClick() {\n this.trackURLs(this.response.clickTrackings);\n};\n\n;\nfunction VideoClicks(videoClickJTree) {\n if (!(this instanceof VideoClicks)) {\n return new VideoClicks(videoClickJTree);\n }\n\n this.clickThrough = xml.keyValue(videoClickJTree.clickThrough);\n this.clickTrackings = parseClickTrackings(videoClickJTree.clickTracking);\n this.customClicks = parseClickTrackings(videoClickJTree.customClick);\n\n /*** Local functions ***/\n function parseClickTrackings(trackingData) {\n var clickTrackings = [];\n if (trackingData) {\n trackingData = isArray(trackingData) ? trackingData : [trackingData];\n trackingData.forEach(function (clickTrackingData) {\n clickTrackings.push(xml.keyValue(clickTrackingData));\n });\n }\n return clickTrackings;\n }\n}\n;\nfunction Wrapper(wrapperJTree) {\n if(!(this instanceof Wrapper)) {\n return new Wrapper(wrapperJTree);\n }\n\n //Required elements\n this.adSystem = xml.keyValue(wrapperJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(wrapperJTree.impression);\n this.VASTAdTagURI = xml.keyValue(wrapperJTree.vASTAdTagURI);\n\n //Optional elements\n this.creatives = vastUtil.parseCreatives(wrapperJTree.creatives);\n this.error = xml.keyValue(wrapperJTree.error);\n this.extensions = wrapperJTree.extensions;\n\n //Optional attrs\n this.followAdditionalWrappers = isDefined(xml.attr(wrapperJTree, 'followAdditionalWrappers'))? xml.attr(wrapperJTree, 'followAdditionalWrappers'): true;\n this.allowMultipleAds = xml.attr(wrapperJTree, 'allowMultipleAds');\n this.fallbackOnNoAd = xml.attr(wrapperJTree, 'fallbackOnNoAd');\n}\n\n\n\n;\n\"use strict\";\n\nvar vastUtil = {\n\n track: function track(URLMacros, variables) {\n var sources = vastUtil.parseURLMacros(URLMacros, variables);\n var trackImgs = [];\n sources.forEach(function (src) {\n var img = new Image();\n img.src = src;\n trackImgs.push(img);\n });\n return trackImgs;\n },\n\n parseURLMacros: function parseMacros(URLMacros, variables) {\n var parsedURLs = [];\n\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n URLMacros.forEach(function (URLMacro) {\n parsedURLs.push(vastUtil._parseURLMacro(URLMacro, variables));\n });\n\n return parsedURLs;\n },\n\n parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n return vastUtil._parseURLMacro(URLMacro, variables);\n },\n\n _parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n forEach(variables, function (value, key) {\n URLMacro = URLMacro.replace(new RegExp(\"\\\\[\" + key + \"\\\\\\]\", 'gm'), value);\n });\n\n return URLMacro;\n },\n\n parseDuration: function parseDuration(durationStr) {\n var durationRegex = /(\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d\\d\\d))?/;\n var match, durationInMs;\n\n if (isString(durationStr)) {\n match = durationStr.match(durationRegex);\n if (match) {\n durationInMs = parseHoursToMs(match[1]) + parseMinToMs(match[2]) + parseSecToMs(match[3]) + parseInt(match[5] || 0);\n }\n }\n\n return isNaN(durationInMs) ? null : durationInMs;\n\n /*** local functions ***/\n function parseHoursToMs(hourStr) {\n return parseInt(hourStr, 10) * 60 * 60 * 1000;\n }\n\n function parseMinToMs(minStr) {\n return parseInt(minStr, 10) * 60 * 1000;\n }\n\n function parseSecToMs(secStr) {\n return parseInt(secStr, 10) * 1000;\n }\n },\n\n parseImpressions: function parseImpressions(impressions) {\n if (impressions) {\n impressions = isArray(impressions) ? impressions : [impressions];\n return transformArray(impressions, function (impression) {\n if (isNotEmptyString(impression.keyValue)) {\n return impression.keyValue;\n }\n return undefined;\n });\n }\n return [];\n },\n\n parseCreatives: function parseCreatives(creativesJTree) {\n var creatives = [];\n var creativesData;\n if (isDefined(creativesJTree) && isDefined(creativesJTree.creative)) {\n creativesData = isArray(creativesJTree.creative) ? creativesJTree.creative : [creativesJTree.creative];\n creativesData.forEach(function (creative) {\n creatives.push(new Creative(creative));\n });\n }\n return creatives;\n },\n\n //We assume that the progress is going to arrive in milliseconds\n formatProgress: function formatProgress(progress) {\n var hours, minutes, seconds, milliseconds;\n hours = progress / (60 * 60 * 1000);\n hours = Math.floor(hours);\n minutes = (progress / (60 * 1000)) % 60;\n minutes = Math.floor(minutes);\n seconds = (progress / 1000) % 60;\n seconds = Math.floor(seconds);\n milliseconds = progress % 1000;\n return toFixedDigits(hours, 2) + ':' + toFixedDigits(minutes, 2) + ':' + toFixedDigits(seconds, 2) + '.' + toFixedDigits(milliseconds, 3);\n },\n\n parseOffset: function parseOffset(offset, duration) {\n if(isPercentage(offset)){\n return calculatePercentage(offset, duration);\n }\n return vastUtil.parseDuration(offset);\n\n /*** Local function ***/\n function isPercentage(offset) {\n var percentageRegex = /^\\d+(\\.\\d+)?%$/g;\n return percentageRegex.test(offset);\n }\n\n function calculatePercentage(percentStr, duration) {\n if(duration) {\n return calcPercent(duration, parseFloat(percentStr.replace('%', '')));\n }\n return null;\n }\n\n function calcPercent(quantity, percent){\n return quantity * percent / 100;\n }\n },\n\n isVPAID: function isVPAIDMediaFile(mediaFile) {\n return !!mediaFile && mediaFile.apiFramework === 'VPAID';\n }\n};})(window, document, videojs);","/*jshint unused:false */\n\"use strict\";\n\nvar NODE_TYPE_ELEMENT = 1;\n\nfunction noop(){ }\n\nfunction isNull(o) {\n return o === null;\n}\n\nfunction isDefined(o){\n return o !== undefined;\n}\n\nfunction isUndefined(o){\n return o === undefined;\n}\n\nfunction isObject(obj) {\n return typeof obj === 'object';\n}\n\nfunction isFunction(str){\n return typeof str === 'function';\n}\n\nfunction isNumber(num){\n return typeof num === 'number';\n}\n\nfunction isWindow(obj) {\n return isObject(obj) && obj.window === obj;\n}\n\nfunction isArray(array){\n return Object.prototype.toString.call( array ) === '[object Array]';\n}\n\nfunction isArrayLike(obj) {\n if (obj === null || isWindow(obj) || isFunction(obj) || isUndefined(obj)) {\n return false;\n }\n\n var length = obj.length;\n\n if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n return true;\n }\n\n return isString(obj) || isArray(obj) || length === 0 ||\n typeof length === 'number' && length > 0 && (length - 1) in obj;\n}\n\nfunction isString(str){\n return typeof str === 'string';\n}\n\nfunction isEmptyString(str) {\n return isString(str) && str.length === 0;\n}\n\nfunction isNotEmptyString(str) {\n return isString(str) && str.length !== 0;\n}\n\nfunction arrayLikeObjToArray(args) {\n return Array.prototype.slice.call(args);\n}\n\nfunction forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n // Need to check if hasOwnProperty exists,\n // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n if (key !== 'prototype' && key !== 'length' && key !== 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else {\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n}\n\nfunction isValidEmail(email){\n if(!isString(email)){\n return false;\n }\n var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;\n return EMAIL_REGEXP.test(email.trim());\n}\n\nfunction extend (obj) {\n var arg, i, k;\n for (i = 1; i < arguments.length; i++) {\n arg = arguments[i];\n for (k in arg) {\n if (arg.hasOwnProperty(k)) {\n if(isObject(obj[k]) && !isNull(obj[k]) && isObject(arg[k])){\n obj[k] = extend({}, obj[k], arg[k]);\n }else {\n obj[k] = arg[k];\n }\n }\n }\n }\n return obj;\n}\n\nfunction capitalize(s){\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nfunction decapitalize(s) {\n return s.charAt(0).toLowerCase() + s.slice(1);\n}\n\n/**\n * This method works the same way array.prototype.map works but if the transformer returns undefine, then\n * it won't be added to the transformed Array.\n */\nfunction transformArray(array, transformer) {\n var transformedArray = [];\n\n array.forEach(function(item, index){\n var transformedItem = transformer(item, index);\n if(isDefined(transformedItem)) {\n transformedArray.push(transformedItem);\n }\n });\n\n return transformedArray;\n}\n\nfunction toFixedDigits(num, digits) {\n var formattedNum = num + '';\n digits = isNumber(digits) ? digits : 0;\n num = isNumber(num) ? num : parseInt(num, 10);\n if(isNumber(num) && !isNaN(num)){\n formattedNum = num + '';\n while(formattedNum.length < digits) {\n formattedNum = '0' + formattedNum;\n }\n return formattedNum;\n }\n return NaN + '';\n}\n\nfunction throttle(callback, delay) {\n var previousCall = new Date().getTime() - (delay + 1);\n return function() {\n var time = new Date().getTime();\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(this, arguments);\n }\n };\n}\n\nfunction debounce (callback, wait) {\n var timeoutId;\n\n return function (){\n if(timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(function(){\n callback.apply(this, arguments);\n timeoutId = undefined;\n }, wait);\n };\n}\n\n// a function designed to blow up the stack in a naive way\n// but it is ok for videoJs children components\nfunction treeSearch(root, getChildren, found){\n var children = getChildren(root);\n for (var i = 0; i < children.length; i++){\n if (found(children[i])) {\n return children[i];\n }\n else {\n var el = treeSearch(children[i], getChildren, found);\n if (el){\n return el;\n }\n }\n }\n}\n\nfunction echoFn(val) {\n return function () {\n return val;\n };\n}\n\n//Note: Supported formats come from http://www.w3.org/TR/NOTE-datetime\n// and the iso8601 regex comes from http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/\nfunction isISO8601(value) {\n if(isNumber(value)){\n value = value + ''; //we make sure that we are working with strings\n }\n\n if(!isString(value)){\n return false;\n }\n\n /*jslint maxlen: 500 */\n var iso8086Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n return iso8086Regex.test(value.trim());\n}\n\n/**\n * Checks if the Browser is IE9 and below\n * @returns {boolean}\n */\nfunction isOldIE() {\n var version = getInternetExplorerVersion(navigator);\n if (version === -1) {\n return false;\n }\n\n return version < 10;\n}\n\n/**\n * Returns the version of Internet Explorer or a -1 (indicating the use of another browser).\n * Source: https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx\n * @returns {number} the version of Internet Explorer or a -1 (indicating the use of another browser).\n */\nfunction getInternetExplorerVersion(navigator) {\n var rv = -1;\n\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n var res = re.exec(ua);\n if (res !== null) {\n rv = parseFloat(res[1]);\n }\n }\n\n return rv;\n}\n\n/*** Mobile Utility functions ***/\nvar _UA = navigator.userAgent;\nfunction isIDevice() {\n return /iP(hone|ad)/.test(_UA);\n}\n\nfunction isMobile() {\n return /iP(hone|ad|od)|Android|Windows Phone/.test(_UA);\n}\n\nfunction isIPhone() {\n return /iP(hone|od)/.test(_UA);\n}\n\nfunction isAndroid() {\n return /Android/.test(_UA);\n}\n","\"use strict\";\n\nfunction HttpRequestError(message) {\n this.message = 'HttpRequest Error: ' + (message || '');\n}\nHttpRequestError.prototype = new Error();\nHttpRequestError.prototype.name = \"HttpRequest Error\";\n\nfunction HttpRequest(createXhr) {\n if (!isFunction(createXhr)) {\n throw new HttpRequestError('Missing XMLHttpRequest factory method');\n }\n\n this.createXhr = createXhr;\n}\n\nHttpRequest.prototype.run = function (method, url, callback, options) {\n sanityCheck(url, callback, options);\n var timeout, timeoutId;\n var xhr = this.createXhr();\n options = options || {};\n timeout = isNumber(options.timeout) ? options.timeout : 0;\n\n xhr.open(method, urlParts(url).href, true);\n\n if (options.headers) {\n setHeaders(xhr, options.headers);\n }\n\n if (options.withCredentials) {\n xhr.withCredentials = true;\n }\n\n xhr.onload = function () {\n var statusText, response, status;\n\n /**\n * The only way to do a secure request on IE8 and IE9 is with the XDomainRequest object. Unfortunately, microsoft is\n * so nice that decided that the status property and the 'getAllResponseHeaders' method where not needed so we have to\n * fake them. If the request gets done with an XDomainRequest instance, we will assume that there are no headers and\n * the status will always be 200. If you don't like it, DO NOT USE ANCIENT BROWSERS!!!\n *\n * For mor info go to: https://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx\n */\n if (!xhr.getAllResponseHeaders) {\n xhr.getAllResponseHeaders = function () {\n return null;\n };\n }\n\n if (!xhr.status) {\n xhr.status = 200;\n }\n\n if (isDefined(timeoutId)) {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n\n statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n status = xhr.status === 1223 ? 204 : xhr.status;\n\n callback(\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText);\n };\n\n xhr.onerror = requestError;\n xhr.onabort = requestError;\n\n xhr.send();\n\n if (timeout > 0) {\n timeoutId = setTimeout(function () {\n xhr && xhr.abort();\n }, timeout);\n }\n\n function sanityCheck(url, callback, options) {\n if (!isString(url) || isEmptyString(url)) {\n throw new HttpRequestError(\"Invalid url '\" + url + \"'\");\n }\n\n if (!isFunction(callback)) {\n throw new HttpRequestError(\"Invalid handler '\" + callback + \"' for the http request\");\n }\n\n if (isDefined(options) && !isObject(options)) {\n throw new HttpRequestError(\"Invalid options map '\" + options + \"'\");\n }\n }\n\n function setHeaders(xhr, headers) {\n forEach(headers, function (value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n }\n\n function requestError() {\n callback(-1, null, null, '');\n }\n};\n\nHttpRequest.prototype.get = function (url, callback, options) {\n this.run('GET', url, processResponse, options);\n\n function processResponse(status, response, headersString, statusText) {\n if (isSuccess(status)) {\n callback(null, response, status, headersString, statusText);\n } else {\n callback(new HttpRequestError(statusText), response, status, headersString, statusText);\n }\n }\n\n function isSuccess(status) {\n return 200 <= status && status < 300;\n }\n};\n\nfunction createXhr() {\n var xhr = new XMLHttpRequest();\n if (!(\"withCredentials\" in xhr)) {\n // XDomainRequest for IE.\n xhr = new XDomainRequest();\n }\n return xhr;\n}\n\nvar http = new HttpRequest(createXhr);\n","'use strict';\n\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nvar msie = document.documentMode;\n\n/**\n *\n * IMPORTANT NOTE: This function comes from angularJs and was originally called urlResolve\n * you can take a look at the original code here https://github.com/angular/angular.js/blob/master/src/ng/urlUtils.js\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one\n * uses the inner HTML approach to assign the URL as part of an HTML snippet -\n * http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL.\n * Unfortunately, setting img[src] to something like \"javascript:foo\" on IE throws an exception.\n * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that\n * method and IE < 8 is unsupported.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|----------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol including the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol\n * | hostname | The hostname\n * | port | The port, without \":\"\n * | pathname | The pathname, beginning with \"/\"\n *\n */\n\nvar urlParsingNode = document.createElement(\"a\");\n\nfunction urlParts(url) {\n var href = url;\n\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute(\"href\", href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: isNotEmptyString(urlParsingNode.port)? urlParsingNode.port: 80,\n pathname: (urlParsingNode.pathname.charAt(0) === '/')\n ? urlParsingNode.pathname\n : '/' + urlParsingNode.pathname\n };\n}\n\n\n/**\n * This function accepts a query string (search part of a url) and returns a dictionary with\n * the different key value pairs\n * @param {string} qs queryString\n */\nfunction queryStringToObj(qs, cond) {\n var pairs, qsObj;\n\n cond = isFunction(cond)? cond : function() {\n return true;\n };\n\n qs = qs.trim().replace(/^\\?/, '');\n pairs = qs.split('&');\n qsObj = {};\n\n forEach(pairs, function (pair) {\n var keyValue, key, value;\n if (pair !== '') {\n keyValue = pair.split('=');\n key = keyValue[0];\n value = keyValue[1];\n if(cond(key, value)){\n qsObj[key] = value;\n }\n }\n });\n\n return qsObj;\n}\n\n/**\n * This function accepts an object and serializes it into a query string without the leading '?'\n * @param obj\n * @returns {string}\n */\nfunction objToQueryString(obj) {\n var pairs = [];\n forEach(obj, function (value, key) {\n pairs.push(key + '=' + value);\n });\n return pairs.join('&');\n}\n\n","function VPAIDAdUnitWrapper(vpaidAdUnit, opts) {\n if (!(this instanceof VPAIDAdUnitWrapper)) {\n return new VPAIDAdUnitWrapper(vpaidAdUnit, opts);\n }\n sanityCheck(vpaidAdUnit, opts);\n\n this.options = extend({}, opts);\n\n this._adUnit = vpaidAdUnit;\n\n /*** Local Functions ***/\n function sanityCheck(adUnit, opts) {\n if (!adUnit || !VPAIDAdUnitWrapper.checkVPAIDInterface(adUnit)) {\n throw new VASTError('on VPAIDAdUnitWrapper, the passed VPAID adUnit does not fully implement the VPAID interface');\n }\n\n if (!isObject(opts)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected options hash but got '\" + opts + \"'\");\n }\n\n if (!(\"responseTimeout\" in opts) || !isNumber(opts.responseTimeout) ){\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected responseTimeout in options\");\n }\n }\n}\n\nVPAIDAdUnitWrapper.checkVPAIDInterface = function checkVPAIDInterface(VPAIDAdUnit) {\n //NOTE: skipAd is not part of the method list because it only appears in VPAID 2.0 and we support VPAID 1.0\n var VPAIDInterfaceMethods = [\n 'handshakeVersion', 'initAd', 'startAd', 'stopAd', 'resizeAd', 'pauseAd', 'expandAd', 'collapseAd'\n ];\n\n for (var i = 0, len = VPAIDInterfaceMethods.length; i < len; i++) {\n if (!VPAIDAdUnit || !isFunction(VPAIDAdUnit[VPAIDInterfaceMethods[i]])) {\n return false;\n }\n }\n\n\n return canSubscribeToEvents(VPAIDAdUnit) && canUnsubscribeFromEvents(VPAIDAdUnit);\n\n /*** Local Functions ***/\n\n function canSubscribeToEvents(adUnit) {\n return isFunction(adUnit.subscribe) || isFunction(adUnit.addEventListener) || isFunction(adUnit.on);\n }\n\n function canUnsubscribeFromEvents(adUnit) {\n return isFunction(adUnit.unsubscribe) || isFunction(adUnit.removeEventListener) || isFunction(adUnit.off);\n\n }\n};\n\nVPAIDAdUnitWrapper.prototype.adUnitAsyncCall = function () {\n var args = arrayLikeObjToArray(arguments);\n var method = args.shift();\n var cb = args.pop();\n var timeoutId;\n\n sanityCheck(method, cb, this._adUnit);\n args.push(wrapCallback());\n\n this._adUnit[method].apply(this._adUnit, args);\n timeoutId = setTimeout(function () {\n timeoutId = null;\n cb(new VASTError(\"on VPAIDAdUnitWrapper, timeout while waiting for a response on call '\" + method + \"'\"));\n cb = noop;\n }, this.options.responseTimeout);\n\n /*** Local functions ***/\n function sanityCheck(method, cb, adUnit) {\n if (!isString(method) || !isFunction(adUnit[method])) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, invalid method name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, missing callback\");\n }\n }\n\n function wrapCallback() {\n return function () {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n cb.apply(this, arguments);\n };\n }\n};\n\nVPAIDAdUnitWrapper.prototype.on = function (evtName, handler) {\n var addEventListener = this._adUnit.addEventListener || this._adUnit.subscribe || this._adUnit.on;\n addEventListener.call(this._adUnit, evtName, handler);\n};\n\nVPAIDAdUnitWrapper.prototype.off = function (evtName, handler) {\n var removeEventListener = this._adUnit.removeEventListener || this._adUnit.unsubscribe || this._adUnit.off;\n removeEventListener.call(this._adUnit, evtName, handler);\n};\n\nVPAIDAdUnitWrapper.prototype.waitForEvent = function (evtName, cb, context) {\n var timeoutId;\n sanityCheck(evtName, cb);\n context = context || null;\n\n this.on(evtName, responseListener);\n\n timeoutId = setTimeout(function () {\n cb(new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, timeout while waiting for event '\" + evtName + \"'\"));\n timeoutId = null;\n cb = noop;\n }, this.options.responseTimeout);\n\n /*** Local functions ***/\n function sanityCheck(evtName, cb) {\n if (!isString(evtName)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing evt name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing callback\");\n }\n }\n\n function responseListener() {\n var args = arrayLikeObjToArray(arguments);\n\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n args.unshift(null);\n cb.apply(context, args);\n }\n};\n\n// VPAID METHODS\nVPAIDAdUnitWrapper.prototype.handshakeVersion = function (version, cb) {\n this.adUnitAsyncCall('handshakeVersion', version, cb);\n};\n\n/* jshint maxparams:6 */\nVPAIDAdUnitWrapper.prototype.initAd = function (width, height, viewMode, desiredBitrate, adUnitData, cb) {\n this.waitForEvent('AdLoaded', cb);\n this._adUnit.initAd(width, height, viewMode, desiredBitrate, adUnitData);\n};\n\nVPAIDAdUnitWrapper.prototype.resizeAd = function (width, height, viewMode, cb) {\n // NOTE: AdSizeChange event is only supported on VPAID 2.0 so for the moment we are not going to use it\n // and will assume that everything is fine after the async call\n this.adUnitAsyncCall('resizeAd', width, height, viewMode, cb);\n};\n\nVPAIDAdUnitWrapper.prototype.startAd = function (cb) {\n this.waitForEvent('AdStarted', cb);\n this._adUnit.startAd();\n};\n\nVPAIDAdUnitWrapper.prototype.stopAd = function (cb) {\n this.waitForEvent('AdStopped', cb);\n this._adUnit.stopAd();\n};\n\nVPAIDAdUnitWrapper.prototype.pauseAd = function (cb) {\n this.waitForEvent('AdPaused', cb);\n this._adUnit.pauseAd();\n};\n\nVPAIDAdUnitWrapper.prototype.resumeAd = function (cb) {\n this.waitForEvent('AdPlaying', cb);\n this._adUnit.resumeAd();\n};\n\nVPAIDAdUnitWrapper.prototype.expandAd = function (cb) {\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.expandAd();\n};\n\nVPAIDAdUnitWrapper.prototype.collapseAd = function (cb) {\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.collapseAd();\n};\n\nVPAIDAdUnitWrapper.prototype.skipAd = function (cb) {\n this.waitForEvent('AdSkipped', cb);\n this._adUnit.skipAd();\n};\n\n//VPAID property getters\n[\n 'adLinear',\n 'adWidth',\n 'adHeight',\n 'adExpanded',\n 'adSkippableState',\n 'adRemainingTime',\n 'adDuration',\n 'adVolume',\n 'adCompanions',\n 'adIcons'\n].forEach(function (property) {\n var getterName = 'get' + capitalize(property);\n\n VPAIDAdUnitWrapper.prototype[getterName] = function (cb) {\n this.adUnitAsyncCall(getterName, cb);\n };\n});\n\n//VPAID property setters\nVPAIDAdUnitWrapper.prototype.setAdVolume = function(volume, cb){\n this.adUnitAsyncCall('setAdVolume',volume, cb);\n};\n","function VPAIDFlashTech(mediaFile, settings) {\n if (!(this instanceof VPAIDFlashTech)) {\n return new VPAIDFlashTech(mediaFile);\n }\n sanityCheck(mediaFile);\n this.name = 'vpaid-flash';\n this.mediaFile = mediaFile;\n this.containerEl = null;\n this.vpaidFlashClient = null;\n this.settings = settings;\n\n /*** local functions ***/\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError('on VPAIDFlashTech, invalid MediaFile');\n }\n }\n}\n\nVPAIDFlashTech.supports = function (type) {\n return type === 'application/x-shockwave-flash' && VPAIDFLASHClient.isSupported();\n};\n\nVPAIDFlashTech.prototype.loadAdUnit = function loadFlashCreative(containerEl, objectEl, callback) {\n var that = this;\n var flashClientOpts = this.settings && this.settings.vpaidFlashLoaderPath ? {data: this.settings.vpaidFlashLoaderPath} : undefined;\n sanityCheck(containerEl, callback);\n\n this.containerEl = containerEl;\n this.vpaidFlashClient = new VPAIDFLASHClient(containerEl, function (error) {\n if (error) {\n return callback(error);\n }\n\n that.vpaidFlashClient.loadAdUnit(that.mediaFile.src, callback);\n }, flashClientOpts);\n\n /*** Local Functions ***/\n function sanityCheck(container, cb) {\n\n if (!dom.isDomElement(container)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, invalid dom container element');\n }\n\n if (!isFunction(cb)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, missing valid callback');\n }\n }\n};\n\nVPAIDFlashTech.prototype.unloadAdUnit = function () {\n if (this.vpaidFlashClient) {\n try{\n this.vpaidFlashClient.destroy();\n } catch(e){\n if(console && isFunction(console.log)){\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n this.vpaidFlashClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n};\n","function VPAIDHTML5Tech(mediaFile) {\n\n if(!(this instanceof VPAIDHTML5Tech)) {\n return new VPAIDHTML5Tech(mediaFile);\n }\n\n sanityCheck(mediaFile);\n\n this.name = 'vpaid-html5';\n this.containerEl = null;\n this.videoEl = null;\n this.vpaidHTMLClient = null;\n\n this.mediaFile = mediaFile;\n\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_MEDIA_FILE);\n }\n }\n}\n\nVPAIDHTML5Tech.supports = function (type) {\n return !isOldIE() && type === 'application/javascript';\n};\n\nVPAIDHTML5Tech.prototype.loadAdUnit = function loadAdUnit(containerEl, videoEl, callback) {\n sanityCheck(containerEl, videoEl, callback);\n\n this.containerEl = containerEl;\n this.videoEl = videoEl;\n this.vpaidHTMLClient = new VPAIDHTML5Client(containerEl, videoEl, {});\n this.vpaidHTMLClient.loadAdUnit(this.mediaFile.src, callback);\n\n function sanityCheck(container, video, cb) {\n if (!dom.isDomElement(container)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!dom.isDomElement(video) || video.tagName.toLowerCase() !== 'video') {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(VPAIDHTML5Tech.MISSING_CALLBACK);\n }\n }\n};\n\nVPAIDHTML5Tech.prototype.unloadAdUnit = function unloadAdUnit() {\n if (this.vpaidHTMLClient) {\n try {\n this.vpaidHTMLClient.destroy();\n } catch(e) {\n if (console && isFunction(console.log)) {\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n\n this.vpaidHTMLClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n};\n\nvar PREFIX = 'on VPAIDHTML5Tech';\nVPAIDHTML5Tech.INVALID_MEDIA_FILE = PREFIX + ', invalid MediaFile';\nVPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL = PREFIX + ', invalid container HtmlElement';\nVPAIDHTML5Tech.INVALID_DOM_VIDEO_EL = PREFIX + ', invalid HTMLVideoElement';\nVPAIDHTML5Tech.MISSING_CALLBACK = PREFIX + ', missing valid callback';\n\n","function VPAIDIntegrator(player, settings) {\n if (!(this instanceof VPAIDIntegrator)) {\n return new VPAIDIntegrator(player);\n }\n\n this.VIEW_MODE = {\n NORMAL: 'normal',\n FULLSCREEN: \"fullscreen\",\n THUMBNAIL: \"thumbnail\"\n };\n this.player = player;\n this.containerEl = createVPAIDContainerEl(player);\n this.options = {\n responseTimeout: 5000,\n VPAID_VERSION: '2.0'\n };\n this.settings = settings;\n\n /*** Local functions ***/\n\n function createVPAIDContainerEl() {\n var containerEl = document.createElement('div');\n dom.addClass(containerEl, 'VPAID-container');\n player.el().insertBefore(containerEl, player.controlBar.el());\n return containerEl;\n\n }\n}\n\n//List of supported VPAID technologies\nVPAIDIntegrator.techs = [\n VPAIDFlashTech,\n VPAIDHTML5Tech\n];\n\nVPAIDIntegrator.prototype.playAd = function playVPaidAd(vastResponse, callback) {\n var that = this;\n var tech;\n var player = this.player;\n\n callback = callback || noop;\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('on VASTIntegrator.playAd, missing required VASTResponse'));\n }\n\n tech = this._findSupportedTech(vastResponse, this.settings);\n dom.addClass(player.el(), 'vjs-vpaid-ad');\n\n player.on('vast.adsCancel', triggerVpaidAdEnd);\n player.one('vpaid.adEnd', function(){\n player.off('vast.adsCancel', triggerVpaidAdEnd);\n removeAdUnit();\n });\n\n if (tech) {\n async.waterfall([\n function (next) {\n next(null, tech, vastResponse);\n },\n this._loadAdUnit.bind(this),\n this._playAdUnit.bind(this),\n this._finishPlaying.bind(this)\n\n ], function (error, adUnit, vastResponse) {\n if (error) {\n that._trackError(vastResponse);\n }\n player.trigger('vpaid.adEnd');\n callback(error, vastResponse);\n });\n\n this._adUnit = {\n _paused: true,\n type: 'VPAID',\n pauseAd: function() {\n player.trigger('vpaid.pauseAd');\n player.pause(true);//we make sure that the video content gets stopped.\n },\n resumeAd: function() {\n player.trigger('vpaid.resumeAd');\n },\n isPaused: function() {\n return this._paused;\n },\n getSrc: function() {\n return tech.mediaFile;\n }\n };\n\n return this._adUnit;\n }\n\n callback(new VASTError('on VPAIDIntegrator.playAd, could not find a supported mediaFile'));\n\n return null;\n /*** Local functions ***/\n function triggerVpaidAdEnd(){\n player.trigger('vpaid.adEnd');\n }\n\n function removeAdUnit() {\n if (tech) {\n tech.unloadAdUnit();\n }\n dom.removeClass(player.el(), 'vjs-vpaid-ad');\n }\n};\n\nVPAIDIntegrator.prototype._findSupportedTech = function (vastResponse, settings) {\n if (!(vastResponse instanceof VASTResponse)) {\n return null;\n }\n\n var vpaidMediaFiles = vastResponse.mediaFiles.filter(vastUtil.isVPAID);\n var i, len, mediaFile, VPAIDTech;\n\n for (i = 0, len = vpaidMediaFiles.length; i < len; i += 1) {\n mediaFile = vpaidMediaFiles[i];\n VPAIDTech = findSupportedTech(mediaFile);\n if (VPAIDTech) {\n return new VPAIDTech(mediaFile, settings);\n }\n }\n\n return null;\n\n /*** Local functions ***/\n function findSupportedTech(mediafile) {\n var type = mediafile.type;\n var i, len, VPAIDTech;\n\n for (i = 0, len = VPAIDIntegrator.techs.length; i < len; i += 1) {\n VPAIDTech = VPAIDIntegrator.techs[i];\n if (VPAIDTech.supports(type)) {\n return VPAIDTech;\n }\n }\n return null;\n }\n};\n\nVPAIDIntegrator.prototype._loadAdUnit = function (tech, vastResponse, next) {\n var player = this.player;\n var vjsTechEl = player.el().querySelector('.vjs-tech');\n var responseTimeout = this.settings.responseTimeout || this.options.responseTimeout;\n tech.loadAdUnit(this.containerEl, vjsTechEl, function (error, adUnit) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n try {\n var WrappedAdUnit = new VPAIDAdUnitWrapper(adUnit, {src: tech.mediaFile.src, responseTimeout: responseTimeout});\n var techClass = 'vjs-' + tech.name + '-ad';\n dom.addClass(player.el(), techClass);\n player.one('vpaid.adEnd', function() {\n dom.removeClass(player.el(),techClass);\n });\n next(null, WrappedAdUnit, vastResponse);\n } catch (e) {\n next(e, adUnit, vastResponse);\n }\n });\n};\n\nVPAIDIntegrator.prototype._playAdUnit = function (adUnit, vastResponse, callback) {\n async.waterfall([\n function (next) {\n next(null, adUnit, vastResponse);\n },\n this._handshake.bind(this),\n this._initAd.bind(this),\n this._setupEvents.bind(this),\n this._addSkipButton.bind(this),\n this._linkPlayerControls.bind(this),\n this._startAd.bind(this)\n ], callback);\n};\n\nVPAIDIntegrator.prototype._handshake = function handshake(adUnit, vastResponse, next) {\n adUnit.handshakeVersion(this.options.VPAID_VERSION, function (error, version) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n if (version && isSupportedVersion(version)) {\n return next(null, adUnit, vastResponse);\n }\n\n return next(new VASTError('on VPAIDIntegrator._handshake, unsupported version \"' + version + '\"'), adUnit, vastResponse);\n });\n\n function isSupportedVersion(version) {\n var majorNum = major(version);\n return majorNum >= 1 && majorNum <= 2;\n }\n\n function major(version) {\n var parts = version.split('.');\n return parseInt(parts[0], 10);\n }\n};\n\nVPAIDIntegrator.prototype._initAd = function (adUnit, vastResponse, next) {\n var tech = this.player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, {AdParameters: vastResponse.adParameters || ''}, function (error) {\n next(error, adUnit, vastResponse);\n });\n};\n\nVPAIDIntegrator.prototype._setupEvents = function (adUnit, vastResponse, next) {\n var adUnitSrc = adUnit.options.src;\n var tracker = new VASTTracker(adUnitSrc, vastResponse);\n var player = this.player;\n var that = this;\n\n adUnit.on('AdSkipped', function () {\n player.trigger('vpaid.AdSkipped');\n tracker.trackSkip();\n });\n\n adUnit.on('AdImpression', function () {\n player.trigger('vpaid.AdImpression');\n tracker.trackImpressions();\n });\n\n adUnit.on('AdStarted', function () {\n player.trigger('vpaid.AdStarted');\n tracker.trackCreativeView();\n notifyPlayToPlayer();\n });\n\n adUnit.on('AdVideoStart', function () {\n player.trigger('vpaid.AdVideoStart');\n tracker.trackStart();\n notifyPlayToPlayer();\n });\n\n adUnit.on('AdPlaying', function () {\n player.trigger('vpaid.AdPlaying');\n tracker.trackResume();\n notifyPlayToPlayer();\n });\n\n adUnit.on('AdPaused', function () {\n player.trigger('vpaid.AdPaused');\n tracker.trackPause();\n notifyPauseToPlayer();\n });\n\n function notifyPlayToPlayer(){\n if(that._adUnit && that._adUnit.isPaused()){\n that._adUnit._paused = false;\n }\n player.trigger('play');\n\n }\n\n function notifyPauseToPlayer() {\n if(that._adUnit){\n that._adUnit._paused = true;\n }\n player.trigger('pause');\n }\n\n adUnit.on('AdVideoFirstQuartile', function () {\n player.trigger('vpaid.AdVideoFirstQuartile');\n tracker.trackFirstQuartile();\n });\n\n adUnit.on('AdVideoMidpoint', function () {\n player.trigger('vpaid.AdVideoMidpoint');\n tracker.trackMidpoint();\n });\n\n adUnit.on('AdVideoThirdQuartile', function () {\n player.trigger('vpaid.AdVideoThirdQuartile');\n tracker.trackThirdQuartile();\n });\n\n adUnit.on('AdVideoComplete', function () {\n player.trigger('vpaid.AdVideoComplete');\n tracker.trackComplete();\n });\n\n adUnit.on('AdClickThru', function (data) {\n player.trigger('vpaid.AdClickThru');\n var url = data.url;\n var playerHandles = data.playerHandles;\n var clickThruUrl = isNotEmptyString(url) ? url : generateClickThroughURL(vastResponse.clickThrough);\n\n tracker.trackClick();\n if (playerHandles && clickThruUrl) {\n window.open(clickThruUrl, '_blank');\n }\n\n function generateClickThroughURL(clickThroughMacro) {\n var variables = {\n ASSETURI: adUnit.options.src,\n CONTENTPLAYHEAD: 0 //In VPAID there is no method to know the current time from the adUnit\n };\n\n return clickThroughMacro ? vastUtil.parseURLMacro(clickThroughMacro, variables) : null;\n }\n });\n\n adUnit.on('AdUserAcceptInvitation', function () {\n player.trigger('vpaid.AdUserAcceptInvitation');\n tracker.trackAcceptInvitation();\n tracker.trackAcceptInvitationLinear();\n });\n\n adUnit.on('AdUserClose', function () {\n player.trigger('vpaid.AdUserClose');\n tracker.trackClose();\n tracker.trackCloseLinear();\n });\n\n adUnit.on('AdUserMinimize', function () {\n player.trigger('vpaid.AdUserMinimize');\n tracker.trackCollapse();\n });\n\n adUnit.on('AdError', function () {\n player.trigger('vpaid.AdError');\n //NOTE: we track errors code 901, as noted in VAST 3.0\n tracker.trackErrorWithCode(901);\n });\n\n adUnit.on('AdVolumeChange', function () {\n player.trigger('vpaid.AdVolumeChange');\n var lastVolume = player.volume();\n adUnit.getAdVolume(function (error, currentVolume) {\n if (currentVolume === 0 && lastVolume > 0) {\n tracker.trackMute();\n }\n\n if (currentVolume > 0 && lastVolume === 0) {\n tracker.trackUnmute();\n }\n\n player.volume(currentVolume);\n });\n });\n\n var updateViewSize = resizeAd.bind(this, player, adUnit, this.VIEW_MODE);\n var updateViewSizeThrottled = throttle(updateViewSize, 100);\n var autoResize = this.settings.autoResize;\n\n if (autoResize) {\n dom.addEventListener(window, 'resize', updateViewSizeThrottled);\n dom.addEventListener(window, 'orientationchange', updateViewSizeThrottled);\n }\n\n player.on('vast.resize', updateViewSize);\n player.on('vpaid.pauseAd', pauseAdUnit);\n player.on('vpaid.resumeAd', resumeAdUnit);\n\n player.one('vpaid.adEnd', function () {\n player.off('vast.resize', updateViewSize);\n player.off('vpaid.pauseAd', pauseAdUnit);\n player.off('vpaid.resumeAd', resumeAdUnit);\n\n if (autoResize) {\n dom.removeEventListener(window, 'resize', updateViewSizeThrottled);\n dom.removeEventListener(window, 'orientationchange', updateViewSizeThrottled);\n }\n });\n\n next(null, adUnit, vastResponse);\n\n /*** Local Functions ***/\n function pauseAdUnit() {\n adUnit.pauseAd(noop);\n }\n\n function resumeAdUnit() {\n adUnit.resumeAd(noop);\n }\n};\n\nVPAIDIntegrator.prototype._addSkipButton = function (adUnit, vastResponse, next) {\n var skipButton;\n var player = this.player;\n\n adUnit.on('AdSkippableStateChange', updateSkipButtonState);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeSkipButton);\n\n next(null, adUnit, vastResponse);\n\n /*** Local function ***/\n function updateSkipButtonState() {\n player.trigger('vpaid.AdSkippableStateChange');\n adUnit.getAdSkippableState(function (error, isSkippable) {\n if (isSkippable) {\n if (!skipButton) {\n addSkipButton(player);\n }\n } else {\n removeSkipButton(player);\n }\n });\n }\n\n function addSkipButton(player) {\n skipButton = createSkipButton(player);\n player.el().appendChild(skipButton);\n }\n\n function removeSkipButton() {\n dom.remove(skipButton);\n skipButton = null;\n }\n\n function createSkipButton() {\n var skipButton = window.document.createElement(\"div\");\n dom.addClass(skipButton, \"vast-skip-button\");\n dom.addClass(skipButton, \"enabled\");\n skipButton.innerHTML = \"Skip ad\";\n\n skipButton.onclick = function (e) {\n adUnit.skipAd(noop);//We skip the adUnit\n\n //We prevent event propagation to avoid problems with the clickThrough and so on\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n } else {\n return false;\n }\n };\n\n return skipButton;\n }\n};\n\nVPAIDIntegrator.prototype._linkPlayerControls = function (adUnit, vastResponse, next) {\n linkVolumeControl(this.player, adUnit);\n linkFullScreenControl(this.player, adUnit, this.VIEW_MODE);\n\n next(null, adUnit, vastResponse);\n\n /*** Local functions ***/\n function linkVolumeControl(player, adUnit) {\n player.on('volumechange', updateAdUnitVolume);\n adUnit.on('AdVolumeChange', updatePlayerVolume);\n\n player.one('vpaid.adEnd', function () {\n player.off('volumechange', updateAdUnitVolume);\n });\n\n\n /*** local functions ***/\n function updateAdUnitVolume() {\n var vol = player.muted() ? 0 : player.volume();\n adUnit.setAdVolume(vol, logError);\n }\n\n function updatePlayerVolume() {\n player.trigger('vpaid.AdVolumeChange');\n adUnit.getAdVolume(function (error, vol) {\n if (error) {\n logError(error);\n } else {\n player.volume(vol);\n }\n });\n }\n }\n\n function linkFullScreenControl(player, adUnit, VIEW_MODE) {\n var updateViewSize = resizeAd.bind(this, player, adUnit, VIEW_MODE);\n\n player.on('fullscreenchange', updateViewSize);\n\n player.one('vpaid.adEnd', function () {\n player.off('fullscreenchange', updateViewSize);\n });\n }\n};\n\nVPAIDIntegrator.prototype._startAd = function (adUnit, vastResponse, next) {\n var player = this.player;\n\n adUnit.startAd(function (error) {\n if (!error) {\n player.trigger('vast.adStart');\n }\n next(error, adUnit, vastResponse);\n });\n};\n\nVPAIDIntegrator.prototype._finishPlaying = function (adUnit, vastResponse, next) {\n var player = this.player;\n adUnit.on('AdStopped', function () {\n player.trigger('vpaid.AdStopped');\n finishPlayingAd(null);\n });\n\n adUnit.on('AdError', function (error) {\n var errMsg = error? error.message : 'on VPAIDIntegrator, error while waiting for the adUnit to finish playing';\n finishPlayingAd(new VASTError(errMsg));\n });\n\n /*** local functions ***/\n function finishPlayingAd(error) {\n next(error, adUnit, vastResponse);\n }\n};\n\nVPAIDIntegrator.prototype._trackError = function trackError(response) {\n vastUtil.track(response.errorURLMacros, {ERRORCODE: 901});\n};\n\nfunction resizeAd(player, adUnit, VIEW_MODE) {\n var tech = player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n var MODE = player.isFullscreen() ? VIEW_MODE.FULLSCREEN : VIEW_MODE.NORMAL;\n adUnit.resizeAd(dimension.width, dimension.height, MODE, logError);\n}\n\nfunction logError(error) {\n if (error && console && console.log) {\n console.log('ERROR: ' + error.message, error);\n }\n}\n","function Ad(adJTree) {\n if (!(this instanceof Ad)) {\n return new Ad(adJTree);\n }\n\n this.id = adJTree.attr('id');\n this.sequence = adJTree.attr('sequence');\n\n if(adJTree.inLine) {\n this.inLine = new InLine(adJTree.inLine);\n }\n\n if(adJTree.wrapper){\n this.wrapper = new Wrapper(adJTree.wrapper);\n }\n}","\nfunction Creative(creativeJTree) {\n if(!(this instanceof Creative)) {\n return new Creative(creativeJTree);\n }\n\n this.id = creativeJTree.attr('id');\n this.sequence = creativeJTree.attr('sequence');\n this.adId = creativeJTree.attr('adId');\n this.apiFramework = creativeJTree.attr('apiFramework');\n\n if(creativeJTree.linear) {\n this.linear = new Linear(creativeJTree.linear);\n }\n}","function InLine(inlineJTree) {\n if (!(this instanceof InLine)) {\n return new InLine(inlineJTree);\n }\n\n //Required Fields\n this.adTitle = xml.keyValue(inlineJTree.adTitle);\n this.adSystem = xml.keyValue(inlineJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(inlineJTree.impression);\n this.creatives = vastUtil.parseCreatives(inlineJTree.creatives);\n\n //Optional Fields\n this.description = xml.keyValue(inlineJTree.description);\n this.advertiser = xml.keyValue(inlineJTree.advertiser);\n this.surveys = parseSurveys(inlineJTree.survey);\n this.error = xml.keyValue(inlineJTree.error);\n this.pricing = xml.keyValue(inlineJTree.pricing);\n this.extensions = inlineJTree.extensions;\n\n /*** Local Functions ***/\n function parseSurveys(inlineSurveys) {\n if (inlineSurveys) {\n return transformArray(isArray(inlineSurveys) ? inlineSurveys : [inlineSurveys], function (survey) {\n if(isNotEmptyString(survey.keyValue)){\n return {\n uri: survey.keyValue,\n type: survey.attr('type')\n };\n }\n\n return undefined;\n });\n }\n return [];\n }\n}","function Linear(linearJTree) {\n if (!(this instanceof Linear)) {\n return new Linear(linearJTree);\n }\n\n //Required Elements\n this.duration = vastUtil.parseDuration(xml.keyValue(linearJTree.duration));\n this.mediaFiles = parseMediaFiles(linearJTree.mediaFiles && linearJTree.mediaFiles.mediaFile);\n\n //Optional fields\n this.trackingEvents = parseTrackingEvents(linearJTree.trackingEvents && linearJTree.trackingEvents.tracking, this.duration);\n this.skipoffset = vastUtil.parseOffset(xml.attr(linearJTree, 'skipoffset'), this.duration);\n\n if (linearJTree.videoClicks) {\n this.videoClicks = new VideoClicks(linearJTree.videoClicks);\n }\n \n if(linearJTree.adParameters) {\n this.adParameters = xml.keyValue(linearJTree.adParameters);\n\n if(xml.attr(linearJTree.adParameters, 'xmlEncoded')){\n this.adParameters = xml.decode(this.adParameters);\n }\n }\n\n /*** Local functions ***/\n function parseTrackingEvents(trackingEvents, duration) {\n var trackings = [];\n if (isDefined(trackingEvents)) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function (trackingData) {\n trackings.push(new TrackingEvent(trackingData, duration));\n });\n }\n return trackings;\n }\n\n function parseMediaFiles(mediaFilesJxonTree) {\n var mediaFiles = [];\n if (isDefined(mediaFilesJxonTree)) {\n mediaFilesJxonTree = isArray(mediaFilesJxonTree) ? mediaFilesJxonTree : [mediaFilesJxonTree];\n\n mediaFilesJxonTree.forEach(function (mfData) {\n mediaFiles.push(new MediaFile(mfData));\n });\n }\n return mediaFiles;\n }\n}","function MediaFile(mediaFileJTree) {\n if (!(this instanceof MediaFile)) {\n return new MediaFile(mediaFileJTree);\n }\n\n //Required attributes\n this.src = xml.keyValue(mediaFileJTree);\n this.delivery = mediaFileJTree.attr('delivery');\n this.type = mediaFileJTree.attr('type');\n this.width = mediaFileJTree.attr('width');\n this.height = mediaFileJTree.attr('height');\n\n //Optional attributes\n this.codec = mediaFileJTree.attr('codec');\n this.id = mediaFileJTree.attr('id');\n this.bitrate = mediaFileJTree.attr('bitrate');\n this.minBitrate = mediaFileJTree.attr('minBitrate');\n this.maxBitrate = mediaFileJTree.attr('maxBitrate');\n this.scalable = mediaFileJTree.attr('scalable');\n this.maintainAspectRatio = mediaFileJTree.attr('maintainAspectRatio');\n this.apiFramework = mediaFileJTree.attr('apiFramework');\n}","function TrackingEvent(trackingJTree, duration) {\n if (!(this instanceof TrackingEvent)) {\n return new TrackingEvent(trackingJTree, duration);\n }\n\n this.name = trackingJTree.attr('event');\n this.uri = xml.keyValue(trackingJTree);\n\n if('progress' === this.name) {\n this.offset = vastUtil.parseOffset(trackingJTree.attr('offset'), duration);\n }\n}\n","function VASTClient(options) {\n if (!(this instanceof VASTClient)) {\n return new VASTClient(options);\n }\n var defaultOptions = {\n WRAPPER_LIMIT: 5\n };\n\n options = options || {};\n this.settings = extend({}, options, defaultOptions);\n this.errorURLMacros = [];\n}\n\nVASTClient.prototype.getVASTResponse = function getVASTResponse(adTagUrl, callback) {\n var that = this;\n\n var error = sanityCheck(adTagUrl, callback);\n if (error) {\n if (isFunction(callback)) {\n return callback(error);\n }\n throw error;\n }\n\n async.waterfall([\n this._getVASTAd.bind(this, adTagUrl),\n buildVASTResponse\n ],\n callback);\n\n /*** Local functions ***/\n function buildVASTResponse(adsChain, cb) {\n try {\n var response = that._buildVASTResponse(adsChain);\n cb(null, response);\n } catch (e) {\n cb(e);\n }\n }\n\n function sanityCheck(adTagUrl, cb) {\n if (!adTagUrl) {\n return new VASTError('on VASTClient.getVASTResponse, missing ad tag URL');\n }\n\n if (!isFunction(cb)) {\n return new VASTError('on VASTClient.getVASTResponse, missing callback function');\n }\n }\n};\n\nVASTClient.prototype._getVASTAd = function (adTagUrl, callback) {\n var that = this;\n\n getAdWaterfall(adTagUrl, function (error, vastTree) {\n var waterfallAds = vastTree && isArray(vastTree.ads) ? vastTree.ads : null;\n if (error) {\n that._trackError(error, waterfallAds);\n return callback(error, waterfallAds);\n }\n\n getAd(waterfallAds.shift(), [], waterfallHandler);\n\n /*** Local functions ***/\n function waterfallHandler(error, adChain) {\n if (error) {\n that._trackError(error, adChain);\n if (waterfallAds.length > 0) {\n getAd(waterfallAds.shift(),[], waterfallHandler);\n } else {\n callback(error, adChain);\n }\n } else {\n callback(null, adChain);\n }\n }\n });\n\n /*** Local functions ***/\n function getAdWaterfall(adTagUrl, callback) {\n var requestVastXML = that._requestVASTXml.bind(that, adTagUrl);\n async.waterfall([\n requestVastXML,\n buildVastWaterfall\n ], callback);\n }\n\n function buildVastWaterfall(xmlStr, callback) {\n var vastTree;\n try {\n vastTree = xml.toJXONTree(xmlStr);\n vastTree.ads = isArray(vastTree.ad) ? vastTree.ad : [vastTree.ad];\n callback(validateVASTTree(vastTree), vastTree);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.buildVastWaterfall, error parsing xml\", 100), null);\n }\n }\n\n function validateVASTTree(vastTree) {\n var vastVersion = xml.attr(vastTree, 'version');\n\n if (!vastTree.ad) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, no Ad in VAST tree', 303);\n }\n\n if (vastVersion && (vastVersion != 3 && vastVersion != 2)) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, not supported VAST version \"' + vastVersion + '\"', 102);\n }\n\n return null;\n }\n\n function getAd(adTagUrl, adChain, callback) {\n if (adChain.length >= that.WRAPPER_LIMIT) {\n return callback(new VASTError(\"on VASTClient.getVASTAd.getAd, players wrapper limit reached (the limit is \" + that.WRAPPER_LIMIT + \")\", 302), adChain);\n }\n\n async.waterfall([\n function (next) {\n if (isString(adTagUrl)) {\n requestVASTAd(adTagUrl, next);\n } else {\n next(null, adTagUrl);\n }\n },\n buildAd\n ], function (error, ad) {\n if (ad) {\n adChain.push(ad);\n }\n\n if (error) {\n return callback(error, adChain);\n }\n\n if (ad.wrapper) {\n return getAd(ad.wrapper.VASTAdTagURI, adChain, callback);\n }\n\n return callback(null, adChain);\n });\n }\n\n function buildAd(adJxonTree, callback) {\n try {\n var ad = new Ad(adJxonTree);\n callback(validateAd(ad), ad);\n } catch (e) {\n callback(new VASTError('on VASTClient.getVASTAd.buildAd, error parsing xml', 100), null);\n }\n }\n\n function validateAd(ad) {\n var wrapper = ad.wrapper;\n var inLine = ad.inLine;\n var errMsgPrefix = 'on VASTClient.getVASTAd.validateAd, ';\n\n if (inLine && wrapper) {\n return new VASTError(errMsgPrefix +\"InLine and Wrapper both found on the same Ad\", 101);\n }\n\n if (!inLine && !wrapper) {\n return new VASTError(errMsgPrefix + \"nor wrapper nor inline elements found on the Ad\", 101);\n }\n\n if (inLine && inLine.creatives.length === 0) {\n return new VASTError(errMsgPrefix + \"missing creative in InLine element\", 101);\n }\n\n if (wrapper && !wrapper.VASTAdTagURI) {\n return new VASTError(errMsgPrefix + \"missing 'VASTAdTagURI' in wrapper\", 101);\n }\n }\n\n function requestVASTAd(adTagUrl, callback) {\n that._requestVASTXml(adTagUrl, function (error, xmlStr) {\n if (error) {\n return callback(error);\n }\n try {\n var vastTree = xml.toJXONTree(xmlStr);\n callback(validateVASTTree(vastTree), vastTree.ad);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.requestVASTAd, error parsing xml\", 100));\n }\n });\n }\n};\n\nVASTClient.prototype._requestVASTXml = function requestVASTXml(adTagUrl, callback) {\n try {\n if (isFunction(adTagUrl)) {\n adTagUrl(requestHandler);\n } else {\n http.get(adTagUrl, requestHandler, {\n withCredentials: true\n });\n }\n } catch (e) {\n callback(e);\n }\n\n /*** Local functions ***/\n function requestHandler(error, response, status) {\n if (error) {\n var errMsg = isDefined(status) ?\n \"on VASTClient.requestVastXML, HTTP request error with status '\" + status + \"'\" :\n \"on VASTClient.requestVastXML, Error getting the the VAST XML with he passed adTagXML fn\";\n return callback(new VASTError(errMsg, 301), null);\n }\n\n callback(null, response);\n }\n};\n\nVASTClient.prototype._buildVASTResponse = function buildVASTResponse(adsChain) {\n var response = new VASTResponse();\n addAdsToResponse(response, adsChain);\n validateResponse(response);\n\n return response;\n\n //*** Local function ****\n function addAdsToResponse(response, ads) {\n ads.forEach(function (ad) {\n response.addAd(ad);\n });\n }\n\n function validateResponse(response) {\n var progressEvents = response.trackingEvents.progress;\n\n if (!response.hasLinear()) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Received an Ad type that is not supported\", 200);\n }\n\n if (response.duration === undefined) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Missing duration field in VAST response\", 101);\n }\n\n if (progressEvents) {\n progressEvents.forEach(function (progressEvent) {\n if (!isNumber(progressEvent.offset)) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, missing or wrong offset attribute on progress tracking event\", 101);\n }\n });\n }\n }\n};\n\nVASTClient.prototype._trackError = function (error, adChain) {\n if (!isArray(adChain) || adChain.length === 0) { //There is nothing to track\n return;\n }\n\n var errorURLMacros = [];\n adChain.forEach(addErrorUrlMacros);\n vastUtil.track(errorURLMacros, {ERRORCODE: error.code || 900}); //900 <== Undefined error\n\n /*** Local functions ***/\n function addErrorUrlMacros(ad) {\n if (ad.wrapper && ad.wrapper.error) {\n errorURLMacros.push(ad.wrapper.error);\n }\n\n if (ad.inLine && ad.inLine.error) {\n errorURLMacros.push(ad.inLine.error);\n }\n }\n};\n","var VAST = {};\n\nfunction VASTError(message, code) {\n this.message = 'VAST Error: ' + (message || '');\n if (code) {\n this.code = code;\n }\n}\n\nVASTError.prototype = new Error();\nVASTError.prototype.name = \"VAST Error\";","/**\n * Inner helper class that deals with the logic of the individual steps needed to setup an ad in the player.\n *\n * @param player {object} instance of the player that will play the ad. It assumes that the videojs-contrib-ads plugin\n * has been initialized when you use its utility functions.\n *\n * @constructor\n */\nfunction VASTIntegrator(player) {\n if (!(this instanceof VASTIntegrator)) {\n return new VASTIntegrator(player);\n }\n\n this.player = player;\n}\n\nVASTIntegrator.prototype.playAd = function playAd(vastResponse, callback) {\n var that = this;\n callback = callback || noop;\n\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('On VASTIntegrator, missing required VASTResponse'));\n }\n\n async.waterfall([\n function (next) {\n next(null, vastResponse);\n },\n this._selectAdSource.bind(this),\n this._createVASTTracker.bind(this),\n this._addClickThrough.bind(this),\n this._addSkipButton.bind(this),\n this._setupEvents.bind(this),\n this._playSelectedAd.bind(this)\n ], function (error, response) {\n if (error && response) {\n that._trackError(error, response);\n }\n callback(error, response);\n });\n\n this._adUnit = {\n _src: null,\n type: 'VAST',\n pauseAd: function () {\n that.player.pause(true);\n },\n\n resumeAd: function () {\n that.player.play(true);\n },\n\n isPaused: function () {\n return that.player.paused(true);\n },\n\n getSrc: function () {\n return this._src;\n }\n };\n\n return this._adUnit;\n};\n\nVASTIntegrator.prototype._selectAdSource = function selectAdSource(response, callback) {\n var source;\n\n var playerWidth = dom.getDimension(this.player.el()).width;\n response.mediaFiles.sort(function compareTo(a, b) {\n var deltaA = Math.abs(playerWidth - a.width);\n var deltaB = Math.abs(playerWidth - b.width);\n return deltaA - deltaB;\n });\n\n source = this.player.selectSource(response.mediaFiles).source;\n\n if (source) {\n if (this._adUnit) {\n this._adUnit._src = source;\n }\n return callback(null, source, response);\n }\n\n // code 403 <== Couldn't find MediaFile that is supported by this video player\n callback(new VASTError(\"Could not find Ad mediafile supported by this player\", 403), response);\n};\n\nVASTIntegrator.prototype._createVASTTracker = function createVASTTracker(adMediaFile, response, callback) {\n try {\n callback(null, adMediaFile, new VASTTracker(adMediaFile.src, response), response);\n } catch (e) {\n callback(e, response);\n }\n};\n\nVASTIntegrator.prototype._setupEvents = function setupEvents(adMediaFile, tracker, response, callback) {\n var previouslyMuted;\n var player = this.player;\n player.on('fullscreenchange', trackFullscreenChange);\n player.on('vast.adStart', trackImpressions);\n player.on('pause', trackPause);\n player.on('timeupdate', trackProgress);\n player.on('volumechange', trackVolumeChange);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], unbindEvents);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adSkip'], function(evt){\n if(evt.type === 'vast.adEnd'){\n tracker.trackComplete();\n }\n });\n\n return callback(null, adMediaFile, response);\n\n /*** Local Functions ***/\n function unbindEvents() {\n player.off('fullscreenchange', trackFullscreenChange);\n player.off('vast.adStart', trackImpressions);\n player.off('pause', trackPause);\n player.off('timeupdate', trackProgress);\n player.off('volumechange', trackVolumeChange);\n }\n\n function trackFullscreenChange() {\n if (player.isFullscreen()) {\n tracker.trackFullscreen();\n } else {\n tracker.trackExitFullscreen();\n }\n }\n\n function trackPause() {\n //NOTE: whenever a video ends the video Element triggers a 'pause' event before the 'ended' event.\n // We should not track this pause event because it makes the VAST tracking confusing again we use a\n // Threshold of 2 seconds to prevent false positives on IOS.\n if (Math.abs(player.duration() - player.currentTime()) < 2) {\n return;\n }\n\n tracker.trackPause();\n playerUtils.once(player, ['play', 'vast.adEnd', 'vast.adsCancel'], function (evt) {\n if(evt.type === 'play'){\n tracker.trackResume();\n }\n });\n }\n\n function trackProgress() {\n var currentTimeInMs = player.currentTime() * 1000;\n tracker.trackProgress(currentTimeInMs);\n }\n\n function trackImpressions() {\n tracker.trackImpressions();\n tracker.trackCreativeView();\n }\n\n function trackVolumeChange() {\n var muted = player.muted();\n if (muted) {\n tracker.trackMute();\n } else if (previouslyMuted) {\n tracker.trackUnmute();\n }\n previouslyMuted = muted;\n }\n};\n\nVASTIntegrator.prototype._addSkipButton = function addSkipButton(source, tracker, response, callback) {\n var skipOffsetInSec;\n\n if (isNumber(response.skipoffset)) {\n skipOffsetInSec = response.skipoffset / 1000;\n addSkipButtonToPlayer(this.player, skipOffsetInSec);\n }\n callback(null, source, tracker, response);\n\n /*** Local function ***/\n function addSkipButtonToPlayer(player, skipOffset) {\n var skipButton = createSkipButton(player);\n var updateSkipButton = updateSkipButtonState.bind(this, skipButton, skipOffset, player);\n\n player.el().appendChild(skipButton);\n player.on('timeupdate', updateSkipButton);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeSkipButton);\n\n function removeSkipButton() {\n player.off('timeupdate', updateSkipButton);\n dom.remove(skipButton);\n }\n }\n\n function createSkipButton(player) {\n var skipButton = window.document.createElement(\"div\");\n dom.addClass(skipButton, \"vast-skip-button\");\n\n skipButton.onclick = function (e) {\n if (dom.hasClass(skipButton, 'enabled')) {\n tracker.trackSkip();\n player.trigger('vast.adSkip');\n }\n\n //We prevent event propagation to avoid problems with the clickThrough and so on\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n } else {\n return false;\n }\n };\n\n return skipButton;\n }\n\n function updateSkipButtonState(skipButton, skipOffset, player) {\n var timeLeft = Math.ceil(skipOffset - player.currentTime());\n if (timeLeft > 0) {\n skipButton.innerHTML = \"Skip in \" + toFixedDigits(timeLeft, 2) + \"...\";\n } else {\n if (!dom.hasClass(skipButton, 'enabled')) {\n dom.addClass(skipButton, 'enabled');\n skipButton.innerHTML = \"Skip ad\";\n }\n }\n }\n};\n\nVASTIntegrator.prototype._addClickThrough = function addClickThrough(mediaFile, tracker, response, callback) {\n var player = this.player;\n var blocker = createClickThroughBlocker(player, tracker, response);\n var updateBlocker = updateBlockerURL.bind(this, blocker, response, player);\n\n player.el().insertBefore(blocker, player.controlBar.el());\n player.on('timeupdate', updateBlocker);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeBlocker);\n\n return callback(null, mediaFile, tracker, response);\n\n /*** Local Functions ***/\n\n function createClickThroughBlocker(player, tracker, response) {\n var blocker = window.document.createElement(\"a\");\n var clickThroughMacro = response.clickThrough;\n\n dom.addClass(blocker, 'vast-blocker');\n blocker.href = generateClickThroughURL(clickThroughMacro, player);\n\n if (isString(clickThroughMacro)) {\n blocker.target = \"_blank\";\n }\n\n blocker.onclick = function (e) {\n if (player.paused()) {\n player.play();\n\n //We prevent event propagation to avoid problems with the player's normal pause mechanism\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n }\n return false;\n }\n\n player.pause();\n tracker.trackClick();\n };\n\n return blocker;\n }\n\n function updateBlockerURL(blocker, response, player) {\n blocker.href = generateClickThroughURL(response.clickThrough, player);\n }\n\n function generateClickThroughURL(clickThroughMacro, player) {\n var variables = {\n ASSETURI: mediaFile.src,\n CONTENTPLAYHEAD: vastUtil.formatProgress(player.currentTime() * 1000)\n };\n\n return clickThroughMacro ? vastUtil.parseURLMacro(clickThroughMacro, variables) : '#';\n }\n\n function removeBlocker() {\n player.off('timeupdate', updateBlocker);\n dom.remove(blocker);\n }\n};\n\nVASTIntegrator.prototype._playSelectedAd = function playSelectedAd(source, response, callback) {\n var player = this.player;\n\n player.preload(\"auto\"); //without preload=auto the durationchange event is never fired\n player.src(source);\n\n playerUtils.once(player, ['durationchange', 'error', 'vast.adsCancel'], function (evt) {\n if (evt.type === 'durationchange') {\n playAd();\n } else if(evt.type === 'error') {\n callback(new VASTError(\"on VASTIntegrator, Player is unable to play the Ad\", 400), response);\n }\n //NOTE: If the ads get canceled we do nothing/\n });\n\n /**** local functions ******/\n function playAd() {\n player.play();\n playerUtils.once(player, ['playing', 'vast.adsCancel'], function (evt) {\n if(evt.type === 'vast.adsCancel'){\n return;\n }\n\n player.trigger('vast.adStart');\n\n playerUtils.once(player, ['ended', 'vast.adsCancel', 'vast.adSkip'], function (evt) {\n if(evt.type === 'ended' || evt.type === 'vast.adSkip'){\n callback(null, response);\n }\n //NOTE: if the ads get cancel we do nothing\n });\n });\n }\n};\n\nVASTIntegrator.prototype._trackError = function trackError(error, response) {\n vastUtil.track(response.errorURLMacros, {ERRORCODE: error.code || 900});\n};\n","function VASTTracker(assetURI, vastResponse) {\n if (!(this instanceof VASTTracker)) {\n return new VASTTracker(assetURI, vastResponse);\n }\n\n sanityCheck(assetURI, vastResponse);\n this.response = vastResponse;\n this.assetURI = assetURI;\n this.progress = 0;\n this.quartiles = {\n firstQuartile: {tracked: false, time: Math.round(25 * vastResponse.duration) / 100},\n midpoint: {tracked: false, time: Math.round(50 * vastResponse.duration) / 100},\n thirdQuartile: {tracked: false, time: Math.round(75 * vastResponse.duration) / 100}\n };\n\n /*** Local Functions ***/\n function sanityCheck(assetURI, vastResponse) {\n if (!isString(assetURI) || isEmptyString(assetURI)) {\n throw new VASTError('on VASTTracker constructor, missing required the URI of the ad asset being played');\n }\n\n if (!(vastResponse instanceof VASTResponse)) {\n throw new VASTError('on VASTTracker constructor, missing required VAST response');\n }\n }\n}\n\nVASTTracker.prototype.trackURLs = function trackURLs(urls, variables) {\n if (isArray(urls) && urls.length > 0) {\n variables = extend({\n ASSETURI: this.assetURI,\n CONTENTPLAYHEAD: vastUtil.formatProgress(this.progress)\n }, variables || {});\n\n vastUtil.track(urls, variables);\n }\n};\n\nVASTTracker.prototype.trackEvent = function trackEvent(eventName, trackOnce) {\n this.trackURLs(getEventUris(this.response.trackingEvents[eventName]));\n if (trackOnce) {\n this.response.trackingEvents[eventName] = undefined;\n }\n\n /*** Local function ***/\n function getEventUris(trackingEvents) {\n var uris;\n\n if (trackingEvents) {\n uris = [];\n trackingEvents.forEach(function (event) {\n uris.push(event.uri);\n });\n }\n return uris;\n }\n};\n\nVASTTracker.prototype.trackProgress = function trackProgress(newProgressInMs) {\n var events = [];\n var ONCE = true;\n var ALWAYS = false;\n var trackingEvents = this.response.trackingEvents;\n\n if (isNumber(newProgressInMs)) {\n addTrackEvent('start', ONCE, newProgressInMs > 0);\n addTrackEvent('rewind', ALWAYS, hasRewound(this.progress, newProgressInMs));\n addQuartileEvents.call(this, newProgressInMs);\n trackProgressEvents.call(this, newProgressInMs);\n trackEvents.call(this);\n this.progress = newProgressInMs;\n }\n\n /*** Local function ***/\n function hasRewound(currentProgress, newProgress) {\n var REWIND_THRESHOLD = 3000; //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that there was a rewind an that it was on purpose.\n return currentProgress > newProgressInMs && Math.abs(newProgress - currentProgress) > REWIND_THRESHOLD;\n }\n\n function addTrackEvent(eventName, trackOnce, canBeAdded) {\n if (trackingEvents[eventName] && canBeAdded) {\n events.push({\n name: eventName,\n trackOnce: !!trackOnce\n });\n }\n }\n\n function addQuartileEvents(progress) {\n var quartiles = this.quartiles;\n var firstQuartile = this.quartiles.firstQuartile;\n var midpoint = this.quartiles.midpoint;\n var thirdQuartile = this.quartiles.thirdQuartile;\n\n if (!firstQuartile.tracked) {\n trackQuartile('firstQuartile', progress);\n } else if (!midpoint.tracked) {\n trackQuartile('midpoint', progress);\n } else {\n trackQuartile('thirdQuartile', progress);\n }\n\n /*** Local function ***/\n function trackQuartile(quartileName, progress){\n var quartile = quartiles[quartileName];\n if(canBeTracked(quartile, progress)){\n quartile.tracked = true;\n addTrackEvent(quartileName, ONCE, true);\n }\n }\n }\n\n function canBeTracked(quartile, progress) {\n var quartileTime = quartile.time;\n //We only fire the quartile event if the progress is bigger than the quartile time by 5 seconds at most.\n return progress >= quartileTime && progress <= (quartileTime + 5000);\n }\n\n function trackProgressEvents(progress) {\n if (!isArray(trackingEvents.progress)) {\n return; //Nothing to track\n }\n\n var pendingProgressEvts = [];\n var that = this;\n\n trackingEvents.progress.forEach(function (evt) {\n if (evt.offset <= progress) {\n that.trackURLs([evt.uri]);\n } else {\n pendingProgressEvts.push(evt);\n }\n });\n trackingEvents.progress = pendingProgressEvts;\n }\n\n function trackEvents() {\n events.forEach(function (event) {\n this.trackEvent(event.name, event.trackOnce);\n }, this);\n }\n};\n\n[\n 'rewind',\n 'fullscreen',\n 'exitFullscreen',\n 'pause',\n 'resume',\n 'mute',\n 'unmute',\n 'acceptInvitation',\n 'acceptInvitationLinear',\n 'collapse',\n 'expand'\n].forEach(function (eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function () {\n this.trackEvent(eventName);\n };\n });\n\n[\n 'start',\n 'skip',\n 'close',\n 'closeLinear'\n].forEach(function (eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function () {\n this.trackEvent(eventName, true);\n };\n });\n\n[\n 'firstQuartile',\n 'midpoint',\n 'thirdQuartile'\n].forEach(function (quartile) {\n VASTTracker.prototype['track' + capitalize(quartile)] = function () {\n this.quartiles[quartile].tracked = true;\n this.trackEvent(quartile, true);\n };\n });\n\nVASTTracker.prototype.trackComplete = function () {\n if(this.quartiles.thirdQuartile.tracked){\n this.trackEvent('complete', true);\n }\n};\n\nVASTTracker.prototype.trackErrorWithCode = function trackErrorWithCode(errorcode) {\n if (isNumber(errorcode)) {\n this.trackURLs(this.response.errorURLMacros, {ERRORCODE: errorcode});\n }\n};\n\nVASTTracker.prototype.trackImpressions = function trackImpressions() {\n this.trackURLs(this.response.impressions);\n};\n\nVASTTracker.prototype.trackCreativeView = function trackCreativeView() {\n this.trackEvent('creativeView');\n};\n\nVASTTracker.prototype.trackClick = function trackClick() {\n this.trackURLs(this.response.clickTrackings);\n};\n","function VideoClicks(videoClickJTree) {\n if (!(this instanceof VideoClicks)) {\n return new VideoClicks(videoClickJTree);\n }\n\n this.clickThrough = xml.keyValue(videoClickJTree.clickThrough);\n this.clickTrackings = parseClickTrackings(videoClickJTree.clickTracking);\n this.customClicks = parseClickTrackings(videoClickJTree.customClick);\n\n /*** Local functions ***/\n function parseClickTrackings(trackingData) {\n var clickTrackings = [];\n if (trackingData) {\n trackingData = isArray(trackingData) ? trackingData : [trackingData];\n trackingData.forEach(function (clickTrackingData) {\n clickTrackings.push(xml.keyValue(clickTrackingData));\n });\n }\n return clickTrackings;\n }\n}","function Wrapper(wrapperJTree) {\n if(!(this instanceof Wrapper)) {\n return new Wrapper(wrapperJTree);\n }\n\n //Required elements\n this.adSystem = xml.keyValue(wrapperJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(wrapperJTree.impression);\n this.VASTAdTagURI = xml.keyValue(wrapperJTree.vASTAdTagURI);\n\n //Optional elements\n this.creatives = vastUtil.parseCreatives(wrapperJTree.creatives);\n this.error = xml.keyValue(wrapperJTree.error);\n this.extensions = wrapperJTree.extensions;\n\n //Optional attrs\n this.followAdditionalWrappers = isDefined(xml.attr(wrapperJTree, 'followAdditionalWrappers'))? xml.attr(wrapperJTree, 'followAdditionalWrappers'): true;\n this.allowMultipleAds = xml.attr(wrapperJTree, 'allowMultipleAds');\n this.fallbackOnNoAd = xml.attr(wrapperJTree, 'fallbackOnNoAd');\n}\n\n\n","(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 0) {\n callback(event);\n }\n }, 0);\n }\n });\n }\n }, {\n key: '_callCallback',\n value: function _callCallback(methodName, callbackID, err, result) {\n\n var callback = this._callbacks.get(callbackID);\n\n //not all methods callback's are mandatory\n //but if there exist an error, fire the error event\n if (!callback) {\n if (err && callbackID === '') {\n this.trigger(ERROR, err);\n }\n return;\n }\n\n $asyncCallback.call(this, callbackID, err, result);\n }\n }, {\n key: '_handShake',\n value: function _handShake(err, data) {\n this._ready = true;\n if (this._handShakeHandler) {\n this._handShakeHandler(err, data);\n delete this._handShakeHandler;\n }\n }\n }, {\n key: 'getSize',\n\n //methods like properties specific to this implementation of VPAID\n value: function getSize() {\n return { width: this._width, height: this._height };\n }\n }, {\n key: 'setSize',\n value: function setSize(newWidth, newHeight) {\n this._width = isPositiveInt(newWidth, this._width);\n this._height = isPositiveInt(newHeight, this._height);\n this._el.setAttribute('width', this._width);\n this._el.setAttribute('height', this._height);\n }\n }, {\n key: 'getWidth',\n value: function getWidth() {\n return this._width;\n }\n }, {\n key: 'setWidth',\n value: function setWidth(newWidth) {\n this.setSize(newWidth, this._height);\n }\n }, {\n key: 'getHeight',\n value: function getHeight() {\n return this._height;\n }\n }, {\n key: 'setHeight',\n value: function setHeight(newHeight) {\n this.setSize(this._width, newHeight);\n }\n }, {\n key: 'getFlashID',\n value: function getFlashID() {\n return this._flashID;\n }\n }, {\n key: 'getFlashURL',\n value: function getFlashURL() {\n return this._flashURL;\n }\n }, {\n key: 'isReady',\n value: function isReady() {\n return this._ready;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.offAll();\n this.removeAllCallbacks();\n registry.removeInstanceByID(this._flashID);\n if (this._el.parentElement) {\n this._el.parentElement.removeChild(this._el);\n }\n }\n }]);\n\n return JSFlashBridge;\n})();\n\nexports.JSFlashBridge = JSFlashBridge;\n\nfunction $asyncCallback(callbackID, err, result) {\n var _this3 = this;\n\n setTimeout(function () {\n var callback = _this3._callbacks.get(callbackID);\n if (callback) {\n _this3._callbacks.remove(callbackID);\n callback(err, result);\n }\n }, 0);\n}\n\nObject.defineProperty(JSFlashBridge, 'VPAID_FLASH_HANDLER', {\n writable: false,\n configurable: false,\n value: VPAID_FLASH_HANDLER\n});\n\n/**\n * External interface handler\n *\n * @param {string} flashID identifier of the flash who call this\n * @param {string} typeID what type of message is, can be 'event' or 'callback'\n * @param {string} typeName if the typeID is a event the typeName will be the eventName, if is a callback the typeID is the methodName that is related this callback\n * @param {string} callbackID only applies when the typeID is 'callback', identifier of the callback to call\n * @param {object} error error object\n * @param {object} data\n */\nwindow[VPAID_FLASH_HANDLER] = function (flashID, typeID, typeName, callbackID, error, data) {\n var instance = registry.getInstanceByID(flashID);\n if (!instance) return;\n if (typeName === 'handShake') {\n instance._handShake(error, data);\n } else {\n if (typeID !== 'event') {\n instance._callCallback(typeName, callbackID, error, data);\n } else {\n instance._trigger(typeName, data);\n }\n }\n};\n\n},{\"./jsFlashBridgeRegistry\":5,\"./registry\":6,\"./utils\":7}],5:[function(require,module,exports){\n'use strict';\n\nvar SingleValueRegistry = require('./registry').SingleValueRegistry;\nvar instances = new SingleValueRegistry();\n\nvar JSFlashBridgeRegistry = {};\nObject.defineProperty(JSFlashBridgeRegistry, 'addInstance', {\n writable: false,\n configurable: false,\n value: function value(id, instance) {\n instances.add(id, instance);\n }\n});\n\nObject.defineProperty(JSFlashBridgeRegistry, 'getInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.get(id);\n }\n});\n\nObject.defineProperty(JSFlashBridgeRegistry, 'removeInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.remove(id);\n }\n});\n\nmodule.exports = JSFlashBridgeRegistry;\n\n},{\"./registry\":6}],6:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar MultipleValuesRegistry = (function () {\n function MultipleValuesRegistry() {\n _classCallCheck(this, MultipleValuesRegistry);\n\n this._registries = {};\n }\n\n _createClass(MultipleValuesRegistry, [{\n key: 'add',\n value: function add(id, value) {\n if (!this._registries[id]) {\n this._registries[id] = [];\n }\n if (this._registries[id].indexOf(value) === -1) {\n this._registries[id].push(value);\n }\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id] || [];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this = this;\n\n var keys = Object.keys(this._registries).filter(function (key) {\n return _this._registries[key].indexOf(value) !== -1;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(key, value) {\n if (!this._registries[key]) {\n return;\n }\n\n var index = this._registries[key].indexOf(value);\n\n if (index < 0) {\n return;\n }\n return this._registries[key].splice(index, 1);\n }\n }, {\n key: 'removeByKey',\n value: function removeByKey(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this2 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function (key) {\n return _this2.remove(key, value);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return MultipleValuesRegistry;\n})();\n\nexports.MultipleValuesRegistry = MultipleValuesRegistry;\n\nvar SingleValueRegistry = (function () {\n function SingleValueRegistry() {\n _classCallCheck(this, SingleValueRegistry);\n\n this._registries = {};\n }\n\n _createClass(SingleValueRegistry, [{\n key: 'add',\n value: function add(id, value) {\n this._registries[id] = value;\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this3 = this;\n\n var keys = Object.keys(this._registries).filter(function (key) {\n return _this3._registries[key] === value;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this4 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function (key) {\n return _this4.remove(key);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return SingleValueRegistry;\n})();\n\nexports.SingleValueRegistry = SingleValueRegistry;\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports.unique = unique;\nexports.noop = noop;\nexports.callbackTimeout = callbackTimeout;\nexports.createElementWithID = createElementWithID;\nexports.isPositiveInt = isPositiveInt;\nexports.stringEndsWith = stringEndsWith;\n\nfunction unique(prefix) {\n var count = -1;\n return function (f) {\n return prefix + '_' + ++count;\n };\n}\n\nfunction noop() {}\n\nfunction callbackTimeout(timer, onSuccess, onTimeout) {\n\n var timeout = setTimeout(function () {\n\n onSuccess = noop;\n onTimeout();\n }, timer);\n\n return function () {\n clearTimeout(timeout);\n onSuccess.apply(this, arguments);\n };\n}\n\nfunction createElementWithID(parent, id) {\n var nEl = document.createElement('div');\n nEl.id = id;\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n}\n\nfunction isPositiveInt(newVal, oldVal) {\n return !isNaN(parseFloat(newVal)) && isFinite(newVal) && newVal > 0 ? newVal : oldVal;\n}\n\nvar endsWith = (function () {\n if (String.prototype.endsWith) return String.prototype.endsWith;\n return function endsWith(searchString, position) {\n var subjectString = this.toString();\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n})();\n\nfunction stringEndsWith(string, search) {\n return endsWith.call(string, search);\n}\n\n},{}]},{},[3])\n\n\n//# sourceMappingURL=VPAIDFLASHClient.js.map","(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o\\n\\n\\n \\n\\n\\n \\n \\n
\\n
\\n\\n\\n\";\n\nvar AD_STOPPED = 'AdStopped';\n\n/**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n/**\n * VPAIDHTML5Client\n * @class\n *\n * @param {HTMLElement} el that will contain the iframe to load adUnit and a el to add to adUnit slot\n * @param {HTMLVideoElement} video default video element to be used by adUnit\n * @param {object} [templateConfig] template: html template to be used instead of the default, extraOptions: to be used when rendering the template\n * @param {object} [vpaidOptions] timeout: when loading adUnit\n */\nfunction VPAIDHTML5Client(el, video, templateConfig, vpaidOptions) {\n templateConfig = templateConfig || {};\n\n this._id = unique();\n this._destroyed = false;\n\n this._frameContainer = utils.createElementInEl(el, 'div');\n this._videoEl = video;\n this._vpaidOptions = vpaidOptions || {timeout: 10000};\n\n this._templateConfig = {\n template: templateConfig.template || defaultTemplate,\n extraOptions: templateConfig.extraOptions || {}\n };\n\n}\n\n/**\n * destroy\n *\n */\nVPAIDHTML5Client.prototype.destroy = function destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n $unloadPreviousAdUnit.call(this);\n};\n\n/**\n * isDestroyed\n *\n * @return {boolean}\n */\nVPAIDHTML5Client.prototype.isDestroyed = function isDestroyed() {\n return this._destroyed;\n};\n\n/**\n * loadAdUnit\n *\n * @param {string} adURL url of the js of the adUnit\n * @param {nodeStyleCallback} callback\n */\nVPAIDHTML5Client.prototype.loadAdUnit = function loadAdUnit(adURL, callback) {\n $throwIfDestroyed.call(this);\n $unloadPreviousAdUnit.call(this);\n\n var frame = utils.createIframeWithContent(\n this._frameContainer,\n this._templateConfig.template,\n utils.extend({\n iframeURL_JS: adURL,\n iframeID: this.getID()\n }, this._templateConfig.extraOptions)\n );\n this._frame = frame;\n\n this._onLoad = utils.callbackTimeout(\n this._vpaidOptions.timeout,\n onLoad.bind(this),\n onTimeout.bind(this)\n );\n\n window.addEventListener('message', this._onLoad);\n\n function onLoad (e) {\n /*jshint validthis: false */\n //don't clear timeout\n if (e.origin !== window.location.origin) return;\n var result = JSON.parse(e.data);\n\n //don't clear timeout\n if (result.id !== this.getID()) return;\n\n var adUnit, error, createAd;\n if (!this._frame.contentWindow) {\n\n error = 'the iframe is not anymore in the DOM tree';\n\n } else {\n createAd = this._frame.contentWindow.getVPAIDAd;\n error = utils.validate(typeof createAd === 'function', 'the ad didn\\'t return a function to create an ad');\n }\n\n if (!error) {\n var adEl = this._frame.contentWindow.document.querySelector('.ad-element');\n adUnit = new VPAIDAdUnit(createAd(), adEl, this._videoEl, this._frame);\n adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(this));\n error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');\n }\n\n this._adUnit = adUnit;\n $destroyLoadListener.call(this);\n callback(error, error ? null : adUnit);\n\n //clear timeout\n return true;\n }\n\n function onTimeout() {\n callback('timeout', null);\n }\n};\n\n/**\n * unloadAdUnit\n *\n */\nVPAIDHTML5Client.prototype.unloadAdUnit = function unloadAdUnit() {\n $unloadPreviousAdUnit.call(this);\n};\n\n/**\n * getID will return the unique id\n *\n * @return {string}\n */\nVPAIDHTML5Client.prototype.getID = function () {\n return this._id;\n};\n\n\n/**\n * $removeEl\n *\n * @param {string} key\n */\nfunction $removeEl(key) {\n var el = this[key];\n if (el) {\n el.remove();\n delete this[key];\n }\n}\n\nfunction $adDestroyed() {\n $removeAdElements.call(this);\n delete this._adUnit;\n}\n\nfunction $unloadPreviousAdUnit() {\n $removeAdElements.call(this);\n $destroyAdUnit.call(this);\n}\n\nfunction $removeAdElements() {\n $removeEl.call(this, '_frame');\n $destroyLoadListener.call(this);\n}\n\n/**\n * $destroyLoadListener\n *\n */\nfunction $destroyLoadListener() {\n if (this._onLoad) {\n window.removeEventListener('message', this._onLoad);\n utils.clearCallbackTimeout(this._onLoad);\n delete this._onLoad;\n }\n}\n\n\nfunction $destroyAdUnit() {\n if (this._adUnit) {\n this._adUnit.stopAd();\n delete this._adUnit;\n }\n}\n\n/**\n * $throwIfDestroyed\n *\n */\nfunction $throwIfDestroyed() {\n if (this._destroyed) {\n throw new Error ('VPAIDHTML5Client already destroyed!');\n }\n}\n\nmodule.exports = VPAIDHTML5Client;\nwindow.VPAIDHTML5Client = VPAIDHTML5Client;\n\n\n},{\"./VPAIDAdUnit\":2,\"./utils\":5}],4:[function(require,module,exports){\n'use strict';\n\nfunction Subscriber() {\n this._subscribers = {};\n}\n\nSubscriber.prototype.subscribe = function subscribe(handler, eventName, context) {\n this.get(eventName).push({handler: handler, context: context});\n};\n\nSubscriber.prototype.unsubscribe = function unsubscribe(handler, eventName) {\n this._subscribers[eventName] = this.get(eventName).filter(function (subscriber) {\n return handler === subscriber.handler;\n });\n};\n\nSubscriber.prototype.unsubscribeAll = function unsubscribeAll() {\n this._subscribers = {};\n};\n\nSubscriber.prototype.trigger = function(eventName, data) {\n var that = this;\n that.get(eventName).forEach(function (subscriber) {\n setTimeout(function () {\n if (that.get(eventName)) {\n subscriber.handler.call(subscriber.context, data);\n }\n }, 0);\n });\n};\n\nSubscriber.prototype.triggerSync = function(eventName, data) {\n this.get(eventName).forEach(function (subscriber) {\n subscriber.handler.call(subscriber.context, data);\n });\n};\n\nSubscriber.prototype.get = function get(eventName) {\n if (!this._subscribers[eventName]) {\n this._subscribers[eventName] = [];\n }\n return this._subscribers[eventName];\n};\n\nmodule.exports = Subscriber;\n\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\n/**\n * noop a empty function\n */\nfunction noop() {}\n\n/**\n * validate if is not validate will return an Error with the message\n *\n * @param {boolean} isValid\n * @param {string} message\n */\nfunction validate(isValid, message) {\n return isValid ? null : new Error(message);\n}\n\nvar timeouts = {};\n/**\n * clearCallbackTimeout\n *\n * @param {function} func handler to remove\n */\nfunction clearCallbackTimeout(func) {\n var timeout = timeouts[func];\n if (timeout) {\n clearTimeout(timeout);\n delete timeouts[func];\n }\n}\n\n/**\n * callbackTimeout if the onSuccess is not called and returns true in the timelimit then onTimeout will be called\n *\n * @param {number} timer\n * @param {function} onSuccess\n * @param {function} onTimeout\n */\nfunction callbackTimeout(timer, onSuccess, onTimeout) {\n var callback, timeout;\n\n timeout = setTimeout(function () {\n onSuccess = noop;\n delete timeout[callback];\n onTimeout();\n }, timer);\n\n callback = function () {\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n if (onSuccess.apply(this, arguments)) {\n clearCallbackTimeout(callback);\n }\n };\n\n timeouts[callback] = timeout;\n\n return callback;\n}\n\n\n/**\n * createElementInEl\n *\n * @param {HTMLElement} parent\n * @param {string} tagName\n * @param {string} id\n */\nfunction createElementInEl(parent, tagName, id) {\n var nEl = document.createElement(tagName);\n if (id) nEl.id = id;\n parent.appendChild(nEl);\n return nEl;\n}\n\n/**\n * createIframeWithContent\n *\n * @param {HTMLElement} parent\n * @param {string} template simple template using {{var}}\n * @param {object} data\n */\nfunction createIframeWithContent(parent, template, data) {\n var iframe = createIframe(parent);\n if (!setIframeContent(iframe, simpleTemplate(template, data))) return;\n return iframe;\n}\n\n/**\n * createIframe\n *\n * @param {HTMLElement} parent\n * @param {string} url\n */\nfunction createIframe(parent, url) {\n var nEl = document.createElement('iframe');\n nEl.src = url || 'about:blank';\n nEl.width = '100%';\n nEl.height = '100%';\n nEl.style.position = 'absolute';\n nEl.style.left = '0';\n nEl.style.top = '0';\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n}\n\n/**\n * simpleTemplate\n *\n * @param {string} template\n * @param {object} data\n */\nfunction simpleTemplate(template, data) {\n Object.keys(data).forEach(function (key) {\n var value = (typeof value === 'object') ? JSON.stringify(data[key]) : data[key];\n template = template.replace(new RegExp('{{' + key + '}}', 'g'), value);\n });\n return template;\n}\n\n/**\n * setIframeContent\n *\n * @param {HTMLIframeElement} iframeEl\n * @param content\n */\nfunction setIframeContent(iframeEl, content) {\n var iframeDoc = iframeEl.contentWindow && iframeEl.contentWindow.document;\n if (!iframeDoc) return false;\n\n iframeDoc.write(content);\n\n return true;\n}\n\n\n/**\n * extend object with keys from another object\n *\n * @param {object} toExtend\n * @param {object} fromSource\n */\nfunction extend(toExtend, fromSource) {\n Object.keys(fromSource).forEach(function(key) {\n toExtend[key] = fromSource[key];\n });\n return toExtend;\n}\n\n\n/**\n * unique will create a unique string everytime is called, sequentially and prefixed\n *\n * @param {string} prefix\n */\nfunction unique(prefix) {\n var count = -1;\n return function () {\n return prefix + '_' + (++count);\n };\n}\n\nmodule.exports = {\n noop: noop,\n validate: validate,\n clearCallbackTimeout: clearCallbackTimeout,\n callbackTimeout: callbackTimeout,\n createElementInEl: createElementInEl,\n createIframeWithContent: createIframeWithContent,\n createIframe: createIframe,\n simpleTemplate: simpleTemplate,\n setIframeContent: setIframeContent,\n extend: extend,\n unique: unique\n};\n\n\n},{}]},{},[3])\n\n\n//# sourceMappingURL=VPAIDHTML5Client.js.map","//Small subset of async\nvar async = {};\n\nasync.setImmediate = function (fn) {\n setTimeout(fn, 0);\n};\n\nasync.iterator = function (tasks) {\n var makeCallback = function (index) {\n var fn = function () {\n if (tasks.length) {\n tasks[index].apply(null, arguments);\n }\n return fn.next();\n };\n fn.next = function () {\n return (index < tasks.length - 1) ? makeCallback(index + 1) : null;\n };\n return fn;\n };\n return makeCallback(0);\n};\n\n\nasync.waterfall = function (tasks, callback) {\n callback = callback || function () { };\n if (!isArray(tasks)) {\n var err = new Error('First argument to waterfall must be an array of functions');\n return callback(err);\n }\n if (!tasks.length) {\n return callback();\n }\n var wrapIterator = function (iterator) {\n return function (err) {\n if (err) {\n callback.apply(null, arguments);\n callback = function () {\n };\n }\n else {\n var args = Array.prototype.slice.call(arguments, 1);\n var next = iterator.next();\n if (next) {\n args.push(wrapIterator(next));\n }\n else {\n args.push(callback);\n }\n async.setImmediate(function () {\n iterator.apply(null, args);\n });\n }\n };\n };\n wrapIterator(async.iterator(tasks))();\n};\n\nasync.when = function (condition, callback) {\n if (!isFunction(callback)) {\n throw new Error(\"async.when error: missing callback argument\");\n }\n\n var isAllowed = isFunction(condition) ? condition : function () {\n return !!condition;\n };\n\n return function () {\n var args = arrayLikeObjToArray(arguments);\n var next = args.pop();\n\n if (isAllowed.apply(null, args)) {\n return callback.apply(this, arguments);\n }\n\n args.unshift(null);\n return next.apply(null, args);\n };\n};\n\n\n","\"use strict\";\n\nvar dom = {};\n\ndom.isVisible = function isVisible(el) {\n var style = window.getComputedStyle(el);\n return style.visibility !== 'hidden';\n};\n\ndom.isHidden = function isHidden(el) {\n var style = window.getComputedStyle(el);\n return style.display === 'none';\n};\n\ndom.isShown = function isShown(el) {\n return !dom.isHidden(el);\n};\n\ndom.hide = function hide(el) {\n el.__prev_style_display_ = el.style.display;\n el.style.display = 'none';\n};\n\ndom.show = function show(el) {\n if (dom.isHidden(el)) {\n el.style.display = el.__prev_style_display_;\n }\n el.__prev_style_display_ = undefined;\n};\n\ndom.hasClass = function hasClass(el, cssClass) {\n var classes, i, len;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.contains(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n cssClass = (cssClass || '');\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (classes[i] === cssClass) {\n return true;\n }\n }\n }\n return false;\n};\n\ndom.addClass = function (el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.add(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n classes.push(cssClass);\n el.setAttribute('class', classes.join(' '));\n }\n }\n};\n\ndom.removeClass = function (el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.remove(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n var newClasses = [];\n var i, len;\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (cssClass !== classes[i]) {\n newClasses.push(classes[i]);\n }\n }\n el.setAttribute('class', newClasses.join(' '));\n }\n }\n};\n\ndom.addEventListener = function addEventListener(el, type, handler) {\n if(isArray(el)){\n forEach(el, function(e) {\n dom.addEventListener(e, type, handler);\n });\n return;\n }\n\n if(isArray(type)){\n forEach(type, function(t) {\n dom.addEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.addEventListener) {\n el.addEventListener(type, handler, false);\n } else if (el.attachEvent) {\n // WARNING!!! this is a very naive implementation !\n // the event object that should be passed to the handler\n // would not be there for IE8\n // we should use \"window.event\" and then \"event.srcElement\"\n // instead of \"event.target\"\n el.attachEvent(\"on\" + type, handler);\n }\n};\n\ndom.removeEventListener = function removeEventListener(el, type, handler) {\n if(isArray(el)){\n forEach(el, function(e) {\n dom.removeEventListener(e, type, handler);\n });\n return;\n }\n\n if(isArray(type)){\n forEach(type, function(t) {\n dom.removeEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.removeEventListener) {\n el.removeEventListener(type, handler, false);\n } else if (el.detachEvent) {\n el.detachEvent(\"on\" + type, handler);\n } else {\n el[\"on\" + type] = null;\n }\n};\n\ndom.dispatchEvent = function dispatchEvent(el, event) {\n if (el.dispatchEvent) {\n el.dispatchEvent(event);\n } else {\n el.fireEvent(\"on\" + event.eventType, event);\n }\n};\n\ndom.isDescendant = function isDescendant(parent, child) {\n var node = child.parentNode;\n while (node !== null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n};\n\ndom.getTextContent = function getTextContent(el){\n return el.textContent || el.text;\n};\n\ndom.prependChild = function prependChild(parent, child) {\n if(child.parentNode){\n child.parentNode.removeChild(child);\n }\n return parent.insertBefore(child, parent.firstChild);\n};\n\ndom.remove = function removeNode(node){\n if(node && node.parentNode){\n node.parentNode.removeChild(node);\n }\n};\n\ndom.isDomElement = function isDomElement(o) {\n return o instanceof Element;\n};\n\ndom.click = function(el, handler) {\n dom.addEventListener(el, 'click', handler);\n};\n\ndom.once = function(el, type, handler) {\n function handlerWrap() {\n handler.apply(null, arguments);\n dom.removeEventListener(el, type, handlerWrap);\n }\n\n dom.addEventListener(el, type, handlerWrap);\n};\n\n//Note: there is no getBoundingClientRect on iPad so we need a fallback\ndom.getDimension = function getDimension(element) {\n var rect;\n\n //On IE9 and below getBoundingClientRect does not work consistently\n if(!isOldIE() && element.getBoundingClientRect) {\n rect = element.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height\n };\n }\n\n return {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n};\n","var playerUtils = {};\n\n/**\n * Returns an object that captures the portions of player state relevant to\n * video playback. The result of this function can be passed to\n * restorePlayerSnapshot with a player to return the player to the state it\n * was in when this function was invoked.\n * @param {object} player The videojs player object\n */\nplayerUtils.getPlayerSnapshot = function getPlayerSnapshot(player) {\n var tech = player.el().querySelector('.vjs-tech');\n var snapshot = {\n ended: player.ended(),\n src: player.currentSrc(),\n currentTime: player.currentTime(),\n type: player.currentType(),\n playing: !player.paused(),\n suppressedTracks: getSuppressedTracks(player)\n };\n\n if (tech) {\n snapshot.nativePoster = tech.poster;\n snapshot.style = tech.getAttribute('style');\n }\n\n return snapshot;\n\n /**** Local Functions ****/\n function getSuppressedTracks(player) {\n var tracks = player.remoteTextTracks ? player.remoteTextTracks() : [];\n\n if (tracks && isArray(tracks.tracks_)) {\n tracks = tracks.tracks_;\n }\n\n if (!isArray(tracks)) {\n tracks = [];\n }\n\n var suppressedTracks = [];\n tracks.forEach(function (track) {\n suppressedTracks.push({\n track: track,\n mode: track.mode\n });\n track.mode = 'disabled';\n });\n\n return suppressedTracks;\n }\n};\n\n/**\n * Attempts to modify the specified player so that its state is equivalent to\n * the state of the snapshot.\n * @param {object} snapshot - the player state to apply\n */\nplayerUtils.restorePlayerSnapshot = function restorePlayerSnapshot(player, snapshot) {\n var tech = player.el().querySelector('.vjs-tech');\n var attempts = 20; // the number of remaining attempts to restore the snapshot\n\n if (snapshot.nativePoster) {\n tech.poster = snapshot.nativePoster;\n }\n\n if ('style' in snapshot) {\n // overwrite all css style properties to restore state precisely\n tech.setAttribute('style', snapshot.style || '');\n }\n\n if (hasSrcChanged(player, snapshot)) {\n // on ios7, fiddling with textTracks too early will cause safari to crash\n player.one('contentloadedmetadata', restoreTracks);\n\n player.one('canplay', tryToResume);\n ensureCanplayEvtGetsFired();\n\n // if the src changed for ad playback, reset it\n player.src({src: snapshot.src, type: snapshot.type});\n\n // safari requires a call to `load` to pick up a changed source\n player.load();\n\n } else {\n restoreTracks();\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n /*** Local Functions ***/\n\n /**\n * Sometimes firefox does not trigger the 'canplay' evt.\n * This code ensure that it always gets triggered triggered.\n */\n function ensureCanplayEvtGetsFired() {\n var timeoutId = setTimeout(function() {\n player.trigger('canplay');\n }, 1000);\n\n player.one('canplay', function(){\n clearTimeout(timeoutId);\n });\n }\n\n /**\n * Determine whether the player needs to be restored to its state\n * before ad playback began. With a custom ad display or burned-in\n * ads, the content player state hasn't been modified and so no\n * restoration is required\n */\n function hasSrcChanged(player, snapshot) {\n if (player.src()) {\n return player.src() !== snapshot.src;\n }\n // the player was configured through source element children\n return player.currentSrc() !== snapshot.src;\n }\n\n function restoreTracks() {\n var suppressedTracks = snapshot.suppressedTracks;\n suppressedTracks.forEach(function (trackSnapshot) {\n trackSnapshot.track.mode = trackSnapshot.mode;\n });\n }\n\n /**\n * Determine if the video element has loaded enough of the snapshot source\n * to be ready to apply the rest of the state\n */\n function tryToResume() {\n if (playerUtils.isReadyToResume(tech)) {\n // if some period of the video is seekable, resume playback\n return resume();\n }\n\n // delay a bit and then check again unless we're out of attempts\n if (attempts--) {\n setTimeout(tryToResume, 50);\n } else {\n (function () {\n try {\n resume();\n } catch (e) {\n videojs.log.warn('Failed to resume the content after an advertisement', e);\n }\n })();\n }\n\n\n /*** Local functions ***/\n function resume() {\n player.currentTime(snapshot.currentTime);\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n }\n};\n\nplayerUtils.isReadyToResume = function (tech) {\n if (tech.readyState > 1) {\n // some browsers and media aren't \"seekable\".\n // readyState greater than 1 allows for seeking without exceptions\n return true;\n }\n\n if (tech.seekable === undefined) {\n // if the tech doesn't expose the seekable time ranges, try to\n // resume playback immediately\n return true;\n }\n\n if (tech.seekable.length > 0) {\n // if some period of the video is seekable, resume playback\n return true;\n }\n\n return false;\n};\n\n/**\n * This function prepares the player to display ads.\n * Adding convenience events like the 'vast.firsPlay' that gets fired when the video is first played\n * and ads the blackPoster to the player to prevent content from being displayed before the preroll ad.\n *\n * @param player\n */\nplayerUtils.prepareForAds = function (player) {\n var blackPoster = player.addChild('blackPoster');\n var _firstPlay = true;\n var volumeSnapshot;\n\n\n monkeyPatchPlayerApi();\n\n player.on('play', tryToTriggerFirstPlay);\n player.on('vast.reset', resetFirstPlay);//Every time we change the sources we reset the first play.\n player.on('vast.firstPlay', restoreContentVolume);\n player.on('error', hideBlackPoster);//If there is an error in the player we remove the blackposter to show the err msg\n player.on('vast.adStart', hideBlackPoster);\n player.on('vast.adsCancel', hideBlackPoster);\n player.on('vast.adError', hideBlackPoster);\n player.on('vast.adStart', addStyles);\n player.on('vast.adEnd', removeStyles);\n player.on('vast.adsCancel', removeStyles);\n\n /*** Local Functions ***/\n\n /**\n What this function does is ugly and horrible and I should think twice before calling myself a good developer. With that said,\n it is the best solution I could find to mute the video until the 'play' event happens (on mobile devices) and the plugin can decide whether\n to play the ad or not.\n\n We also need this monkeypatch to be able to pause and resume an ad using the player's API\n\n If you have a better solution please do tell me.\n */\n function monkeyPatchPlayerApi() {\n\n /**\n * Monkey patch needed to handle firstPlay and resume of playing ad.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are restoring a VAST ad.\n * @returns {player}\n */\n var origPlay = player.play;\n player.play = function (callOrigPlay) {\n if (isFirstPlay()) {\n firstPlay.call(this);\n } else {\n resume.call(this, callOrigPlay);\n }\n\n return this;\n\n /*** local functions ***/\n function firstPlay() {\n if (!isIPhone()) {\n volumeSnapshot = saveVolumeSnapshot();\n player.muted(true);\n }\n\n origPlay.apply(this, arguments);\n }\n\n function resume(callOrigPlay) {\n if (isAdPlaying() && !callOrigPlay) {\n player.vast.adUnit.resumeAd();\n } else {\n origPlay.apply(this, arguments);\n }\n }\n };\n\n\n /**\n * Needed monkey patch to handle pause of playing ad.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPause = player.pause;\n player.pause = function (callOrigPause) {\n if (isAdPlaying() && !callOrigPause) {\n player.vast.adUnit.pauseAd();\n } else {\n origPause.apply(this, arguments);\n }\n return this;\n };\n\n\n /**\n * Needed monkey patch to handle paused state of the player when ads are playing.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPaused = player.paused;\n player.paused = function (callOrigPaused) {\n if (isAdPlaying() && !callOrigPaused) {\n return player.vast.adUnit.isPaused();\n }\n return origPaused.apply(this, arguments);\n };\n }\n\n function isAdPlaying() {\n return player.vast && player.vast.adUnit;\n }\n\n function tryToTriggerFirstPlay() {\n if (isFirstPlay()) {\n _firstPlay = false;\n player.trigger('vast.firstPlay');\n }\n }\n\n function resetFirstPlay() {\n _firstPlay = true;\n blackPoster.show();\n restoreContentVolume();\n }\n\n function isFirstPlay() {\n return _firstPlay;\n }\n\n function saveVolumeSnapshot() {\n return {\n muted: player.muted(),\n volume: player.volume()\n };\n }\n\n function restoreContentVolume() {\n if (volumeSnapshot) {\n player.currentTime(0);\n restoreVolumeSnapshot(volumeSnapshot);\n volumeSnapshot = null;\n }\n }\n\n function restoreVolumeSnapshot(snapshot) {\n if (isObject(snapshot)) {\n player.volume(snapshot.volume);\n player.muted(snapshot.muted);\n }\n }\n\n function hideBlackPoster() {\n if (!dom.hasClass(blackPoster.el(), 'vjs-hidden')) {\n blackPoster.hide();\n }\n }\n\n function addStyles() {\n dom.addClass(player.el(), 'vjs-ad-playing');\n }\n\n function removeStyles() {\n dom.removeClass(player.el(), 'vjs-ad-playing');\n }\n};\n\n/**\n * Remove the poster attribute from the video element tech, if present. When\n * reusing a video element for multiple videos, the poster image will briefly\n * reappear while the new source loads. Removing the attribute ahead of time\n * prevents the poster from showing up between videos.\n * @param {object} player The videojs player object\n */\nplayerUtils.removeNativePoster = function (player) {\n var tech = player.el().querySelector('.vjs-tech');\n if (tech) {\n tech.removeAttribute('poster');\n }\n};\n\n/**\n * Helper function to listen to many events until one of them gets fired, then we\n * execute the handler and unsubscribe all the event listeners;\n *\n * @param player specific player from where to listen for the events\n * @param events array of events\n * @param handler function to execute once one of the events fires\n */\nplayerUtils.once = function once(player, events, handler) {\n function listener() {\n handler.apply(null, arguments);\n\n events.forEach(function (event) {\n player.off(event, listener);\n });\n }\n\n events.forEach(function (event) {\n player.on(event, listener);\n });\n};\n","var xml = {};\n\nxml.strToXMLDoc = function strToXMLDoc(stringContainingXMLSource){\n //IE 8\n if(typeof window.DOMParser === 'undefined'){\n var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');\n xmlDocument.async = false;\n xmlDocument.loadXML(stringContainingXMLSource);\n return xmlDocument;\n }\n\n return parseString(stringContainingXMLSource);\n\n function parseString(stringContainingXMLSource){\n var parser = new DOMParser();\n var parsedDocument;\n\n //Note: This try catch is to deal with the fact that on IE parser.parseFromString does throw an error but the rest of the browsers don't.\n try {\n parsedDocument = parser.parseFromString(stringContainingXMLSource, \"application/xml\");\n\n if(isParseError(parsedDocument) || isEmptyString(stringContainingXMLSource)){\n throw new Error();\n }\n }catch(e){\n throw new Error(\"xml.strToXMLDOC: Error parsing the string: '\" + stringContainingXMLSource + \"'\");\n }\n\n return parsedDocument;\n }\n\n function isParseError(parsedDocument) {\n try { // parser and parsererrorNS could be cached on startup for efficiency\n var parser = new DOMParser(),\n errorneousParse = parser.parseFromString('INVALID', 'text/xml'),\n parsererrorNS = errorneousParse.getElementsByTagName(\"parsererror\")[0].namespaceURI;\n\n if (parsererrorNS === 'http://www.w3.org/1999/xhtml') {\n // In PhantomJS the parseerror element doesn't seem to have a special namespace, so we are just guessing here :(\n return parsedDocument.getElementsByTagName(\"parsererror\").length > 0;\n }\n\n return parsedDocument.getElementsByTagNameNS(parsererrorNS, 'parsererror').length > 0;\n } catch (e) {\n //Note on IE parseString throws an error by itself and it will never reach this code. Because it will have failed before\n }\n }\n};\n\nxml.parseText = function parseText (sValue) {\n if (/^\\s*$/.test(sValue)) { return null; }\n if (/^(?:true|false)$/i.test(sValue)) { return sValue.toLowerCase() === \"true\"; }\n if (isFinite(sValue)) { return parseFloat(sValue); }\n if (isISO8601(sValue)) { return new Date(sValue); }\n return sValue.trim();\n};\n\nxml.JXONTree = function JXONTree (oXMLParent) {\n var parseText = xml.parseText;\n\n //The document object is an especial object that it may miss some functions or attrs depending on the browser.\n //To prevent this problem with create the JXONTree using the root childNode which is a fully fleshed node on all supported\n //browsers.\n if(oXMLParent.documentElement){\n return new xml.JXONTree(oXMLParent.documentElement);\n }\n\n if (oXMLParent.hasChildNodes()) {\n var sCollectedTxt = \"\";\n for (var oNode, sProp, vContent, nItem = 0; nItem < oXMLParent.childNodes.length; nItem++) {\n oNode = oXMLParent.childNodes.item(nItem);\n /*jshint bitwise: false*/\n if ((oNode.nodeType - 1 | 1) === 3) { sCollectedTxt += oNode.nodeType === 3 ? oNode.nodeValue.trim() : oNode.nodeValue; }\n else if (oNode.nodeType === 1 && !oNode.prefix) {\n sProp = decapitalize(oNode.nodeName);\n vContent = new xml.JXONTree(oNode);\n if (this.hasOwnProperty(sProp)) {\n if (this[sProp].constructor !== Array) { this[sProp] = [this[sProp]]; }\n this[sProp].push(vContent);\n } else { this[sProp] = vContent; }\n }\n }\n if (sCollectedTxt) { this.keyValue = parseText(sCollectedTxt); }\n }\n\n //IE8 Stupid fix\n var hasAttr = typeof oXMLParent.hasAttributes === 'undefined'? oXMLParent.attributes.length > 0: oXMLParent.hasAttributes();\n if (hasAttr) {\n var oAttrib;\n for (var nAttrib = 0; nAttrib < oXMLParent.attributes.length; nAttrib++) {\n oAttrib = oXMLParent.attributes.item(nAttrib);\n this[\"@\" + decapitalize(oAttrib.name)] = parseText(oAttrib.value.trim());\n }\n }\n};\n\nxml.JXONTree.prototype.attr = function(attr) {\n return this['@' + decapitalize(attr)];\n};\n\nxml.toJXONTree = function toJXONTree(xmlString){\n var xmlDoc = xml.strToXMLDoc(xmlString);\n return new xml.JXONTree(xmlDoc);\n};\n\n/**\n * Helper function to extract the keyvalue of a JXONTree obj\n *\n * @param xmlObj {JXONTree}\n * return the key value or undefined;\n */\nxml.keyValue = function getKeyValue(xmlObj) {\n if(xmlObj){\n return xmlObj.keyValue;\n }\n return undefined;\n};\n\nxml.attr = function getAttrValue(xmlObj, attr) {\n if(xmlObj) {\n return xmlObj['@' + decapitalize(attr)];\n }\n return undefined;\n};\n\nxml.encode = function encodeXML(str) {\n return str.replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n};\n\nxml.decode = function decodeXML(str) {\n return str.replace(/'/g, \"'\")\n .replace(/"/g, '\"')\n .replace(/>/g, '>')\n .replace(/</g, '<')\n .replace(/&/g, '&');\n};","vjs.plugin('vastClient', function VASTPlugin(options) {\n var snapshot;\n var player = this;\n var vast = new VASTClient();\n var adsCanceled = false;\n var defaultOpts = {\n // maximum amount of time in ms to wait to receive `adsready` from the ad\n // implementation after play has been requested. Ad implementations are\n // expected to load any dynamic libraries and make any requests to determine\n // ad policies for a video during this time.\n timeout: 500,\n\n //TODO:finish this IOS FIX\n //Whenever you play an add on IOS, the native player kicks in and we loose control of it. On very heavy pages the 'play' event\n // May occur after the video content has already started. This is wrong if you want to play a preroll ad that needs to happen before the user\n // starts watching the content. To prevent this usec\n iosPrerollCancelTimeout: 2000,\n\n // maximun amount of time for the ad to actually start playing. If this timeout gets\n // triggered the ads will be cancelled\n adCancelTimeout: 3000,\n\n // Boolean flag that configures the player to play a new ad before the user sees the video again\n // the current video\n playAdAlways: false,\n\n // Flag to enable or disable the ads by default.\n adsEnabled: true,\n\n // Boolean flag to enable or disable the resize with window.resize or orientationchange\n autoResize: true,\n\n // Path to the VPAID flash ad's loader\n vpaidFlashLoaderPath: '/VPAIDFlash.swf'\n };\n\n var settings = extend({}, defaultOpts, options || {});\n\n if(isUndefined(settings.adTagUrl) && isDefined(settings.url)){\n settings.adTagUrl = settings.url;\n }\n\n if (isString(settings.adTagUrl)) {\n settings.adTagUrl = echoFn(settings.adTagUrl);\n }\n\n if (isDefined(settings.adTagXML) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, the passed adTagXML option does not contain a function'));\n }\n\n if (!isDefined(settings.adTagUrl) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, missing adTagUrl on options object'));\n }\n\n playerUtils.prepareForAds(player);\n\n if (settings.playAdAlways) {\n // No matter what happens we play a new ad before the user sees the video again.\n player.on('vast.contentEnd', function () {\n setTimeout(function () {\n player.trigger('vast.reset');\n }, 0);\n });\n }\n\n player.on('vast.firstPlay', tryToPlayPrerollAd);\n\n player.on('vast.reset', function () {\n //If we are reseting the plugin, we don't want to restore the content\n snapshot = null;\n cancelAds();\n });\n\n player.vast = {\n isEnabled: function () {\n return settings.adsEnabled;\n },\n\n enable: function () {\n settings.adsEnabled = true;\n },\n\n disable: function () {\n settings.adsEnabled = false;\n }\n };\n\n return player.vast;\n\n /**** Local functions ****/\n function tryToPlayPrerollAd() {\n //We remove the poster to prevent flickering whenever the content starts playing\n playerUtils.removeNativePoster(player);\n\n playerUtils.once(player, ['vast.adsCancel', 'vast.adEnd'], function () {\n removeAdUnit();\n restoreVideoContent();\n });\n\n async.waterfall([\n checkAdsEnabled,\n preparePlayerForAd,\n playPrerollAd\n ], function (error, response) {\n if (error) {\n trackAdError(error, response);\n } else {\n player.trigger('vast.adEnd');\n }\n });\n\n /*** Local functions ***/\n\n function removeAdUnit() {\n if (player.vast && player.vast.adUnit) {\n player.vast.adUnit = null; //We remove the adUnit\n }\n }\n\n function restoreVideoContent() {\n setupContentEvents();\n if (snapshot) {\n playerUtils.restorePlayerSnapshot(player, snapshot);\n snapshot = null;\n }\n }\n\n function setupContentEvents() {\n playerUtils.once(player, ['playing', 'vast.reset', 'vast.firstPlay'], function (evt) {\n if (evt.type !== 'playing') {\n return;\n }\n\n player.trigger('vast.contentStart');\n\n playerUtils.once(player, ['ended', 'vast.reset', 'vast.firstPlay'], function (evt) {\n if (evt.type === 'ended') {\n player.trigger('vast.contentEnd');\n }\n });\n });\n }\n\n function checkAdsEnabled(next) {\n if (settings.adsEnabled) {\n return next(null);\n }\n next(new VASTError('Ads are not enabled'));\n }\n\n function preparePlayerForAd(next) {\n if (canPlayPrerollAd()) {\n snapshot = playerUtils.getPlayerSnapshot(player);\n player.pause();\n addSpinnerIcon();\n startAdCancelTimeout();\n next(null);\n } else {\n next(new VASTError('video content has been playing before preroll ad'));\n }\n }\n\n function canPlayPrerollAd() {\n return !isIPhone() || player.currentTime() <= settings.iosPrerollCancelTimeout;\n }\n\n function startAdCancelTimeout() {\n var adCancelTimeoutId;\n adsCanceled = false;\n\n adCancelTimeoutId = setTimeout(function () {\n trackAdError(new VASTError('timeout while waiting for the video to start playing', 402));\n }, settings.adCancelTimeout);\n\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], clearAdCancelTimeout);\n\n /*** local functions ***/\n function clearAdCancelTimeout() {\n if (adCancelTimeoutId) {\n clearTimeout(adCancelTimeoutId);\n adCancelTimeoutId = null;\n }\n }\n }\n\n function addSpinnerIcon() {\n dom.addClass(player.el(), 'vjs-vast-ad-loading');\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], removeSpinnerIcon);\n }\n\n function removeSpinnerIcon() {\n //IMPORTANT NOTE: We remove the spinnerIcon asynchronously to give time to the browser to start the video.\n // If we remove it synchronously we see a flash of the content video before the ad starts playing.\n setTimeout(function () {\n dom.removeClass(player.el(), 'vjs-vast-ad-loading');\n }, 100);\n }\n\n }\n\n function cancelAds() {\n player.trigger('vast.adsCancel');\n adsCanceled = true;\n }\n\n function playPrerollAd(callback) {\n async.waterfall([\n getVastResponse,\n playAd\n ], callback);\n }\n\n function getVastResponse(callback) {\n vast.getVASTResponse(settings.adTagUrl ? settings.adTagUrl() : settings.adTagXML, callback);\n }\n\n function playAd(vastResponse, callback) {\n //TODO: Find a better way to stop the play. The 'playPrerollWaterfall' ends in an inconsistent situation\n //If the state is not 'preroll?' it means the ads were canceled therefore, we break the waterfall\n if (adsCanceled) {\n return;\n }\n\n var adIntegrator = isVPAID(vastResponse) ? new VPAIDIntegrator(player, settings) : new VASTIntegrator(player);\n var adFinished = false;\n\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], function (evt) {\n if (evt.type === 'vast.adStart') {\n addAdsLabel();\n }\n });\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeAdsLabel);\n\n if (isIDevice()) {\n preventManualProgress();\n }\n\n player.vast.adUnit = adIntegrator.playAd(vastResponse, callback);\n\n /*** Local functions ****/\n function addAdsLabel() {\n if (adFinished || player.controlBar.getChild('AdsLabel')) {\n return;\n }\n player.controlBar.addChild('AdsLabel');\n }\n\n function removeAdsLabel() {\n player.controlBar.removeChild('AdsLabel');\n adFinished = true;\n }\n\n function preventManualProgress() {\n //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that the user forwarded/rewound the ad\n var PROGRESS_THRESHOLD = 3;\n var previousTime = 0;\n var tech = player.el().querySelector('.vjs-tech');\n var skipad_attempts = 0;\n\n player.on('timeupdate', adTimeupdateHandler);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adError'], stopPreventManualProgress);\n\n /*** Local functions ***/\n function adTimeupdateHandler() {\n var currentTime = player.currentTime();\n var progressDelta = Math.abs(currentTime - previousTime);\n\n if (progressDelta > PROGRESS_THRESHOLD) {\n skipad_attempts += 1;\n if (skipad_attempts >= 2) {\n player.pause();\n }\n player.currentTime(previousTime);\n } else {\n previousTime = currentTime;\n }\n }\n\n function stopPreventManualProgress() {\n player.off('timeupdate', adTimeupdateHandler);\n }\n }\n }\n\n function trackAdError(error, vastResponse) {\n player.trigger({type: 'vast.adError', error: error});\n cancelAds();\n if (console && console.log) {\n console.log('AD ERROR:', error.message, error, vastResponse);\n }\n }\n\n function isVPAID(vastResponse) {\n var i, len;\n var mediaFiles = vastResponse.mediaFiles;\n for (i = 0, len = mediaFiles.length; i < len; i++) {\n if (vastUtil.isVPAID(mediaFiles[i])) {\n return true;\n }\n }\n return false;\n }\n});\n","vjs.AdsLabel = vjs.Component.extend({\n /** @constructor */\n init: function (player, options) {\n vjs.Component.call(this, player, options);\n\n var that = this;\n\n // We asynchronously reposition the ads label element\n setTimeout(function () {\n var currentTimeComp = player.controlBar &&( player.controlBar.getChild(\"timerControls\") || player.controlBar.getChild(\"currentTimeDisplay\") );\n if(currentTimeComp) {\n player.controlBar.el().insertBefore(that.el(), currentTimeComp.el());\n }\n dom.removeClass(that.el(), 'vjs-label-hidden');\n }, 0);\n }\n});\n\nvjs.AdsLabel.prototype.createEl = function(){\n return vjs.Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-ads-label vjs-control vjs-label-hidden',\n innerHTML: 'Advertisement'\n });\n};","/**\n * The component that shows a black screen until the ads plugin has decided if it can or it can not play the ad.\n *\n * Note: In case you wonder why instead of this black poster we don't just show the spinner loader.\n * IOS devices do not work well with animations and the browser chrashes from time to time That is why we chose to\n * have a secondary black poster.\n *\n * It also makes it much more easier for the users of the plugin since it does not change the default behaviour of the\n * spinner and the player works the same way with and without the plugin.\n *\n * @param {vjs.Player|Object} player\n * @param {Object=} options\n * @constructor\n */\nvjs.BlackPoster = vjs.Component.extend({\n /** @constructor */\n init: function(player, options){\n vjs.Component.call(this, player, options);\n\n var posterImg = player.getChild('posterImage');\n\n //We need to do it asynchronously to be sure that the black poster el is on the dom.\n setTimeout(function() {\n if(posterImg) {\n player.el().insertBefore(this.el(), posterImg.el());\n }\n }.bind(this), 0);\n }\n});\n\n/**\n * Create the black poster div element\n * @return {Element}\n */\nvjs.BlackPoster.prototype.createEl = function(){\n return vjs.createEl('div', {\n className: 'vjs-black-poster'\n });\n};","(function (window) {\n \"use strict\";\n\n\n function VASTResponse() {\n if (!(this instanceof VASTResponse)) {\n return new VASTResponse();\n }\n\n this._linearAdded = false;\n this.ads = [];\n this.errorURLMacros = [];\n this.impressions = [];\n this.clickTrackings = [];\n this.customClicks = [];\n this.trackingEvents = {};\n this.mediaFiles = [];\n this.clickThrough = undefined;\n this.adTitle = '';\n this.duration = undefined;\n this.skipoffset = undefined;\n }\n\n VASTResponse.prototype.addAd = function (ad) {\n var inLine, wrapper;\n\n if (ad instanceof Ad) {\n inLine = ad.inLine;\n wrapper = ad.wrapper;\n\n this.ads.push(ad);\n\n if (inLine) {\n this._addInLine(inLine);\n }\n\n if (wrapper) {\n this._addWrapper(wrapper);\n }\n }\n };\n\n VASTResponse.prototype._addErrorTrackUrl = function (error) {\n var errorURL = error instanceof xml.JXONTree ? xml.keyValue(error) : error;\n if (errorURL) {\n this.errorURLMacros.push(errorURL);\n }\n };\n\n VASTResponse.prototype._addImpressions = function (impressions) {\n isArray(impressions) && appendToArray(this.impressions, impressions);\n };\n\n VASTResponse.prototype._addClickThrough = function (clickThrough) {\n if (isNotEmptyString(clickThrough)) {\n this.clickThrough = clickThrough;\n }\n };\n\n VASTResponse.prototype._addClickTrackings = function (clickTrackings) {\n isArray(clickTrackings) && appendToArray(this.clickTrackings, clickTrackings);\n };\n\n VASTResponse.prototype._addCustomClicks = function (customClicks) {\n isArray(customClicks) && appendToArray(this.customClicks, customClicks);\n };\n\n VASTResponse.prototype._addTrackingEvents = function (trackingEvents) {\n var eventsMap = this.trackingEvents;\n\n if (trackingEvents) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function (trackingEvent) {\n if (!eventsMap[trackingEvent.name]) {\n eventsMap[trackingEvent.name] = [];\n }\n eventsMap[trackingEvent.name].push(trackingEvent);\n });\n }\n };\n\n VASTResponse.prototype._addTitle = function (title) {\n if (isNotEmptyString(title)) {\n this.adTitle = title;\n }\n };\n\n VASTResponse.prototype._addDuration = function (duration) {\n if (isNumber(duration)) {\n this.duration = duration;\n }\n };\n\n VASTResponse.prototype._addVideoClicks = function (videoClicks) {\n if (videoClicks instanceof VideoClicks) {\n this._addClickThrough(videoClicks.clickThrough);\n this._addClickTrackings(videoClicks.clickTrackings);\n this._addCustomClicks(videoClicks.customClicks);\n }\n };\n\n VASTResponse.prototype._addMediaFiles = function (mediaFiles) {\n isArray(mediaFiles) && appendToArray(this.mediaFiles, mediaFiles);\n };\n\n VASTResponse.prototype._addSkipoffset = function (offset) {\n if (offset) {\n this.skipoffset = offset;\n }\n };\n\n VASTResponse.prototype._addAdParameters = function (adParameters) {\n if (adParameters) {\n this.adParameters = adParameters;\n }\n };\n\n VASTResponse.prototype._addLinear = function (linear) {\n if (linear instanceof Linear) {\n this._addDuration(linear.duration);\n this._addTrackingEvents(linear.trackingEvents);\n this._addVideoClicks(linear.videoClicks);\n this._addMediaFiles(linear.mediaFiles);\n this._addSkipoffset(linear.skipoffset);\n this._addAdParameters(linear.adParameters);\n this._linearAdded = true;\n }\n };\n\n VASTResponse.prototype._addInLine = function (inLine) {\n var that = this;\n\n if (inLine instanceof InLine) {\n this._addTitle(inLine.adTitle);\n this._addErrorTrackUrl(inLine.error);\n this._addImpressions(inLine.impressions);\n\n inLine.creatives.forEach(function (creative) {\n if (creative.linear) {\n that._addLinear(creative.linear);\n }\n });\n }\n };\n\n VASTResponse.prototype._addWrapper = function (wrapper) {\n var that = this;\n\n if (wrapper instanceof Wrapper) {\n this._addErrorTrackUrl(wrapper.error);\n this._addImpressions(wrapper.impressions);\n\n wrapper.creatives.forEach(function (creative) {\n var linear = creative.linear;\n if (linear) {\n that._addVideoClicks(linear.videoClicks);\n that.clickThrough = undefined;//We ensure that no clickThrough has been added\n that._addTrackingEvents(linear.trackingEvents);\n }\n });\n }\n };\n\n VASTResponse.prototype.hasLinear = function(){\n return this._linearAdded;\n };\n\n function appendToArray(array, items) {\n items.forEach(function (item) {\n array.push(item);\n });\n }\n\n window.VASTResponse = VASTResponse;\n})(window);\n","\"use strict\";\n\nvar vastUtil = {\n\n track: function track(URLMacros, variables) {\n var sources = vastUtil.parseURLMacros(URLMacros, variables);\n var trackImgs = [];\n sources.forEach(function (src) {\n var img = new Image();\n img.src = src;\n trackImgs.push(img);\n });\n return trackImgs;\n },\n\n parseURLMacros: function parseMacros(URLMacros, variables) {\n var parsedURLs = [];\n\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n URLMacros.forEach(function (URLMacro) {\n parsedURLs.push(vastUtil._parseURLMacro(URLMacro, variables));\n });\n\n return parsedURLs;\n },\n\n parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n return vastUtil._parseURLMacro(URLMacro, variables);\n },\n\n _parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n forEach(variables, function (value, key) {\n URLMacro = URLMacro.replace(new RegExp(\"\\\\[\" + key + \"\\\\\\]\", 'gm'), value);\n });\n\n return URLMacro;\n },\n\n parseDuration: function parseDuration(durationStr) {\n var durationRegex = /(\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d\\d\\d))?/;\n var match, durationInMs;\n\n if (isString(durationStr)) {\n match = durationStr.match(durationRegex);\n if (match) {\n durationInMs = parseHoursToMs(match[1]) + parseMinToMs(match[2]) + parseSecToMs(match[3]) + parseInt(match[5] || 0);\n }\n }\n\n return isNaN(durationInMs) ? null : durationInMs;\n\n /*** local functions ***/\n function parseHoursToMs(hourStr) {\n return parseInt(hourStr, 10) * 60 * 60 * 1000;\n }\n\n function parseMinToMs(minStr) {\n return parseInt(minStr, 10) * 60 * 1000;\n }\n\n function parseSecToMs(secStr) {\n return parseInt(secStr, 10) * 1000;\n }\n },\n\n parseImpressions: function parseImpressions(impressions) {\n if (impressions) {\n impressions = isArray(impressions) ? impressions : [impressions];\n return transformArray(impressions, function (impression) {\n if (isNotEmptyString(impression.keyValue)) {\n return impression.keyValue;\n }\n return undefined;\n });\n }\n return [];\n },\n\n parseCreatives: function parseCreatives(creativesJTree) {\n var creatives = [];\n var creativesData;\n if (isDefined(creativesJTree) && isDefined(creativesJTree.creative)) {\n creativesData = isArray(creativesJTree.creative) ? creativesJTree.creative : [creativesJTree.creative];\n creativesData.forEach(function (creative) {\n creatives.push(new Creative(creative));\n });\n }\n return creatives;\n },\n\n //We assume that the progress is going to arrive in milliseconds\n formatProgress: function formatProgress(progress) {\n var hours, minutes, seconds, milliseconds;\n hours = progress / (60 * 60 * 1000);\n hours = Math.floor(hours);\n minutes = (progress / (60 * 1000)) % 60;\n minutes = Math.floor(minutes);\n seconds = (progress / 1000) % 60;\n seconds = Math.floor(seconds);\n milliseconds = progress % 1000;\n return toFixedDigits(hours, 2) + ':' + toFixedDigits(minutes, 2) + ':' + toFixedDigits(seconds, 2) + '.' + toFixedDigits(milliseconds, 3);\n },\n\n parseOffset: function parseOffset(offset, duration) {\n if(isPercentage(offset)){\n return calculatePercentage(offset, duration);\n }\n return vastUtil.parseDuration(offset);\n\n /*** Local function ***/\n function isPercentage(offset) {\n var percentageRegex = /^\\d+(\\.\\d+)?%$/g;\n return percentageRegex.test(offset);\n }\n\n function calculatePercentage(percentStr, duration) {\n if(duration) {\n return calcPercent(duration, parseFloat(percentStr.replace('%', '')));\n }\n return null;\n }\n\n function calcPercent(quantity, percent){\n return quantity * percent / 100;\n }\n },\n\n isVPAID: function isVPAIDMediaFile(mediaFile) {\n return !!mediaFile && mediaFile.apiFramework === 'VPAID';\n }\n};"],"sourceRoot":"/source/"}