@brndts/brndts-ads 1.14.1 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +107 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +107 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -75398,6 +75398,7 @@ var DailymotionMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
|
|
75398
75398
|
this.context.elements.original = target;
|
75399
75399
|
var _ref = _sliced_to_array(target.src.match(URLMatch) || [], 2), _ = _ref[0], videoId = _ref[1];
|
75400
75400
|
var container = document.createElement("div");
|
75401
|
+
this.rootNode = target;
|
75401
75402
|
container.id = "BRNDTS";
|
75402
75403
|
elements_default.wrap(target, container);
|
75403
75404
|
window.dailymotion.createPlayer(target.id, {
|
@@ -76484,6 +76485,48 @@ var MediaElementFactory = /*#__PURE__*/ function() {
|
|
76484
76485
|
return null;
|
76485
76486
|
}
|
76486
76487
|
},
|
76488
|
+
{
|
76489
|
+
key: "isElement",
|
76490
|
+
value: function isElement(element) {
|
76491
|
+
switch(element.tagName){
|
76492
|
+
case "DIV":
|
76493
|
+
var hasSrc = _MediaElementFactory.getElementAttribute(element, "src");
|
76494
|
+
if (hasSrc) {
|
76495
|
+
var _hasSrc = _sliced_to_array(hasSrc, 2), el = _hasSrc[0], value2 = _hasSrc[1];
|
76496
|
+
var provider2 = getProviderByUrl(value2);
|
76497
|
+
if (provider2) {
|
76498
|
+
return el;
|
76499
|
+
}
|
76500
|
+
}
|
76501
|
+
var hasBradMaxPID = _MediaElementFactory.getElementAttribute(element, "data-bradmax-player-pid");
|
76502
|
+
if (hasBradMaxPID) {
|
76503
|
+
var _hasBradMaxPID = _sliced_to_array(hasBradMaxPID, 2), el1 = _hasBradMaxPID[0], value21 = _hasBradMaxPID[1];
|
76504
|
+
return el1;
|
76505
|
+
}
|
76506
|
+
var isVideoJS = element.querySelector("video-js");
|
76507
|
+
if (isVideoJS) {
|
76508
|
+
return isVideoJS;
|
76509
|
+
}
|
76510
|
+
return null;
|
76511
|
+
case "IFRAME":
|
76512
|
+
var url2 = element.getAttribute("src");
|
76513
|
+
if (!url2) {
|
76514
|
+
return null;
|
76515
|
+
}
|
76516
|
+
var provider = getProviderByUrl(url2);
|
76517
|
+
if (!provider || provider !== "YOUTUBE" && provider !== "DAILYMOTION") {
|
76518
|
+
return null;
|
76519
|
+
}
|
76520
|
+
case "VIDEO-JS":
|
76521
|
+
return element;
|
76522
|
+
case "AUDIO":
|
76523
|
+
case "VIDEO":
|
76524
|
+
return element;
|
76525
|
+
default:
|
76526
|
+
return null;
|
76527
|
+
}
|
76528
|
+
}
|
76529
|
+
},
|
76487
76530
|
{
|
76488
76531
|
key: "getElements",
|
76489
76532
|
value: function getElements(targets) {
|
@@ -84032,12 +84075,15 @@ var VideoAd = /*#__PURE__*/ function() {
|
|
84032
84075
|
logger: context.logger,
|
84033
84076
|
service: context.service
|
84034
84077
|
};
|
84078
|
+
videoAdContext.elements.original = target.cloneNode(true);
|
84035
84079
|
var media = MediaElementFactory.get(videoAdContext, target);
|
84036
84080
|
if (!media) {
|
84037
84081
|
throw new Error("No media element found!");
|
84038
84082
|
}
|
84083
|
+
if (media.view) {
|
84084
|
+
media.view.brndts_VE = this;
|
84085
|
+
}
|
84039
84086
|
videoAdContext.media = media;
|
84040
|
-
videoAdContext.elements.original = target.cloneNode(true);
|
84041
84087
|
this.recorderFactory = new RecorderFactory(this.context);
|
84042
84088
|
this.videoAdContext = videoAdContext;
|
84043
84089
|
this.presentationFactory = new PresentationModeFactory(this.videoAdContext);
|
@@ -84300,7 +84346,64 @@ var VideoAds = /*#__PURE__*/ function() {
|
|
84300
84346
|
},
|
84301
84347
|
{
|
84302
84348
|
key: "handlePageMutation",
|
84303
|
-
value: function handlePageMutation() {
|
84349
|
+
value: function handlePageMutation(mutations) {
|
84350
|
+
var medias = [];
|
84351
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
84352
|
+
try {
|
84353
|
+
for(var _iterator = mutations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
84354
|
+
var mutation = _step.value;
|
84355
|
+
if (mutation.type === "childList") {
|
84356
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
84357
|
+
try {
|
84358
|
+
for(var _iterator1 = mutation.addedNodes[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
84359
|
+
var node = _step1.value;
|
84360
|
+
var _node_matches;
|
84361
|
+
if ((_node_matches = node.matches) === null || _node_matches === void 0 ? void 0 : _node_matches.call(node, this.context.selectors.targets)) {
|
84362
|
+
var mediaElement = MediaElementFactory.isElement(node);
|
84363
|
+
if (mediaElement) {
|
84364
|
+
medias.push(mediaElement);
|
84365
|
+
}
|
84366
|
+
}
|
84367
|
+
}
|
84368
|
+
} catch (err) {
|
84369
|
+
_didIteratorError1 = true;
|
84370
|
+
_iteratorError1 = err;
|
84371
|
+
} finally{
|
84372
|
+
try {
|
84373
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
84374
|
+
_iterator1.return();
|
84375
|
+
}
|
84376
|
+
} finally{
|
84377
|
+
if (_didIteratorError1) {
|
84378
|
+
throw _iteratorError1;
|
84379
|
+
}
|
84380
|
+
}
|
84381
|
+
}
|
84382
|
+
}
|
84383
|
+
}
|
84384
|
+
} catch (err) {
|
84385
|
+
_didIteratorError = true;
|
84386
|
+
_iteratorError = err;
|
84387
|
+
} finally{
|
84388
|
+
try {
|
84389
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
84390
|
+
_iterator.return();
|
84391
|
+
}
|
84392
|
+
} finally{
|
84393
|
+
if (_didIteratorError) {
|
84394
|
+
throw _iteratorError;
|
84395
|
+
}
|
84396
|
+
}
|
84397
|
+
}
|
84398
|
+
for(var index = 0; index < medias.length; index++){
|
84399
|
+
if (!medias[index] || medias[index].closest("#BRNDTS_R") || medias[index].querySelector("#BRNDTS_R") || medias[index].brndts_VE !== void 0) {
|
84400
|
+
continue;
|
84401
|
+
}
|
84402
|
+
var videoAd = new VideoAd(this.context, medias[index]);
|
84403
|
+
this.videoAdElements.push(videoAd);
|
84404
|
+
videoAd.start();
|
84405
|
+
}
|
84406
|
+
}
|
84304
84407
|
},
|
84305
84408
|
{
|
84306
84409
|
key: "updateSize",
|
@@ -84363,8 +84466,8 @@ var Ads = /*#__PURE__*/ function() {
|
|
84363
84466
|
_create_class(Ads, [
|
84364
84467
|
{
|
84365
84468
|
key: "handlePageMutation",
|
84366
|
-
value: function handlePageMutation() {
|
84367
|
-
this.videoAds.handlePageMutation();
|
84469
|
+
value: function handlePageMutation(mutations) {
|
84470
|
+
this.videoAds.handlePageMutation(mutations);
|
84368
84471
|
this.staticAds.handlePageMutation();
|
84369
84472
|
}
|
84370
84473
|
},
|