Skip to content

Commit

Permalink
13.1.1
Browse files Browse the repository at this point in the history
- Removes xr-spatial-tracking from iframe attributes
- getDuration and getCurrentTime and other related methods now return values that are not rounded
  • Loading branch information
radiantmediaplayer committed Feb 9, 2024
1 parent 165c707 commit 2af926b
Show file tree
Hide file tree
Showing 13 changed files with 2,708 additions and 2,656 deletions.
3,299 changes: 1,643 additions & 1,656 deletions dist/rmp-vast.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rmp-vast.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rmp-vast.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rmp-vast.min.js.map

Large diffs are not rendered by default.

1,997 changes: 1,038 additions & 959 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rmp-vast",
"version": "13.1.0",
"version": "13.1.1",
"author": "Radiant Media Player <[email protected]>",
"description": "A client-side JavaScript solution to load, parse and display VAST resources (advertising)",
"repository": {
Expand All @@ -10,7 +10,6 @@
"main": "./dist/rmp-vast.js",
"types": "./types/js/index.d.ts",
"scripts": {
"updatedep": "ncu -u -x stylelint,stylelint-config-standard",
"test": "node ./test/run.js",
"testAndroid": "node ./test/run.js android",
"testSafari": "node ./test/run.js safari",
Expand Down Expand Up @@ -39,30 +38,30 @@
"@babel/preset-env": "^7.23.9",
"babel-loader": "^9.1.3",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.9.1",
"css-loader": "^6.10.0",
"eslint": "^8.56.0",
"eslint-webpack-plugin": "^4.0.1",
"handlebars": "^4.7.8",
"handlebars-loader": "^1.7.3",
"html-webpack-plugin": "^5.6.0",
"less": "^4.2.0",
"less-loader": "^12.1.0",
"less-loader": "^12.2.0",
"postcss-less": "^6.0.0",
"selenium-webdriver": "^4.17.0",
"style-loader": "^3.3.4",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-webpack-plugin": "^4.1.1",
"stylelint": "^16.2.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-webpack-plugin": "^5.0.0",
"terser": "^5.27.0",
"terser-webpack-plugin": "^5.3.10",
"typescript": "^5.3.3",
"webpack": "^5.90.0",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
"@babel/runtime-corejs3": "^7.23.9",
"@types/node": "^20.11.6",
"@types/node": "^20.11.17",
"core-js": "^3.35.1",
"regenerator-runtime": "^0.14.1",
"whatwg-fetch": "^3.6.20"
Expand Down
2 changes: 1 addition & 1 deletion src/js/creatives/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const _onPlayingAppendIcons = function () {
}
);
icon.setAttribute('scrolling', 'no');
icon.setAttribute('allow', 'autoplay; fullscreen; picture-in-picture; xr-spatial-tracking; encrypted-media');
icon.setAttribute('allow', 'autoplay; fullscreen; picture-in-picture; encrypted-media');
icon.setAttribute('sandbox', 'allow-scripts allow-presentation allow-same-origin');
}
icon.className = 'rmp-ad-container-icons';
Expand Down
2 changes: 1 addition & 1 deletion src/js/creatives/non-linear.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ NON_LINEAR.update = function () {
overflow: 'hidden'
}
);
this.nonLinearInnerElement.setAttribute('allow', 'autoplay; fullscreen; picture-in-picture; xr-spatial-tracking; encrypted-media');
this.nonLinearInnerElement.setAttribute('allow', 'autoplay; fullscreen; picture-in-picture; encrypted-media');
this.nonLinearInnerElement.setAttribute('scrolling', 'no');
this.nonLinearInnerElement.setAttribute('sandbox', 'allow-scripts allow-presentation allow-same-origin');
}
Expand Down
6 changes: 3 additions & 3 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ export default class RmpVast {
if (duration > 0) {
duration = duration * 1000;
}
return Math.round(duration);
return duration;
} else {
return VAST_PLAYER.getDuration.call(this);
}
Expand All @@ -1137,7 +1137,7 @@ export default class RmpVast {
if (remainingTime === -1 || duration === -1 || remainingTime > duration) {
return -1;
}
return Math.round(duration - remainingTime) * 1000;
return (duration - remainingTime) * 1000;
} else {
return VAST_PLAYER.getCurrentTime.call(this);
}
Expand All @@ -1155,7 +1155,7 @@ export default class RmpVast {
if (adRemainingTime > 0) {
adRemainingTime = adRemainingTime * 1000;
}
return Math.round(adRemainingTime);
return adRemainingTime;
} else {
const currentTime = VAST_PLAYER.getCurrentTime.call(this);
const duration = VAST_PLAYER.getDuration.call(this);
Expand Down
17 changes: 5 additions & 12 deletions src/js/players/content-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,15 @@ CONTENT_PLAYER.setMute = function (muted) {
};

CONTENT_PLAYER.getDuration = function () {
if (this.contentPlayer) {
const duration = this.contentPlayer.duration;
if (FW.isNumber(duration)) {
return Math.round(duration * 1000);
}
if (this.contentPlayer && FW.isNumber(this.contentPlayer.duration)) {
return this.contentPlayer.duration * 1000;
}
return -1;
};

CONTENT_PLAYER.getCurrentTime = function () {
if (this.contentPlayer) {
const currentTime = this.contentPlayer.currentTime;
if (FW.isNumber(currentTime)) {
return Math.round(currentTime * 1000);
}
if (this.contentPlayer && FW.isNumber(this.contentPlayer.currentTime)) {
return this.contentPlayer.currentTime * 1000;
}
return -1;
};
Expand All @@ -70,8 +64,7 @@ CONTENT_PLAYER.seekTo = function (msSeek) {
return;
}
if (msSeek >= 0 && this.contentPlayer) {
const seekValue = Math.round((msSeek / 1000) * 100) / 100;
this.contentPlayer.currentTime = seekValue;
this.contentPlayer.currentTime = msSeek / 1000;
}
};

Expand Down
14 changes: 4 additions & 10 deletions src/js/players/vast-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,21 +331,15 @@ VAST_PLAYER.pause = function () {
};

VAST_PLAYER.getDuration = function () {
if (this.vastPlayer) {
const duration = this.vastPlayer.duration;
if (FW.isNumber(duration)) {
return Math.round(duration * 1000);
}
if (this.vastPlayer && FW.isNumber(this.vastPlayer.duration)) {
return this.vastPlayer.duration * 1000;
}
return -1;
};

VAST_PLAYER.getCurrentTime = function () {
if (this.vastPlayer) {
const currentTime = this.vastPlayer.currentTime;
if (FW.isNumber(currentTime)) {
return Math.round(currentTime * 1000);
}
if (this.vastPlayer && FW.isNumber(this.vastPlayer.currentTime)) {
return this.vastPlayer.currentTime * 1000;
}
return -1;
};
Expand Down
2 changes: 1 addition & 1 deletion types/js/players/content-player.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion types/js/players/vast-player.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2af926b

Please sign in to comment.