Skip to content

Commit

Permalink
version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
briganti committed Oct 22, 2014
1 parent 93c616f commit 3c6dbaa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 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.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": [
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.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"},
Expand Down
18 changes: 12 additions & 6 deletions vast-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ VASTMediaFile = (function() {
this.maxBitrate = 0;
this.width = 0;
this.height = 0;
this.apiFramework = null;
}

return VASTMediaFile;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3c6dbaa

Please sign in to comment.