@brndts/brndts-ads 0.0.3 → 1.0.1
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.css +9 -6
- package/dist/index.css.map +1 -1
- package/dist/index.js +116 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +116 -84
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -3
package/dist/index.mjs
CHANGED
@@ -18597,7 +18597,7 @@ var Reporter = /*#__PURE__*/ function() {
|
|
18597
18597
|
function Reporter() {
|
18598
18598
|
_class_call_check(this, Reporter);
|
18599
18599
|
this.client = new BrowserClient({
|
18600
|
-
dsn: "https://
|
18600
|
+
dsn: "https://bc8a1d82ad7d35b0c7566cf343e4bdb5@o4507460056317952.ingest.de.sentry.io/4507900315238480",
|
18601
18601
|
transport: makeFetchTransport,
|
18602
18602
|
stackParser: defaultStackParser,
|
18603
18603
|
integrations: [
|
@@ -18670,7 +18670,6 @@ var ErrorHandler = /*#__PURE__*/ function() {
|
|
18670
18670
|
key: "handle",
|
18671
18671
|
value: function handle(error) {
|
18672
18672
|
Reporter_default.capture(error);
|
18673
|
-
console.error(error);
|
18674
18673
|
if (_instanceof(error, GenericError)) {
|
18675
18674
|
if (error.fatal) {
|
18676
18675
|
throw error;
|
@@ -18870,8 +18869,7 @@ var defaults = {
|
|
18870
18869
|
},
|
18871
18870
|
playback: {},
|
18872
18871
|
volume: {
|
18873
|
-
mute: false
|
18874
|
-
defaultVolume: 20
|
18872
|
+
mute: false
|
18875
18873
|
},
|
18876
18874
|
ads: {
|
18877
18875
|
enabled: true,
|
@@ -18882,7 +18880,7 @@ var defaults = {
|
|
18882
18880
|
},
|
18883
18881
|
regions: {
|
18884
18882
|
useCache: true,
|
18885
|
-
strategy: "
|
18883
|
+
strategy: "bannerv2"
|
18886
18884
|
},
|
18887
18885
|
provider: {
|
18888
18886
|
type: "brndts_placeholder",
|
@@ -18910,7 +18908,7 @@ var Config = /*#__PURE__*/ function() {
|
|
18910
18908
|
if (!((_providedConfigs_auth = providedConfigs.auth) === null || _providedConfigs_auth === void 0 ? void 0 : _providedConfigs_auth.host)) {
|
18911
18909
|
throw new InternalError("No authority configuration provided!");
|
18912
18910
|
}
|
18913
|
-
if (!providedConfigs.
|
18911
|
+
if (!providedConfigs.key) {
|
18914
18912
|
throw new InternalError("No host or key provided!");
|
18915
18913
|
}
|
18916
18914
|
this.configs = defaults;
|
@@ -18932,7 +18930,6 @@ var Config = /*#__PURE__*/ function() {
|
|
18932
18930
|
return fetch("".concat(this.configs.auth.host, "/authority/tenant/bap/").concat(this.configs.key, "/configs")).then(function(response) {
|
18933
18931
|
return response.json();
|
18934
18932
|
}).then(function(data) {
|
18935
|
-
console.log("Loaded remote configuration", data);
|
18936
18933
|
_this.remote = data;
|
18937
18934
|
_this.merge();
|
18938
18935
|
});
|
@@ -19679,6 +19676,18 @@ var Region = /*#__PURE__*/ function() {
|
|
19679
19676
|
this.render(this.contours, this.box.coords);
|
19680
19677
|
}
|
19681
19678
|
},
|
19679
|
+
{
|
19680
|
+
key: "boundingBox",
|
19681
|
+
get: function get() {
|
19682
|
+
return this.box;
|
19683
|
+
}
|
19684
|
+
},
|
19685
|
+
{
|
19686
|
+
key: "referencePlane",
|
19687
|
+
get: function get() {
|
19688
|
+
return this.plane;
|
19689
|
+
}
|
19690
|
+
},
|
19682
19691
|
{
|
19683
19692
|
key: "view",
|
19684
19693
|
get: function get() {
|
@@ -19942,6 +19951,11 @@ var RegionsContainerView = /*#__PURE__*/ function() {
|
|
19942
19951
|
} else {
|
19943
19952
|
this.contentLayer.style.top = "0px";
|
19944
19953
|
}
|
19954
|
+
if (width - newDimensions.width > 0) {
|
19955
|
+
this.contentLayer.style.left = "".concat((width - newDimensions.width) / 2, "px");
|
19956
|
+
} else {
|
19957
|
+
this.contentLayer.style.left = "0px";
|
19958
|
+
}
|
19945
19959
|
}
|
19946
19960
|
},
|
19947
19961
|
{
|
@@ -20184,7 +20198,11 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
20184
20198
|
}
|
20185
20199
|
},
|
20186
20200
|
{
|
20187
|
-
|
20201
|
+
/**
|
20202
|
+
* Starts the presentation strategy.
|
20203
|
+
*
|
20204
|
+
* @param stopPace - Indicates whether to stop the pacing before starting the presentation.
|
20205
|
+
*/ key: "startedPresentation",
|
20188
20206
|
value: function startedPresentation() {
|
20189
20207
|
var _this = this;
|
20190
20208
|
var stopPace = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
@@ -20197,20 +20215,26 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
20197
20215
|
}
|
20198
20216
|
},
|
20199
20217
|
{
|
20200
|
-
|
20218
|
+
/**
|
20219
|
+
* Starts the cooldown presentation.
|
20220
|
+
*/ key: "start",
|
20201
20221
|
value: function start() {
|
20202
20222
|
this.clearAll();
|
20203
20223
|
this.enablePresentation();
|
20204
20224
|
}
|
20205
20225
|
},
|
20206
20226
|
{
|
20207
|
-
|
20227
|
+
/**
|
20228
|
+
* Stops the cooldown presentation strategy.
|
20229
|
+
*/ key: "stop",
|
20208
20230
|
value: function stop() {
|
20209
20231
|
this.clearAll();
|
20210
20232
|
}
|
20211
20233
|
},
|
20212
20234
|
{
|
20213
|
-
|
20235
|
+
/**
|
20236
|
+
* Destroys the instance of the CooldownPresentation class.
|
20237
|
+
*/ key: "destroy",
|
20214
20238
|
value: function destroy() {
|
20215
20239
|
this.clearAll();
|
20216
20240
|
}
|
@@ -20388,7 +20412,7 @@ var AdsTerraProvider = /*#__PURE__*/ function(ContentProvider) {
|
|
20388
20412
|
]);
|
20389
20413
|
return AdsTerraProvider;
|
20390
20414
|
}(ContentProvider);
|
20391
|
-
// src/Ads/Providers/BRNDTSDefaultProvider.ts
|
20415
|
+
// src/Ads/Providers/BRNDTSDefault/BRNDTSDefaultProvider.ts
|
20392
20416
|
var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
|
20393
20417
|
"use strict";
|
20394
20418
|
_inherits(BRNDTSDefaultProvider, ContentProvider);
|
@@ -20481,7 +20505,6 @@ var KevelSDK = /*#__PURE__*/ function() {
|
|
20481
20505
|
};
|
20482
20506
|
}
|
20483
20507
|
}).catch(function(error) {
|
20484
|
-
console.error("There was a problem with the fetch operation:", error);
|
20485
20508
|
throw error;
|
20486
20509
|
});
|
20487
20510
|
}
|
@@ -20498,7 +20521,6 @@ var KevelProvider = /*#__PURE__*/ function(ContentProvider) {
|
|
20498
20521
|
var _this;
|
20499
20522
|
_this = _super.call(this, context, options);
|
20500
20523
|
_this.kevel = new KevelSDK(_this.options.networkId, _this.options.siteId);
|
20501
|
-
_this.requestContent();
|
20502
20524
|
return _this;
|
20503
20525
|
}
|
20504
20526
|
_create_class(KevelProvider, [
|
@@ -20544,10 +20566,12 @@ var KevelProvider = /*#__PURE__*/ function(ContentProvider) {
|
|
20544
20566
|
{
|
20545
20567
|
key: "request",
|
20546
20568
|
value: function request() {
|
20569
|
+
var _this = this;
|
20547
20570
|
return _async_to_generator(function() {
|
20548
20571
|
return _ts_generator(this, function(_state) {
|
20549
20572
|
return [
|
20550
|
-
2
|
20573
|
+
2,
|
20574
|
+
_this.requestContent()
|
20551
20575
|
];
|
20552
20576
|
});
|
20553
20577
|
})();
|
@@ -20556,7 +20580,7 @@ var KevelProvider = /*#__PURE__*/ function(ContentProvider) {
|
|
20556
20580
|
]);
|
20557
20581
|
return KevelProvider;
|
20558
20582
|
}(ContentProvider);
|
20559
|
-
// src/Ads/Providers/
|
20583
|
+
// src/Ads/Providers/SmartyAds/SmartyAdsSDK.ts
|
20560
20584
|
var SmartyadsSDK = /*#__PURE__*/ function() {
|
20561
20585
|
"use strict";
|
20562
20586
|
function SmartyadsSDK() {
|
@@ -20593,9 +20617,7 @@ var SmartyadsSDK = /*#__PURE__*/ function() {
|
|
20593
20617
|
key: "request",
|
20594
20618
|
value: function request(params) {
|
20595
20619
|
var url2 = "https://n1.smartyads.com/?c=b&".concat(this.buildQueryParams(params));
|
20596
|
-
console.log("requesting : ", url2);
|
20597
20620
|
return fetch("https://n1.smartyads.com/?c=b&".concat(this.buildQueryParams(params))).then(function(response) {
|
20598
|
-
console.log("response", response);
|
20599
20621
|
if (!response.ok) {
|
20600
20622
|
throw new InternalError("Network response was not ok");
|
20601
20623
|
}
|
@@ -20603,7 +20625,6 @@ var SmartyadsSDK = /*#__PURE__*/ function() {
|
|
20603
20625
|
}).then(function(data) {
|
20604
20626
|
return data;
|
20605
20627
|
}).catch(function(error) {
|
20606
|
-
console.error("There was a problem with the fetch operation:", error);
|
20607
20628
|
throw error;
|
20608
20629
|
});
|
20609
20630
|
}
|
@@ -20611,6 +20632,7 @@ var SmartyadsSDK = /*#__PURE__*/ function() {
|
|
20611
20632
|
]);
|
20612
20633
|
return SmartyadsSDK;
|
20613
20634
|
}();
|
20635
|
+
// src/Ads/Providers/SmartyAds/SmartyadsProvider.ts
|
20614
20636
|
var SmartyadsProvider = /*#__PURE__*/ function(ContentProvider) {
|
20615
20637
|
"use strict";
|
20616
20638
|
_inherits(SmartyadsProvider, ContentProvider);
|
@@ -20627,14 +20649,14 @@ var SmartyadsProvider = /*#__PURE__*/ function(ContentProvider) {
|
|
20627
20649
|
{
|
20628
20650
|
key: "getPlacement",
|
20629
20651
|
value: function getPlacement(regionId) {
|
20630
|
-
var availablePlacements = Object.keys(this.
|
20652
|
+
var availablePlacements = Object.keys(this.placements).map(parseInt);
|
20631
20653
|
if (!availablePlacements) {
|
20632
20654
|
throw new Error("No available placements!");
|
20633
20655
|
}
|
20634
20656
|
if (!regionId) {
|
20635
|
-
return this.
|
20657
|
+
return this.placements[availablePlacements[0]];
|
20636
20658
|
}
|
20637
|
-
return this.
|
20659
|
+
return this.placements[regionId];
|
20638
20660
|
}
|
20639
20661
|
},
|
20640
20662
|
{
|
@@ -20646,7 +20668,7 @@ var SmartyadsProvider = /*#__PURE__*/ function(ContentProvider) {
|
|
20646
20668
|
return _ts_generator(this, function(_state) {
|
20647
20669
|
switch(_state.label){
|
20648
20670
|
case 0:
|
20649
|
-
if (!params || params.size.width === void 0 || params.size.height === void 0) {
|
20671
|
+
if (!params || params.size.width === void 0 || params.size.width === 0 || params.size.height === void 0 || params.size.height === 0) {
|
20650
20672
|
throw new InternalError("No Params!");
|
20651
20673
|
}
|
20652
20674
|
return [
|
@@ -20686,7 +20708,7 @@ var SmartyadsProvider = /*#__PURE__*/ function(ContentProvider) {
|
|
20686
20708
|
]);
|
20687
20709
|
return SmartyadsProvider;
|
20688
20710
|
}(ContentProvider);
|
20689
|
-
// src/Ads/Providers/StaticImageProvider.ts
|
20711
|
+
// src/Ads/Providers/StaticImage/StaticImageProvider.ts
|
20690
20712
|
var StaticImageProvider = /*#__PURE__*/ function(ContentProvider) {
|
20691
20713
|
"use strict";
|
20692
20714
|
_inherits(StaticImageProvider, ContentProvider);
|
@@ -20778,47 +20800,43 @@ var VideoRegionsDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataManag
|
|
20778
20800
|
var last;
|
20779
20801
|
var result;
|
20780
20802
|
var workingTimestamp = timestamp;
|
20781
|
-
|
20782
|
-
|
20783
|
-
|
20784
|
-
|
20785
|
-
|
20803
|
+
while(totalDuration < this.params.duration){
|
20804
|
+
var regions = this.component.get(workingTimestamp);
|
20805
|
+
if (!regions || !regions.regions) {
|
20806
|
+
return null;
|
20807
|
+
}
|
20808
|
+
var validRegions = regions.regions.filter(function(reg, _, array) {
|
20809
|
+
if (!last) {
|
20810
|
+
last = array.map(function(r2) {
|
20811
|
+
return r2.id;
|
20812
|
+
});
|
20813
|
+
result = _to_consumable_array(array);
|
20786
20814
|
}
|
20787
|
-
|
20788
|
-
if (
|
20789
|
-
|
20790
|
-
return r2.id;
|
20791
|
-
});
|
20792
|
-
result = _to_consumable_array(array);
|
20793
|
-
}
|
20794
|
-
if (reg.iou <= _this.iou) {
|
20795
|
-
if (last.includes(reg.id)) {
|
20796
|
-
return true;
|
20797
|
-
}
|
20798
|
-
return false;
|
20799
|
-
} else {
|
20800
|
-
if (last.includes(reg.id)) {
|
20801
|
-
var foundIndex = last.indexOf(reg.id);
|
20802
|
-
last.splice(foundIndex, 1);
|
20803
|
-
result === null || result === void 0 ? void 0 : result.splice(foundIndex, 1);
|
20804
|
-
}
|
20805
|
-
return false;
|
20815
|
+
if (reg.iou <= _this.iou) {
|
20816
|
+
if (last.includes(reg.id)) {
|
20817
|
+
return true;
|
20806
20818
|
}
|
20807
|
-
|
20808
|
-
if (validRegions.length <= 0) {
|
20809
|
-
return null;
|
20810
|
-
}
|
20811
|
-
var duration = 0;
|
20812
|
-
if (regions.timestamp_start < workingTimestamp) {
|
20813
|
-
duration = regions.timestamp_end - workingTimestamp;
|
20819
|
+
return false;
|
20814
20820
|
} else {
|
20815
|
-
|
20821
|
+
if (last.includes(reg.id)) {
|
20822
|
+
var foundIndex = last.indexOf(reg.id);
|
20823
|
+
last.splice(foundIndex, 1);
|
20824
|
+
result === null || result === void 0 ? void 0 : result.splice(foundIndex, 1);
|
20825
|
+
}
|
20826
|
+
return false;
|
20816
20827
|
}
|
20817
|
-
|
20818
|
-
|
20828
|
+
});
|
20829
|
+
if (validRegions.length <= 0) {
|
20830
|
+
return null;
|
20819
20831
|
}
|
20820
|
-
|
20821
|
-
|
20832
|
+
var duration = 0;
|
20833
|
+
if (regions.timestamp_start < workingTimestamp) {
|
20834
|
+
duration = regions.timestamp_end - workingTimestamp;
|
20835
|
+
} else {
|
20836
|
+
duration = regions.timestamp_end - regions.timestamp_start;
|
20837
|
+
}
|
20838
|
+
totalDuration += duration;
|
20839
|
+
workingTimestamp = regions.timestamp_end + 1e-3;
|
20822
20840
|
}
|
20823
20841
|
if (!result) {
|
20824
20842
|
return null;
|
@@ -20898,10 +20916,11 @@ var Ads = /*#__PURE__*/ function() {
|
|
20898
20916
|
this.context.store.subscribe(function(newState, oldState) {
|
20899
20917
|
if (oldState.status !== newState.status) {
|
20900
20918
|
if (newState.status === "playing") {
|
20901
|
-
console.log("ads state changed");
|
20902
20919
|
_this.adPresentationStrategy.start();
|
20903
20920
|
} else {
|
20921
|
+
var _this_regionsRenderer;
|
20904
20922
|
_this.adPresentationStrategy.stop();
|
20923
|
+
(_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
|
20905
20924
|
}
|
20906
20925
|
}
|
20907
20926
|
if (oldState.ready !== newState.ready) {
|
@@ -20911,11 +20930,20 @@ var Ads = /*#__PURE__*/ function() {
|
|
20911
20930
|
}
|
20912
20931
|
});
|
20913
20932
|
this.adPresentationStrategy.on("presentation", function() {
|
20914
|
-
|
20915
|
-
|
20916
|
-
|
20917
|
-
|
20918
|
-
|
20933
|
+
try {
|
20934
|
+
var regions = _this.videoRegions.get(_this.context.media.currentTime);
|
20935
|
+
if (regions === null || regions === void 0 ? void 0 : regions.regions) {
|
20936
|
+
var _this_regionsRenderer;
|
20937
|
+
_this.adPresentationStrategy.startedPresentation();
|
20938
|
+
(_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.render(regions.regions);
|
20939
|
+
}
|
20940
|
+
} catch (e2) {
|
20941
|
+
if (_instanceof(e2, Error)) {
|
20942
|
+
var error = new InternalError(e2.message);
|
20943
|
+
error.stack = e2.stack;
|
20944
|
+
_this.context.logger.error(e2);
|
20945
|
+
ErrorHandler.handle(error);
|
20946
|
+
}
|
20919
20947
|
}
|
20920
20948
|
}).on("cooldown", function() {
|
20921
20949
|
var _this_regionsRenderer;
|
@@ -20924,7 +20952,6 @@ var Ads = /*#__PURE__*/ function() {
|
|
20924
20952
|
});
|
20925
20953
|
(_this_context_media = this.context.media) === null || _this_context_media === void 0 ? void 0 : _this_context_media.on("SEEKED", function() {
|
20926
20954
|
_this.videoRegions.seek(_this.context.media.currentTime);
|
20927
|
-
_this.adPresentationStrategy.start();
|
20928
20955
|
});
|
20929
20956
|
this.handleState();
|
20930
20957
|
}
|
@@ -24216,10 +24243,9 @@ var Interface = /*#__PURE__*/ function(_import_events3_default) {
|
|
24216
24243
|
}
|
24217
24244
|
_this.media = _this.context.media;
|
24218
24245
|
_this.container = document.createElement("div");
|
24219
|
-
_this.container.id = "
|
24246
|
+
_this.container.id = "BRNDTS";
|
24220
24247
|
_this.setDebug(_this.context.config.get("debug"));
|
24221
24248
|
_this.wrapMedia();
|
24222
|
-
_this.migrateStyles();
|
24223
24249
|
_this.setupControls();
|
24224
24250
|
return _this;
|
24225
24251
|
}
|
@@ -24228,7 +24254,7 @@ var Interface = /*#__PURE__*/ function(_import_events3_default) {
|
|
24228
24254
|
key: "wrapMedia",
|
24229
24255
|
value: function wrapMedia() {
|
24230
24256
|
var _this_media_view_parentElement, _this_media_view;
|
24231
|
-
if (((_this_media_view = this.media.view) === null || _this_media_view === void 0 ? void 0 : (_this_media_view_parentElement = _this_media_view.parentElement) === null || _this_media_view_parentElement === void 0 ? void 0 : _this_media_view_parentElement.id) === "
|
24257
|
+
if (((_this_media_view = this.media.view) === null || _this_media_view === void 0 ? void 0 : (_this_media_view_parentElement = _this_media_view.parentElement) === null || _this_media_view_parentElement === void 0 ? void 0 : _this_media_view_parentElement.id) === "BRNDTS") {
|
24232
24258
|
this.context.elements.container = this.media.view.parentElement;
|
24233
24259
|
}
|
24234
24260
|
if (!is_default.element(this.context.elements.container)) {
|
@@ -24237,9 +24263,11 @@ var Interface = /*#__PURE__*/ function(_import_events3_default) {
|
|
24237
24263
|
} else if (this.context.elements.container) {
|
24238
24264
|
this.container = this.context.elements.container;
|
24239
24265
|
}
|
24240
|
-
this.
|
24241
|
-
this.container.style.height = "".concat(this.media.viewHeight, "px");
|
24266
|
+
this.migrateStyles();
|
24242
24267
|
if (this.media.view) {
|
24268
|
+
this.media.view.style.position = "absolute";
|
24269
|
+
this.media.view.style.top = "0";
|
24270
|
+
this.media.view.style.left = "0";
|
24243
24271
|
this.media.view.style.width = "100%";
|
24244
24272
|
this.media.view.style.height = "100%";
|
24245
24273
|
}
|
@@ -24252,7 +24280,7 @@ var Interface = /*#__PURE__*/ function(_import_events3_default) {
|
|
24252
24280
|
var _this_media_view;
|
24253
24281
|
Object.values(_object_spread({}, ((_this_media_view = this.media.view) === null || _this_media_view === void 0 ? void 0 : _this_media_view.style) || {})).filter(//@ts-expect-error
|
24254
24282
|
function(key) {
|
24255
|
-
return !is_default.empty(key) && is_default.string(key)
|
24283
|
+
return !is_default.empty(key) && is_default.string(key);
|
24256
24284
|
}).forEach(function(key) {
|
24257
24285
|
_this.container.style.setProperty(//@ts-expect-error
|
24258
24286
|
key, //@ts-expect-error
|
@@ -28668,6 +28696,14 @@ var BRNDTSService = /*#__PURE__*/ function(_import_events4_default) {
|
|
28668
28696
|
});
|
28669
28697
|
_this.socket.on("connect", _this.handleOpen.bind(_assert_this_initialized(_this)));
|
28670
28698
|
_this.socket.on("disconnect", _this.handleClose.bind(_assert_this_initialized(_this)));
|
28699
|
+
_this.socket.on("connect_error", function(error) {
|
28700
|
+
var _this_logger;
|
28701
|
+
(_this_logger = _this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.error("Connection error:", error);
|
28702
|
+
});
|
28703
|
+
_this.socket.on("error", function(error) {
|
28704
|
+
var _this_logger;
|
28705
|
+
(_this_logger = _this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.error("Socket error:", error);
|
28706
|
+
});
|
28671
28707
|
return _this;
|
28672
28708
|
}
|
28673
28709
|
_create_class(BRNDTSService, [
|
@@ -28926,9 +28962,9 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement1) {
|
|
28926
28962
|
key: "setMediaElement",
|
28927
28963
|
value: function setMediaElement() {
|
28928
28964
|
var _this = this;
|
28929
|
-
|
28965
|
+
this.context.logger.log("Checking YT API");
|
28930
28966
|
if (is_default.object(window.YT) && is_default.function(window.YT.Player)) {
|
28931
|
-
|
28967
|
+
this.context.logger.log("YT API is already loaded");
|
28932
28968
|
this.YTAPIReady();
|
28933
28969
|
} else {
|
28934
28970
|
var callback = window.onYouTubeIframeAPIReady;
|
@@ -28936,12 +28972,12 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement1) {
|
|
28936
28972
|
if (callback && is_default.function(callback)) {
|
28937
28973
|
callback();
|
28938
28974
|
}
|
28939
|
-
|
28975
|
+
_this.context.logger.log("YT API is loaded");
|
28940
28976
|
_this.YTAPIReady();
|
28941
28977
|
};
|
28942
|
-
|
28978
|
+
this.context.logger.log("YT API is not loaded");
|
28943
28979
|
loadScript("https://www.youtube.com/iframe_api").catch(function(error) {
|
28944
|
-
|
28980
|
+
_this.context.logger.warn("YouTube API failed to load", error);
|
28945
28981
|
});
|
28946
28982
|
}
|
28947
28983
|
}
|
@@ -29000,7 +29036,7 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement1) {
|
|
29000
29036
|
value: function handleYTPlayerReady(event) {
|
29001
29037
|
var _this = this;
|
29002
29038
|
if (this.instance) {
|
29003
|
-
|
29039
|
+
this.context.logger.warn("Instance already found!");
|
29004
29040
|
return;
|
29005
29041
|
}
|
29006
29042
|
this.instance = event.target;
|
@@ -29025,7 +29061,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement1) {
|
|
29025
29061
|
key: "handlePlayerStateChange",
|
29026
29062
|
value: function handlePlayerStateChange(newState) {
|
29027
29063
|
var _this_media;
|
29028
|
-
console.log("player state changed", newState);
|
29029
29064
|
var seeked = ((_this_media = this.media) === null || _this_media === void 0 ? void 0 : _this_media.seeking) && [
|
29030
29065
|
1,
|
29031
29066
|
2
|
@@ -29090,7 +29125,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement1) {
|
|
29090
29125
|
id: id
|
29091
29126
|
});
|
29092
29127
|
media = elements_default.replaceElement(container, media);
|
29093
|
-
console.log("Setting media for video with id : ", media, videoId);
|
29094
29128
|
var ytPlayer = new window.YT.Player(media, {
|
29095
29129
|
videoId: videoId || void 0,
|
29096
29130
|
host: getHost(config2),
|
@@ -29323,7 +29357,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement1) {
|
|
29323
29357
|
width: width,
|
29324
29358
|
height: height
|
29325
29359
|
};
|
29326
|
-
console.log("adjusted dimensions!", adjustedDimensions);
|
29327
29360
|
if (preserveAspectRatio) {
|
29328
29361
|
adjustedDimensions = this.adjustSizeWithAspectRatio(width, height, this.aspectRatio);
|
29329
29362
|
}
|
@@ -29389,7 +29422,6 @@ var NativeMediaElement = /*#__PURE__*/ function(GenericMediaElement1) {
|
|
29389
29422
|
}
|
29390
29423
|
}
|
29391
29424
|
if (this.media && this.media.readyState >= HTMLMediaElement.HAVE_METADATA) {
|
29392
|
-
console.log("Metadata is already loaded.");
|
29393
29425
|
this.mediaIsReady();
|
29394
29426
|
}
|
29395
29427
|
}
|
@@ -29839,7 +29871,7 @@ var BrndtsAds = /*#__PURE__*/ function() {
|
|
29839
29871
|
ErrorHandler.handle(error);
|
29840
29872
|
});
|
29841
29873
|
this.context.media.on("READY", function() {
|
29842
|
-
|
29874
|
+
_this.context.logger.log("Media is Ready!");
|
29843
29875
|
_this.mediaIsReady();
|
29844
29876
|
});
|
29845
29877
|
if (this.context.media.isReady) {
|