Skip to content

Commit

Permalink
11.0.3
Browse files Browse the repository at this point in the history
- fix a weird bug in vast-client-js - sometimes it returns sequence === null for some items when adpod is made of redirects
  • Loading branch information
radiantmediaplayer committed Jul 5, 2023
1 parent b59a8ba commit e865ea9
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 15 deletions.
9 changes: 3 additions & 6 deletions app/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</head>

<body>
<div class="rmp-container" id="rmp" style="width: 320px; height: 180px;">
<div class="rmp-container" id="rmp">
<div class="rmp-content">
<video class="rmp-video" src="https://www.rmp-streaming.com/media/big-buck-bunny-360p.mp4" playsinline muted
controls>
Expand All @@ -23,12 +23,9 @@
var id = 'rmp';
var container = document.getElementById(id);
var ADTAG;
ADTAG = 'https://www.radiantmediaplayer.com/vast/tags/inline-linear-1.xml';
ADTAG = 'https://www.radiantmediaplayer.com/vast/tags/test2.xml';

var rmpVast = new RmpVast(id);
//rmpVast.loadAds(ADTAG);
rmpVast.loadAds(ADTAG);
</script>

<video src="https://www.rmp-streaming.com/media/big-buck-bunny-360p.mp4" playsinline muted controls autoplay>
</video>
</body>
22 changes: 18 additions & 4 deletions dist/rmp-vast.js
Original file line number Diff line number Diff line change
Expand Up @@ -9681,6 +9681,9 @@ var find_default = /*#__PURE__*/__webpack_require__.n(find);
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/promise.js
var core_js_stable_promise = __webpack_require__(6226);
var core_js_stable_promise_default = /*#__PURE__*/__webpack_require__.n(core_js_stable_promise);
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js
var reduce = __webpack_require__(4282);
var reduce_default = /*#__PURE__*/__webpack_require__.n(reduce);
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js
var concat = __webpack_require__(9022);
var concat_default = /*#__PURE__*/__webpack_require__.n(concat);
Expand Down Expand Up @@ -12708,7 +12711,7 @@ var Utils = /*#__PURE__*/function () {
omidRunValidationScript: false,
omidAutoplay: false,
partnerName: 'rmp-vast',
partnerVersion: "11.0.2"
partnerVersion: "11.0.3"
};
this.params = defaultParams;
if (inputParams && _typeof(inputParams) === 'object') {
Expand Down Expand Up @@ -13651,9 +13654,6 @@ function createAdVerification() {
trackingEvents: {}
};
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js
var reduce = __webpack_require__(4282);
var reduce_default = /*#__PURE__*/__webpack_require__.n(reduce);
;// CONCATENATED MODULE: ./src/assets/@dailymotion/vast-client/src/companion_ad.js
function createCompanionAd() {
var creativeAttributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
Expand Down Expand Up @@ -16666,6 +16666,7 @@ var update = injectStylesIntoStyleTag_default()(rmp_vast/* default */.Z, options




/**
* @license Copyright (c) 2015-2022 Radiant Media Player | https://www.radiantmediaplayer.com
* rmp-vast
Expand Down Expand Up @@ -17156,6 +17157,19 @@ var RmpVast = /*#__PURE__*/function () {
return true;
}
});
// this is to fix a weird bug in vast-client-js - sometimes it returns sequence === null for some items when
// adpod is made of redirects
if (_this8.adPod) {
var max = reduce_default()(ads).call(ads, function (prev, current) {
return prev.sequence > current.sequence ? prev : current;
}).sequence;
ads.forEach(function (ad) {
if (ad.sequence === null) {
ad.sequence = max + 1;
max++;
}
});
}
if (_this8.adPod) {
_this8.adSequence++;
if (_this8.adPodLength === 0) {
Expand Down
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.

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": "11.0.2",
"version": "11.0.3",
"author": "Radiant Media Player <[email protected]>",
"description": "A client-side JavaScript solution to load, parse and display VAST resources (advertising)",
"repository": {
Expand Down
13 changes: 13 additions & 0 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,19 @@ export default class RmpVast {
return true;
}
});
// this is to fix a weird bug in vast-client-js - sometimes it returns sequence === null for some items when
// adpod is made of redirects
if (this.adPod) {
let max = ads.reduce(function (prev, current) {
return (prev.sequence > current.sequence) ? prev : current;
}).sequence;
ads.forEach(ad => {
if (ad.sequence === null) {
ad.sequence = max + 1;
max++;
}
});
}
if (this.adPod) {
this.adSequence++;
if (this.adPodLength === 0) {
Expand Down
2 changes: 1 addition & 1 deletion types/js/index.d.ts.map

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

0 comments on commit e865ea9

Please sign in to comment.