@brndts/brndts-ads 1.13.15 → 1.13.16
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 +52 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -75379,6 +75379,56 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
|
|
75379
75379
|
input.click();
|
75380
75380
|
}
|
75381
75381
|
},
|
75382
|
+
{
|
75383
|
+
key: "findRegionAppearancePeriods",
|
75384
|
+
value: function findRegionAppearancePeriods(regionId, minDurationSeconds) {
|
75385
|
+
var data = this.regionsData.data;
|
75386
|
+
var appearanceTimestamps = Object.values(data).filter(function(info) {
|
75387
|
+
return info.regions.some(function(region) {
|
75388
|
+
return region.id === regionId;
|
75389
|
+
});
|
75390
|
+
}).map(function(info) {
|
75391
|
+
return {
|
75392
|
+
start: info.timestamp_start,
|
75393
|
+
end: info.timestamp_end
|
75394
|
+
};
|
75395
|
+
}).sort(function(a, b) {
|
75396
|
+
return a.start - b.start;
|
75397
|
+
});
|
75398
|
+
if (appearanceTimestamps.length === 0) {
|
75399
|
+
return [];
|
75400
|
+
}
|
75401
|
+
var validPeriods = [];
|
75402
|
+
var currentPeriodStart = appearanceTimestamps[0].start;
|
75403
|
+
var currentPeriodEnd = appearanceTimestamps[0].end;
|
75404
|
+
for(var i = 1; i < appearanceTimestamps.length; i++){
|
75405
|
+
var current = appearanceTimestamps[i];
|
75406
|
+
if (current.start <= currentPeriodEnd) {
|
75407
|
+
currentPeriodEnd = Math.max(currentPeriodEnd, current.end);
|
75408
|
+
} else {
|
75409
|
+
var duration = currentPeriodEnd - currentPeriodStart;
|
75410
|
+
if (duration >= minDurationSeconds) {
|
75411
|
+
validPeriods.push({
|
75412
|
+
start: currentPeriodStart,
|
75413
|
+
end: currentPeriodEnd,
|
75414
|
+
duration: duration
|
75415
|
+
});
|
75416
|
+
}
|
75417
|
+
currentPeriodStart = current.start;
|
75418
|
+
currentPeriodEnd = current.end;
|
75419
|
+
}
|
75420
|
+
}
|
75421
|
+
var finalDuration = currentPeriodEnd - currentPeriodStart;
|
75422
|
+
if (finalDuration >= minDurationSeconds) {
|
75423
|
+
validPeriods.push({
|
75424
|
+
start: currentPeriodStart,
|
75425
|
+
end: currentPeriodEnd,
|
75426
|
+
duration: finalDuration
|
75427
|
+
});
|
75428
|
+
}
|
75429
|
+
return validPeriods;
|
75430
|
+
}
|
75431
|
+
},
|
75382
75432
|
{
|
75383
75433
|
key: "destroy",
|
75384
75434
|
value: function destroy() {
|
@@ -82330,10 +82380,10 @@ var NotBasicPresentationMode = /*#__PURE__*/ function() {
|
|
82330
82380
|
{
|
82331
82381
|
key: "destroy",
|
82332
82382
|
value: function destroy() {
|
82333
|
-
var _this_adPresentationStrategy, _this_regionsRenderer, _this_context_interface;
|
82383
|
+
var _this_adPresentationStrategy, _this_regionsRenderer, _this_context_recorder, _this_context_interface;
|
82334
82384
|
(_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.destroy();
|
82335
82385
|
(_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.destroy();
|
82336
|
-
this.context.recorder.destroy();
|
82386
|
+
(_this_context_recorder = this.context.recorder) === null || _this_context_recorder === void 0 ? void 0 : _this_context_recorder.destroy();
|
82337
82387
|
(_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : _this_context_interface.destroy();
|
82338
82388
|
}
|
82339
82389
|
}
|