Skip to content

Commit

Permalink
Merge pull request #24 from dharFr/v1.1.1
Browse files Browse the repository at this point in the history
Version 1.1.1
  • Loading branch information
Olivier Poitrey committed Feb 28, 2014
2 parents b87cd66 + 85b6df9 commit 6d42215
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 45 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vast-client-js",
"author": ["Olivier Poitrey <[email protected]>"],
"version": "1.1.0",
"version": "1.1.1",
"main": "vast-client.js",
"licenses": [{"type": "MIT", "url": "https://github.com/rs/vast-client-js/raw/master/LICENSE"}],
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vast-client-js",
"author": "Olivier Poitrey <[email protected]>",
"version": "1.0.0",
"version": "1.1.1",
"description": "Javascript VAST Client",
"keywords": ["vast", "ad", "advertising", "iab", "in-stream", "video"],
"repository": {"type": "git", "url": "https://github.com/rs/vast-client-js"},
Expand Down
93 changes: 50 additions & 43 deletions vast-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ VASTTracker = (function(_super) {
}
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.skipDelay = creative.skipDelay;
this.linear = true;
this.clickThroughURLTemplate = creative.videoClickThroughURLTemplate;
Expand All @@ -455,7 +460,7 @@ VASTTracker = (function(_super) {
}

VASTTracker.prototype.setProgress = function(progress) {
var eventName, events, percent, skipDelay, _i, _len;
var eventName, events, percent, quartile, skipDelay, time, _i, _len, _ref;
skipDelay = this.skipDelay === null ? this.skipDelayDefault : this.skipDelay;
if (skipDelay !== -1 && !this.skipable) {
if (skipDelay > progress) {
Expand All @@ -471,9 +476,11 @@ VASTTracker = (function(_super) {
events.push("start");
percent = Math.round(progress / this.assetDuration * 100);
events.push("progress-" + percent + "%");
if (percent >= 25) events.push("firstQuartile");
if (percent >= 50) events.push("midpoint");
if (percent >= 75) events.push("thirdQuartile");
_ref = this.quartiles;
for (quartile in _ref) {
time = _ref[quartile];
if ((time <= progress && progress <= (time + 1))) events.push(quartile);
}
}
for (_i = 0, _len = events.length; _i < _len; _i++) {
eventName = events[_i];
Expand Down Expand Up @@ -977,38 +984,61 @@ module.exports = {
VASTCreativeCompanion: VASTCreativeCompanion
};

},{}],11:[function(require,module,exports){
var VASTAd;
},{}],10:[function(require,module,exports){
var VASTResponse;

VASTAd = (function() {
VASTResponse = (function() {

function VASTAd() {
function VASTResponse() {
this.ads = [];
this.errorURLTemplates = [];
this.impressionURLTemplates = [];
this.creatives = [];
}

return VASTAd;
return VASTResponse;

})();

module.exports = VASTAd;
module.exports = VASTResponse;

},{}],10:[function(require,module,exports){
var VASTResponse;
},{}],12:[function(require,module,exports){
var VASTMediaFile;

VASTResponse = (function() {
VASTMediaFile = (function() {

function VASTResponse() {
this.ads = [];
function VASTMediaFile() {
this.fileURL = null;
this.deliveryType = "progressive";
this.mimeType = null;
this.codec = null;
this.bitrate = 0;
this.minBitrate = 0;
this.maxBitrate = 0;
this.width = 0;
this.height = 0;
}

return VASTMediaFile;

})();

module.exports = VASTMediaFile;

},{}],11:[function(require,module,exports){
var VASTAd;

VASTAd = (function() {

function VASTAd() {
this.errorURLTemplates = [];
this.impressionURLTemplates = [];
this.creatives = [];
}

return VASTResponse;
return VASTAd;

})();

module.exports = VASTResponse;
module.exports = VASTAd;

},{}],9:[function(require,module,exports){
var URLHandler, flash, xhr;
Expand Down Expand Up @@ -1037,30 +1067,7 @@ URLHandler = (function() {

module.exports = URLHandler;

},{"./urlhandlers/xmlhttprequest.coffee":13,"./urlhandlers/flash.coffee":14}],12:[function(require,module,exports){
var VASTMediaFile;

VASTMediaFile = (function() {

function VASTMediaFile() {
this.fileURL = null;
this.deliveryType = "progressive";
this.mimeType = null;
this.codec = null;
this.bitrate = 0;
this.minBitrate = 0;
this.maxBitrate = 0;
this.width = 0;
this.height = 0;
}

return VASTMediaFile;

})();

module.exports = VASTMediaFile;

},{}],14:[function(require,module,exports){
},{"./urlhandlers/xmlhttprequest.coffee":13,"./urlhandlers/flash.coffee":14}],14:[function(require,module,exports){
var FlashURLHandler;

FlashURLHandler = (function() {
Expand Down

0 comments on commit 6d42215

Please sign in to comment.