Skip to content

Commit

Permalink
fix(player): Added missing element in conditional to execute pause co…
Browse files Browse the repository at this point in the history
…rrectly once ads are auto playing
  • Loading branch information
Rafael Miranda committed Dec 19, 2020
1 parent 82230a3 commit 7a6cd5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/esm/media/ads.js
Expand Up @@ -97,7 +97,7 @@ class Ads {
return;
}
if (this.adsManager) {
if (this.adsActive === false) {
if (!this.intervalTimer && this.adsActive === false) {
this.adsManager.start();
}
else {
Expand Down
19 changes: 6 additions & 13 deletions dist/openplayer.js
Expand Up @@ -2321,7 +2321,7 @@ var store = __webpack_require__(38);
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.8.1',
version: '3.7.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
});
Expand Down Expand Up @@ -3275,14 +3275,13 @@ var arraySpeciesCreate = __webpack_require__(89);

var push = [].push;

// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
var createMethod = function (TYPE) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var IS_FILTER_OUT = TYPE == 7;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that, specificCreate) {
var O = toObject($this);
Expand All @@ -3291,7 +3290,7 @@ var createMethod = function (TYPE) {
var length = toLength(self.length);
var index = 0;
var create = specificCreate || arraySpeciesCreate;
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var value, result;
for (;length > index; index++) if (NO_HOLES || index in self) {
value = self[index];
Expand All @@ -3303,10 +3302,7 @@ var createMethod = function (TYPE) {
case 5: return value; // find
case 6: return index; // findIndex
case 2: push.call(target, value); // filter
} else switch (TYPE) {
case 4: return false; // every
case 7: push.call(target, value); // filterOut
}
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
Expand Down Expand Up @@ -3334,10 +3330,7 @@ module.exports = {
find: createMethod(5),
// `Array.prototype.findIndex` method
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
findIndex: createMethod(6),
// `Array.prototype.filterOut` method
// https://github.com/tc39/proposal-array-filtering
filterOut: createMethod(7)
findIndex: createMethod(6)
};


Expand Down Expand Up @@ -9135,7 +9128,7 @@ var Ads = function () {
}

if (_this2.adsManager) {
if (_this2.adsActive === false) {
if (!_this2.intervalTimer && _this2.adsActive === false) {
_this2.adsManager.start();
} else {
_this2.adsManager.resume();
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/js/media/ads.ts
Expand Up @@ -407,7 +407,8 @@ class Ads {
}

if (this.adsManager) {
if (this.adsActive === false) {
// No timer interval and no adsActive mean it's a potential initial ad play
if (!this.intervalTimer && this.adsActive === false) {
this.adsManager.start();
} else {
this.adsManager.resume();
Expand Down

0 comments on commit 7a6cd5c

Please sign in to comment.