@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.mjs
CHANGED
@@ -75485,6 +75485,7 @@ var DailymotionMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
|
|
75485
75485
|
this.context.elements.original = target;
|
75486
75486
|
var _ref = _sliced_to_array(target.src.match(URLMatch) || [], 2), _ = _ref[0], videoId = _ref[1];
|
75487
75487
|
var container = document.createElement("div");
|
75488
|
+
this.rootNode = target;
|
75488
75489
|
container.id = "BRNDTS";
|
75489
75490
|
elements_default.wrap(target, container);
|
75490
75491
|
window.dailymotion.createPlayer(target.id, {
|
@@ -76574,6 +76575,48 @@ var MediaElementFactory = /*#__PURE__*/ function() {
|
|
76574
76575
|
return null;
|
76575
76576
|
}
|
76576
76577
|
},
|
76578
|
+
{
|
76579
|
+
key: "isElement",
|
76580
|
+
value: function isElement(element) {
|
76581
|
+
switch(element.tagName){
|
76582
|
+
case "DIV":
|
76583
|
+
var hasSrc = _MediaElementFactory.getElementAttribute(element, "src");
|
76584
|
+
if (hasSrc) {
|
76585
|
+
var _hasSrc = _sliced_to_array(hasSrc, 2), el = _hasSrc[0], value2 = _hasSrc[1];
|
76586
|
+
var provider2 = getProviderByUrl(value2);
|
76587
|
+
if (provider2) {
|
76588
|
+
return el;
|
76589
|
+
}
|
76590
|
+
}
|
76591
|
+
var hasBradMaxPID = _MediaElementFactory.getElementAttribute(element, "data-bradmax-player-pid");
|
76592
|
+
if (hasBradMaxPID) {
|
76593
|
+
var _hasBradMaxPID = _sliced_to_array(hasBradMaxPID, 2), el1 = _hasBradMaxPID[0], value21 = _hasBradMaxPID[1];
|
76594
|
+
return el1;
|
76595
|
+
}
|
76596
|
+
var isVideoJS = element.querySelector("video-js");
|
76597
|
+
if (isVideoJS) {
|
76598
|
+
return isVideoJS;
|
76599
|
+
}
|
76600
|
+
return null;
|
76601
|
+
case "IFRAME":
|
76602
|
+
var url2 = element.getAttribute("src");
|
76603
|
+
if (!url2) {
|
76604
|
+
return null;
|
76605
|
+
}
|
76606
|
+
var provider = getProviderByUrl(url2);
|
76607
|
+
if (!provider || provider !== "YOUTUBE" && provider !== "DAILYMOTION") {
|
76608
|
+
return null;
|
76609
|
+
}
|
76610
|
+
case "VIDEO-JS":
|
76611
|
+
return element;
|
76612
|
+
case "AUDIO":
|
76613
|
+
case "VIDEO":
|
76614
|
+
return element;
|
76615
|
+
default:
|
76616
|
+
return null;
|
76617
|
+
}
|
76618
|
+
}
|
76619
|
+
},
|
76577
76620
|
{
|
76578
76621
|
key: "getElements",
|
76579
76622
|
value: function getElements(targets) {
|
@@ -84171,12 +84214,15 @@ var VideoAd = /*#__PURE__*/ function() {
|
|
84171
84214
|
logger: context.logger,
|
84172
84215
|
service: context.service
|
84173
84216
|
};
|
84217
|
+
videoAdContext.elements.original = target.cloneNode(true);
|
84174
84218
|
var media = MediaElementFactory.get(videoAdContext, target);
|
84175
84219
|
if (!media) {
|
84176
84220
|
throw new Error("No media element found!");
|
84177
84221
|
}
|
84222
|
+
if (media.view) {
|
84223
|
+
media.view.brndts_VE = this;
|
84224
|
+
}
|
84178
84225
|
videoAdContext.media = media;
|
84179
|
-
videoAdContext.elements.original = target.cloneNode(true);
|
84180
84226
|
this.recorderFactory = new RecorderFactory(this.context);
|
84181
84227
|
this.videoAdContext = videoAdContext;
|
84182
84228
|
this.presentationFactory = new PresentationModeFactory(this.videoAdContext);
|
@@ -84440,7 +84486,64 @@ var VideoAds = /*#__PURE__*/ function() {
|
|
84440
84486
|
},
|
84441
84487
|
{
|
84442
84488
|
key: "handlePageMutation",
|
84443
|
-
value: function handlePageMutation() {
|
84489
|
+
value: function handlePageMutation(mutations) {
|
84490
|
+
var medias = [];
|
84491
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
84492
|
+
try {
|
84493
|
+
for(var _iterator = mutations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
84494
|
+
var mutation = _step.value;
|
84495
|
+
if (mutation.type === "childList") {
|
84496
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
84497
|
+
try {
|
84498
|
+
for(var _iterator1 = mutation.addedNodes[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
84499
|
+
var node = _step1.value;
|
84500
|
+
var _node_matches;
|
84501
|
+
if ((_node_matches = node.matches) === null || _node_matches === void 0 ? void 0 : _node_matches.call(node, this.context.selectors.targets)) {
|
84502
|
+
var mediaElement = MediaElementFactory.isElement(node);
|
84503
|
+
if (mediaElement) {
|
84504
|
+
medias.push(mediaElement);
|
84505
|
+
}
|
84506
|
+
}
|
84507
|
+
}
|
84508
|
+
} catch (err) {
|
84509
|
+
_didIteratorError1 = true;
|
84510
|
+
_iteratorError1 = err;
|
84511
|
+
} finally{
|
84512
|
+
try {
|
84513
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
84514
|
+
_iterator1.return();
|
84515
|
+
}
|
84516
|
+
} finally{
|
84517
|
+
if (_didIteratorError1) {
|
84518
|
+
throw _iteratorError1;
|
84519
|
+
}
|
84520
|
+
}
|
84521
|
+
}
|
84522
|
+
}
|
84523
|
+
}
|
84524
|
+
} catch (err) {
|
84525
|
+
_didIteratorError = true;
|
84526
|
+
_iteratorError = err;
|
84527
|
+
} finally{
|
84528
|
+
try {
|
84529
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
84530
|
+
_iterator.return();
|
84531
|
+
}
|
84532
|
+
} finally{
|
84533
|
+
if (_didIteratorError) {
|
84534
|
+
throw _iteratorError;
|
84535
|
+
}
|
84536
|
+
}
|
84537
|
+
}
|
84538
|
+
for(var index = 0; index < medias.length; index++){
|
84539
|
+
if (!medias[index] || medias[index].closest("#BRNDTS_R") || medias[index].querySelector("#BRNDTS_R") || medias[index].brndts_VE !== void 0) {
|
84540
|
+
continue;
|
84541
|
+
}
|
84542
|
+
var videoAd = new VideoAd(this.context, medias[index]);
|
84543
|
+
this.videoAdElements.push(videoAd);
|
84544
|
+
videoAd.start();
|
84545
|
+
}
|
84546
|
+
}
|
84444
84547
|
},
|
84445
84548
|
{
|
84446
84549
|
key: "updateSize",
|
@@ -84504,8 +84607,8 @@ var Ads = /*#__PURE__*/ function() {
|
|
84504
84607
|
_create_class(Ads, [
|
84505
84608
|
{
|
84506
84609
|
key: "handlePageMutation",
|
84507
|
-
value: function handlePageMutation() {
|
84508
|
-
this.videoAds.handlePageMutation();
|
84610
|
+
value: function handlePageMutation(mutations) {
|
84611
|
+
this.videoAds.handlePageMutation(mutations);
|
84509
84612
|
this.staticAds.handlePageMutation();
|
84510
84613
|
}
|
84511
84614
|
},
|