From aac9afa6fc620ff8aaa276b91a6f1594dbb7de84 Mon Sep 17 00:00:00 2001 From: Olivier Audard Date: Fri, 11 Jul 2014 17:57:34 +0200 Subject: [PATCH] Version 1.2.2 - Update vast-client.js to the latest master - Bump version numbers to 1.2.2 --- bower.json | 2 +- package.json | 2 +- vast-client.js | 29 ++++++++++++++++++----------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/bower.json b/bower.json index 7ee99a15..99932e00 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "vast-client-js", "author": ["Olivier Poitrey "], - "version": "1.2.1", + "version": "1.2.2", "main": "vast-client.js", "licenses": [{"type": "MIT", "url": "https://github.com/rs/vast-client-js/raw/master/LICENSE"}], "ignore": [ diff --git a/package.json b/package.json index 8d664016..03eb79cc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vast-client-js", "author": "Olivier Poitrey ", - "version": "1.2.1", + "version": "1.2.2", "description": "Javascript VAST Client", "keywords": ["vast", "ad", "advertising", "iab", "in-stream", "video"], "repository": {"type": "git", "url": "https://github.com/rs/vast-client-js"}, diff --git a/vast-client.js b/vast-client.js index 2601523e..fbe17d57 100644 --- a/vast-client.js +++ b/vast-client.js @@ -146,10 +146,7 @@ EventEmitter.prototype.addListener = function(type, listener) { 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } + console.trace(); } } @@ -661,11 +658,13 @@ VASTParser = (function() { _ref4 = wrappedAd.creatives; for (_m = 0, _len4 = _ref4.length; _m < _len4; _m++) { creative = _ref4[_m]; - _ref5 = Object.keys(ad.trackingEvents); - for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) { - eventName = _ref5[_n]; - (_base = creative.trackingEvents)[eventName] || (_base[eventName] = []); - creative.trackingEvents[eventName] = creative.trackingEvents[eventName].concat(ad.trackingEvents[eventName]); + if (creative.type === 'linear') { + _ref5 = Object.keys(ad.trackingEvents); + for (_n = 0, _len5 = _ref5.length; _n < _len5; _n++) { + eventName = _ref5[_n]; + (_base = creative.trackingEvents)[eventName] || (_base[eventName] = []); + creative.trackingEvents[eventName] = creative.trackingEvents[eventName].concat(ad.trackingEvents[eventName]); + } } } } @@ -720,13 +719,21 @@ VASTParser = (function() { }; VASTParser.parseWrapperElement = function(wrapperElement) { - var ad, wrapperCreativeElement, wrapperURLElement; + var ad, creative, wrapperCreativeElement, wrapperURLElement, _i, _len, _ref; ad = this.parseInLineElement(wrapperElement); wrapperURLElement = this.childByName(wrapperElement, "VASTAdTagURI"); if (wrapperURLElement != null) { ad.nextWrapperURL = this.parseNodeText(wrapperURLElement); } - wrapperCreativeElement = ad.creatives[0]; + wrapperCreativeElement = null; + _ref = ad.creatives; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + creative = _ref[_i]; + if (creative.type === 'linear') { + wrapperCreativeElement = creative; + break; + } + } if ((wrapperCreativeElement != null) && (wrapperCreativeElement.trackingEvents != null)) { ad.trackingEvents = wrapperCreativeElement.trackingEvents; }