From 3c6dbaac66f245a7bbbb64c13a44d661927c36db Mon Sep 17 00:00:00 2001 From: Michael Vial Date: Wed, 22 Oct 2014 11:24:30 +0200 Subject: [PATCH] version 1.3.0 --- bower.json | 2 +- package.json | 2 +- vast-client.js | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bower.json b/bower.json index b8ca9bf1..f2b58376 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "vast-client-js", "author": ["Olivier Poitrey "], - "version": "1.2.3", + "version": "1.3.0", "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 3cc391c0..06b02549 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vast-client-js", "author": "Olivier Poitrey ", - "version": "1.2.3", + "version": "1.3.0", "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 35c00b97..1eda934e 100644 --- a/vast-client.js +++ b/vast-client.js @@ -498,6 +498,7 @@ VASTMediaFile = (function() { this.maxBitrate = 0; this.width = 0; this.height = 0; + this.apiFramework = null; } return VASTMediaFile; @@ -854,6 +855,7 @@ VASTParser = (function() { mediaFile.deliveryType = mediaFileElement.getAttribute("delivery"); mediaFile.codec = mediaFileElement.getAttribute("codec"); mediaFile.mimeType = mediaFileElement.getAttribute("type"); + mediaFile.apiFramework = mediaFileElement.getAttribute("apiFramework"); mediaFile.bitrate = parseInt(mediaFileElement.getAttribute("bitrate") || 0); mediaFile.minBitrate = parseInt(mediaFileElement.getAttribute("minBitrate") || 0); mediaFile.maxBitrate = parseInt(mediaFileElement.getAttribute("maxBitrate") || 0); @@ -984,12 +986,7 @@ VASTTracker = (function(_super) { this.trackingEvents[eventName] = events.slice(0); } if (creative instanceof VASTCreativeLinear) { - this.assetDuration = creative.duration; - this.quartiles = { - 'firstQuartile': Math.round(25 * this.assetDuration) / 100, - 'midpoint': Math.round(50 * this.assetDuration) / 100, - 'thirdQuartile': Math.round(75 * this.assetDuration) / 100 - }; + this.setDuration(creative.duration); this.skipDelay = creative.skipDelay; this.linear = true; this.clickThroughURLTemplate = creative.videoClickThroughURLTemplate; @@ -1003,6 +1000,15 @@ VASTTracker = (function(_super) { }); } + VASTTracker.prototype.setDuration = function(duration) { + this.assetDuration = duration; + return this.quartiles = { + 'firstQuartile': Math.round(25 * this.assetDuration) / 100, + 'midpoint': Math.round(50 * this.assetDuration) / 100, + 'thirdQuartile': Math.round(75 * this.assetDuration) / 100 + }; + }; + VASTTracker.prototype.setProgress = function(progress) { var eventName, events, percent, quartile, skipDelay, time, _i, _len, _ref; skipDelay = this.skipDelay === null ? this.skipDelayDefault : this.skipDelay;