Skip to content

Commit

Permalink
changed preroll example URI to adhese.demo account
Browse files Browse the repository at this point in the history
caught possible undefined for VAST templates without progress trackers
corrected typo
  • Loading branch information
tim committed Jan 21, 2015
1 parent d2ef077 commit edfcc38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 8 additions & 6 deletions vast/adhese-vast.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,14 @@ AdheseVastWrapper.prototype.getDurationInSeconds = function(adId) {
};

AdheseVastWrapper.prototype.track = function(uri) {
for (var x=0; x<uri.length; x++) {
// add uri to tracked, if already exists, do not track again
if (!this.trackedImpressions[uri[x]]) {
this.trackedImpressions[uri[x]] = 1;
var i = document.createElement("img");
i.src = uri[x] + ((uri[x].indexOf("?")==-1?"?adhche=":"&adhche=") + new Date().getTime());
if (uri) {
for (var x=0; x<uri.length; x++) {
// add uri to tracked, if already exists, do not track again
if (!this.trackedImpressions[uri[x]]) {
this.trackedImpressions[uri[x]] = 1;
var i = document.createElement("img");
i.src = uri[x] + ((uri[x].indexOf("?")==-1?"?adhche=":"&adhche=") + new Date().getTime());
}
}
}
};
Expand Down
3 changes: 1 addition & 2 deletions vast/example.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<html>
<head>
<script type="text/javascript" src="dist/adhese-vast.min.js"></script>
<!--<script type="text/javascript" src="dist/adhese-vast.js"></script>-->
</head>
<body>

Expand All @@ -21,7 +20,7 @@ <h1 id="info"></h1>
var a = new AdheseVastWrapper(true);
a.init();
a.addEventListener("ADS_LOADED", adsAreLoaded);
a.requestAds("http://ads.pebblemedia.adhese.com", "_pebblemedia_test-preroll_", ["preroll"]);
a.requestAds("http://ads.demo.adhese.com", "_sdk_example_", ["preroll"]);

function adsAreLoaded() {
console.log("adsAreLoaded")
Expand Down
2 changes: 1 addition & 1 deletion vast/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ It is however not a player on its own and it does not insert anything in the DOM
From then on you can access several properties of the wrapper object to get info on the ads.


For a full example, check the exmaple.html page.
For a full example, check the example.html page.

##API Documentation

Expand Down

0 comments on commit edfcc38

Please sign in to comment.