Skip to content

Commit

Permalink
0.1.5
Browse files Browse the repository at this point in the history
- properly handles touch event on skip button
  • Loading branch information
radiantmediaplayer committed May 2, 2017
1 parent dfb3b7f commit 123e6d2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 18 deletions.
13 changes: 6 additions & 7 deletions js/dist/rmp-vast.debug.js

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions js/dist/rmp-vast.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license Copyright (c) 2017 Radiant Media Player | https://www.radiantmediaplayer.com
* rmp-vast 0.1.4
* rmp-vast 0.1.5
* GitHub: https://github.com/radiantmediaplayer/rmp-vast
* MIT License: https://github.com/radiantmediaplayer/rmp-vast/blob/master/LICENSE
*/
Expand Down Expand Up @@ -1046,7 +1046,13 @@ var _onTimeupdateCheckSkip = function _onTimeupdateCheckSkip() {
}
};

var _onClickSkip = function _onClickSkip() {
var _onClickSkip = function _onClickSkip(event) {
if (event) {
event.stopPropagation();
if (event.type === 'touchend') {
event.preventDefault();
}
}
if (this.skippableAdCanBeSkipped) {
// create API event
_api.API.createEvent.call(this, 'adskipped');
Expand Down Expand Up @@ -1082,6 +1088,7 @@ SKIP.append = function () {

this.onClickSkip = _onClickSkip.bind(this);
this.skipButton.addEventListener('click', this.onClickSkip);
this.skipButton.addEventListener('touchend', this.onClickSkip);
this.skipButton.appendChild(this.skipWaiting);
this.skipButton.appendChild(this.skipMessage);
this.skipButton.appendChild(this.skipIcon);
Expand Down Expand Up @@ -2884,6 +2891,7 @@ RESET.unwireVastPlayerEvents = function () {
this.vastPlayer.removeEventListener('timeupdate', this.onTimeupdateCheckSkip);
if (this.skipButton) {
this.skipButton.removeEventListener('click', this.onClickSkip);
this.skipButton.removeEventListener('touchend', this.onClickSkip);
}
// click UI on mobile
if (this.clickUIOnMobile) {
Expand Down
14 changes: 8 additions & 6 deletions js/dist/rmp-vast.min.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion js/src/creatives/skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ var _onTimeupdateCheckSkip = function () {
}
};

var _onClickSkip = function () {
var _onClickSkip = function (event) {
if (event) {
event.stopPropagation();
if (event.type === 'touchend') {
event.preventDefault();
}
}
if (this.skippableAdCanBeSkipped) {
// create API event
API.createEvent.call(this, 'adskipped');
Expand Down Expand Up @@ -72,6 +78,7 @@ SKIP.append = function () {

this.onClickSkip = _onClickSkip.bind(this);
this.skipButton.addEventListener('click', this.onClickSkip);
this.skipButton.addEventListener('touchend', this.onClickSkip);
this.skipButton.appendChild(this.skipWaiting);
this.skipButton.appendChild(this.skipMessage);
this.skipButton.appendChild(this.skipIcon);
Expand Down
2 changes: 1 addition & 1 deletion js/src/rmp-vast-header.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license Copyright (c) 2017 Radiant Media Player | https://www.radiantmediaplayer.com
* rmp-vast 0.1.4
* rmp-vast 0.1.5
* GitHub: https://github.com/radiantmediaplayer/rmp-vast
* MIT License: https://github.com/radiantmediaplayer/rmp-vast/blob/master/LICENSE
*/
1 change: 1 addition & 0 deletions js/src/utils/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ RESET.unwireVastPlayerEvents = function () {
this.vastPlayer.removeEventListener('timeupdate', this.onTimeupdateCheckSkip);
if (this.skipButton) {
this.skipButton.removeEventListener('click', this.onClickSkip);
this.skipButton.removeEventListener('touchend', this.onClickSkip);
}
// click UI on mobile
if (this.clickUIOnMobile) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rmp-vast",
"version": "0.1.4",
"version": "0.1.5",
"author": "Radiant Media Player <[email protected]>",
"description": "A client-side JavaScript solution to load, parse and display VAST resources (advertising)",
"repository": {
Expand Down

0 comments on commit 123e6d2

Please sign in to comment.