@arcware-cloud/pixelstreaming-websdk 1.3.15 → 1.3.18
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/README.md +6 -1
- package/index.cjs.js +238 -116
- package/index.esm.js +249 -126
- package/index.umd.js +238 -116
- package/package.json +1 -1
- package/types/lib/ArcwareConfig.d.ts +13 -2
- package/types/lib/ArcwarePixelStreaming.d.ts +7 -0
package/README.md
CHANGED
|
@@ -80,9 +80,14 @@ For more detailed examples and advanced usage, please refer to our documentation
|
|
|
80
80
|
|
|
81
81
|
# Changelog
|
|
82
82
|
|
|
83
|
-
### 1.3.
|
|
83
|
+
### 1.3.17
|
|
84
|
+
|
|
85
|
+
- added support for videos in white labelling
|
|
86
|
+
|
|
87
|
+
### 1.3.16
|
|
84
88
|
|
|
85
89
|
- added white labeling options for loader icon and screen
|
|
90
|
+
- options can be loaded via base64 encoded string in URL, fetched via API (configured on platform) or set as properties on the SDK
|
|
86
91
|
|
|
87
92
|
### 1.3.12
|
|
88
93
|
|
package/index.cjs.js
CHANGED
|
@@ -23360,6 +23360,7 @@ const Session_1 = __webpack_require__(2469);
|
|
|
23360
23360
|
const ArcwareSettingsSchema_1 = __webpack_require__(5602);
|
|
23361
23361
|
const whiteLabelling_1 = __webpack_require__(3545);
|
|
23362
23362
|
const ZWhiteLabel_1 = __webpack_require__(467);
|
|
23363
|
+
const EventHandler_1 = __webpack_require__(3379);
|
|
23363
23364
|
/** Default arcware signalling endpoint. */
|
|
23364
23365
|
exports.DefaultUrl = `wss://signalling-client.ragnarok.arcware.cloud`;
|
|
23365
23366
|
// The below Logger overrides can likely be removed as PSInfra 5.5 logger supports setting log verbosity
|
|
@@ -23375,6 +23376,14 @@ Logger.Error = (message: string) => {
|
|
|
23375
23376
|
console.error(message);
|
|
23376
23377
|
};*/
|
|
23377
23378
|
lib_pixelstreamingfrontend_ue5_5_1.Logger.InitLogging(2, false);
|
|
23379
|
+
function deepEqual(a, b) {
|
|
23380
|
+
try {
|
|
23381
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
23382
|
+
}
|
|
23383
|
+
catch (_a) {
|
|
23384
|
+
return false;
|
|
23385
|
+
}
|
|
23386
|
+
}
|
|
23378
23387
|
class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
|
|
23379
23388
|
/**
|
|
23380
23389
|
* Can be used to fetch projectId and shareId from the current url.
|
|
@@ -23423,7 +23432,13 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
|
|
|
23423
23432
|
if (!config.initialSettings.ss)
|
|
23424
23433
|
config.initialSettings.ss = exports.DefaultUrl;
|
|
23425
23434
|
super(config);
|
|
23426
|
-
this.VERSION = "1.3.
|
|
23435
|
+
this.VERSION = "1.3.18";
|
|
23436
|
+
this.whiteLabellingChanged = new EventHandler_1.EventHandler();
|
|
23437
|
+
this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
|
|
23438
|
+
console.log(config);
|
|
23439
|
+
if (config.envName) {
|
|
23440
|
+
this.signallingWlURL = `https://signalling-client.${config.envName}.arcware.cloud/whiteLabel/`;
|
|
23441
|
+
}
|
|
23427
23442
|
this.settings = settings;
|
|
23428
23443
|
this.session = new Session_1.Session();
|
|
23429
23444
|
this._initialSettings = config.initialSettings;
|
|
@@ -23445,58 +23460,54 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
|
|
|
23445
23460
|
this.settings.infoButton = qs.has("i") || qs.has("info");
|
|
23446
23461
|
}
|
|
23447
23462
|
}
|
|
23448
|
-
|
|
23463
|
+
getWhiteLabelling(ShareId) {
|
|
23449
23464
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23450
23465
|
const qs = new URLSearchParams(window.location.search);
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23466
|
+
// Only fetch when wl param is present and empty (as before)
|
|
23467
|
+
if (!(qs.has("wl") && qs.get("wl") === ""))
|
|
23468
|
+
return undefined;
|
|
23469
|
+
// Build final URL safely (trim trailing slashes, encode ShareId)
|
|
23470
|
+
const base = this.signallingWlURL.replace(/\/+$/, "");
|
|
23471
|
+
const requestUrl = `${base}/${encodeURIComponent(ShareId)}`;
|
|
23472
|
+
const controller = new AbortController();
|
|
23473
|
+
const timeoutId = setTimeout(() => controller.abort(), 1000);
|
|
23474
|
+
try {
|
|
23475
|
+
const res = yield fetch(requestUrl, {
|
|
23476
|
+
method: "GET",
|
|
23477
|
+
signal: controller.signal,
|
|
23478
|
+
headers: { Accept: "application/json, text/plain" },
|
|
23479
|
+
credentials: "omit"
|
|
23480
|
+
});
|
|
23481
|
+
if (!res.ok)
|
|
23482
|
+
return undefined;
|
|
23483
|
+
const text = yield res.text();
|
|
23484
|
+
if (!text || text.trim() === "")
|
|
23485
|
+
return undefined;
|
|
23486
|
+
let json;
|
|
23457
23487
|
try {
|
|
23458
|
-
|
|
23459
|
-
method: "GET",
|
|
23460
|
-
signal: controller.signal,
|
|
23461
|
-
headers: { Accept: "application/json, text/plain" },
|
|
23462
|
-
credentials: "omit"
|
|
23463
|
-
});
|
|
23464
|
-
if (!res.ok) {
|
|
23465
|
-
// Non-2xx: treat as “no white label”
|
|
23466
|
-
return undefined;
|
|
23467
|
-
}
|
|
23468
|
-
// We read as text first to detect empty-string payloads
|
|
23469
|
-
const text = yield res.text();
|
|
23470
|
-
if (!text || text.trim() === "") {
|
|
23471
|
-
return undefined;
|
|
23472
|
-
}
|
|
23473
|
-
// If there is content, try to parse JSON
|
|
23474
|
-
let json;
|
|
23475
|
-
try {
|
|
23476
|
-
json = JSON.parse(text);
|
|
23477
|
-
}
|
|
23478
|
-
catch (_a) {
|
|
23479
|
-
// Not valid JSON → ignore
|
|
23480
|
-
return undefined;
|
|
23481
|
-
}
|
|
23482
|
-
// Validate against the allowlisted schema
|
|
23483
|
-
const parsed = ZWhiteLabel_1.ZWhiteLabel.safeParse(json);
|
|
23484
|
-
if (!parsed.success) {
|
|
23485
|
-
// Optionally log parsed.error for diagnostics
|
|
23486
|
-
return undefined;
|
|
23487
|
-
}
|
|
23488
|
-
return parsed.data;
|
|
23488
|
+
json = JSON.parse(text);
|
|
23489
23489
|
}
|
|
23490
|
-
catch (
|
|
23491
|
-
// Abort or network error → treat as “no white label”
|
|
23492
|
-
// if (err?.name !== "AbortError") console.warn("getWhiteLabelling failed", err);
|
|
23490
|
+
catch (_a) {
|
|
23493
23491
|
return undefined;
|
|
23494
23492
|
}
|
|
23495
|
-
|
|
23496
|
-
|
|
23493
|
+
const parsed = ZWhiteLabel_1.ZWhiteLabel.safeParse(json);
|
|
23494
|
+
if (!parsed.success)
|
|
23495
|
+
return undefined;
|
|
23496
|
+
// Only apply & emit if it actually changed
|
|
23497
|
+
const prev = this.settings.whiteLabelling;
|
|
23498
|
+
const next = parsed.data;
|
|
23499
|
+
if (!deepEqual(prev, next)) {
|
|
23500
|
+
this.settings.whiteLabelling = next;
|
|
23501
|
+
EventHandler_1.EventHandler.Emit(this.whiteLabellingChanged, next);
|
|
23497
23502
|
}
|
|
23503
|
+
return parsed.data;
|
|
23504
|
+
}
|
|
23505
|
+
catch (_b) {
|
|
23506
|
+
return undefined;
|
|
23507
|
+
}
|
|
23508
|
+
finally {
|
|
23509
|
+
clearTimeout(timeoutId);
|
|
23498
23510
|
}
|
|
23499
|
-
return undefined;
|
|
23500
23511
|
});
|
|
23501
23512
|
}
|
|
23502
23513
|
/** Setup connection string. */
|
|
@@ -23573,6 +23584,7 @@ let globalApplication = null;
|
|
|
23573
23584
|
let previousShareId = null;
|
|
23574
23585
|
let previousProjectId = null;
|
|
23575
23586
|
function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false) {
|
|
23587
|
+
var _a;
|
|
23576
23588
|
if (shareId && !shareId.startsWith("share-"))
|
|
23577
23589
|
throw new Error(`Unexpected shareId-format: '${shareId}'.`);
|
|
23578
23590
|
if (shareId && previousShareId !== shareId) {
|
|
@@ -23612,7 +23624,8 @@ function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false
|
|
|
23612
23624
|
splashScreenMode: undefined,
|
|
23613
23625
|
splashScreenPosition: undefined,
|
|
23614
23626
|
splashScreenBgColor: undefined
|
|
23615
|
-
} }, configuration === null || configuration === void 0 ? void 0 : configuration.settings)
|
|
23627
|
+
} }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
|
|
23628
|
+
envName: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.envName) !== null && _a !== void 0 ? _a : undefined
|
|
23616
23629
|
});
|
|
23617
23630
|
const PixelStreaming = new ArcwarePixelStreaming_1.ArcwarePixelStreaming(Config);
|
|
23618
23631
|
const Application = new ArcwareApplication_1.ArcwareApplication({ stream: PixelStreaming });
|
|
@@ -23780,6 +23793,32 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
23780
23793
|
});
|
|
23781
23794
|
// Set override config.
|
|
23782
23795
|
this.config = config;
|
|
23796
|
+
// Re-apply branding whenever config's WL changes
|
|
23797
|
+
this.config.whiteLabellingChanged.add(() => {
|
|
23798
|
+
try {
|
|
23799
|
+
this.applyBrandingFromSettings();
|
|
23800
|
+
}
|
|
23801
|
+
catch (_a) { }
|
|
23802
|
+
});
|
|
23803
|
+
// Kick off WL fetch once (if we have a shareId); on success it will emit and re-apply
|
|
23804
|
+
(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23805
|
+
try {
|
|
23806
|
+
const sid = this.config.settings.shareId;
|
|
23807
|
+
if (sid) {
|
|
23808
|
+
yield this.config.getWhiteLabelling(sid); // will emit if it changes
|
|
23809
|
+
}
|
|
23810
|
+
}
|
|
23811
|
+
catch (_d) {
|
|
23812
|
+
// ignore
|
|
23813
|
+
}
|
|
23814
|
+
finally {
|
|
23815
|
+
// Make sure we paint with whatever we have initially
|
|
23816
|
+
try {
|
|
23817
|
+
this.applyBrandingFromSettings();
|
|
23818
|
+
}
|
|
23819
|
+
catch (_e) { }
|
|
23820
|
+
}
|
|
23821
|
+
}))();
|
|
23783
23822
|
this.loveLettersList = [];
|
|
23784
23823
|
this.microphoneOverlay = new MicrophoneOverlay_1.MicrophoneOverlay(this);
|
|
23785
23824
|
this.diagnosticsCollector = new DiagnosticsCollector_1.DiagnosticsCollector({
|
|
@@ -23961,7 +24000,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
23961
24000
|
});
|
|
23962
24001
|
}
|
|
23963
24002
|
}
|
|
23964
|
-
this.applyBrandingFromSettings();
|
|
24003
|
+
//this.applyBrandingFromSettings();
|
|
23965
24004
|
this.handleMouseLock();
|
|
23966
24005
|
this.injectCustomUI();
|
|
23967
24006
|
}
|
|
@@ -24012,34 +24051,38 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24012
24051
|
}
|
|
24013
24052
|
}
|
|
24014
24053
|
runPostInitSideEffectsOnce() {
|
|
24015
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
24054
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
24016
24055
|
if (this._postInitSideEffectsDone)
|
|
24017
24056
|
return;
|
|
24018
24057
|
this._postInitSideEffectsDone = true;
|
|
24019
24058
|
try {
|
|
24020
24059
|
(_a = this.handleMouseLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
24021
24060
|
}
|
|
24022
|
-
catch (
|
|
24061
|
+
catch (_j) { }
|
|
24023
24062
|
try {
|
|
24024
24063
|
(_b = this.handleResolutionChange) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
24025
24064
|
}
|
|
24026
|
-
catch (
|
|
24065
|
+
catch (_k) { }
|
|
24027
24066
|
try {
|
|
24028
24067
|
(_c = this.handleRemoveLoveLetters) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
24029
24068
|
}
|
|
24030
|
-
catch (
|
|
24069
|
+
catch (_l) { }
|
|
24031
24070
|
try {
|
|
24032
24071
|
(_e = (_d = this.microphoneOverlay) === null || _d === void 0 ? void 0 : _d.toggleVisibility) === null || _e === void 0 ? void 0 : _e.call(_d, false);
|
|
24033
24072
|
}
|
|
24034
|
-
catch (
|
|
24073
|
+
catch (_m) { }
|
|
24035
24074
|
try {
|
|
24036
24075
|
(_f = this.applyResolutionIfPlaying) === null || _f === void 0 ? void 0 : _f.call(this);
|
|
24037
24076
|
}
|
|
24038
|
-
catch (
|
|
24077
|
+
catch (_o) { }
|
|
24039
24078
|
try {
|
|
24040
24079
|
(_g = this.removeXRIconIfDisabled) === null || _g === void 0 ? void 0 : _g.call(this);
|
|
24041
24080
|
}
|
|
24042
|
-
catch (
|
|
24081
|
+
catch (_p) { }
|
|
24082
|
+
try {
|
|
24083
|
+
(_h = this.hideSplashVideo) === null || _h === void 0 ? void 0 : _h.call(this);
|
|
24084
|
+
}
|
|
24085
|
+
catch (_q) { } // ← hide splash video when streaming
|
|
24043
24086
|
}
|
|
24044
24087
|
onVideoInitialized() {
|
|
24045
24088
|
if (this.videoInitializedSent) {
|
|
@@ -24303,8 +24346,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24303
24346
|
(_a = logoLoader.setHostElement) === null || _a === void 0 ? void 0 : _a.call(logoLoader, loaderRoot);
|
|
24304
24347
|
loveLettersContainer.appendChild(lettersBlock);
|
|
24305
24348
|
lettersBlock.appendChild(lettersWrapper);
|
|
24306
|
-
// apply current (local) settings immediately
|
|
24307
|
-
this.applyBrandingFromSettings();
|
|
24308
24349
|
}
|
|
24309
24350
|
}
|
|
24310
24351
|
pushLetter(letter) {
|
|
@@ -24421,7 +24462,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24421
24462
|
applyBrandingFromSettings() {
|
|
24422
24463
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
24423
24464
|
const cfg = ((_b = (_a = this === null || this === void 0 ? void 0 : this.config) === null || _a === void 0 ? void 0 : _a.settings.whiteLabelling) !== null && _b !== void 0 ? _b : {});
|
|
24424
|
-
// Loader
|
|
24465
|
+
// Loader
|
|
24425
24466
|
try {
|
|
24426
24467
|
if (this.logoLoader) {
|
|
24427
24468
|
(_d = (_c = this.logoLoader).setImage) === null || _d === void 0 ? void 0 : _d.call(_c, cfg.loadingIconUrl);
|
|
@@ -24429,68 +24470,149 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24429
24470
|
}
|
|
24430
24471
|
}
|
|
24431
24472
|
catch (_q) { }
|
|
24432
|
-
|
|
24433
|
-
|
|
24434
|
-
|
|
24435
|
-
|
|
24436
|
-
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
|
|
24440
|
-
|
|
24441
|
-
|
|
24442
|
-
|
|
24443
|
-
|
|
24444
|
-
|
|
24445
|
-
|
|
24446
|
-
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24453
|
-
|
|
24454
|
-
|
|
24455
|
-
|
|
24456
|
-
|
|
24457
|
-
|
|
24458
|
-
|
|
24459
|
-
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
24464
|
-
|
|
24465
|
-
|
|
24466
|
-
|
|
24467
|
-
|
|
24468
|
-
|
|
24469
|
-
|
|
24470
|
-
|
|
24471
|
-
|
|
24472
|
-
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
24476
|
-
|
|
24477
|
-
|
|
24478
|
-
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
|
|
24483
|
-
|
|
24473
|
+
const host = (_m = (_g = this.loveLettersContainer) !== null && _g !== void 0 ? _g : (_l = (_k = (_j = (_h = this.webRtcController) === null || _h === void 0 ? void 0 : _h.videoPlayer) === null || _j === void 0 ? void 0 : _j.getVideoParentElement) === null || _k === void 0 ? void 0 : _k.call(_j)) === null || _l === void 0 ? void 0 : _l.parentElement) !== null && _m !== void 0 ? _m : null;
|
|
24474
|
+
if (!host)
|
|
24475
|
+
return;
|
|
24476
|
+
const s = host.style;
|
|
24477
|
+
// Reset background longhands (never use shorthand to avoid nuking color)
|
|
24478
|
+
s.removeProperty("background-image");
|
|
24479
|
+
s.removeProperty("background-size");
|
|
24480
|
+
s.removeProperty("background-repeat");
|
|
24481
|
+
s.removeProperty("background-position");
|
|
24482
|
+
s.removeProperty("background-color");
|
|
24483
|
+
s.setProperty("background", "initial");
|
|
24484
|
+
host.classList.remove("aw-splash");
|
|
24485
|
+
// Clear any previous splash video unless re-used below
|
|
24486
|
+
this.destroySplashVideo();
|
|
24487
|
+
const haveUrl = !!cfg.splashScreenUrl;
|
|
24488
|
+
const haveColor = !!cfg.splashScreenBgColor;
|
|
24489
|
+
// Nothing to apply?
|
|
24490
|
+
if (!haveUrl && !haveColor)
|
|
24491
|
+
return;
|
|
24492
|
+
host.classList.add("aw-splash");
|
|
24493
|
+
// Always apply color (visible behind image/video / letterboxing)
|
|
24494
|
+
const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
|
|
24495
|
+
s.setProperty("background-color", bgColor, "important");
|
|
24496
|
+
// Decide: video or image from the same URL
|
|
24497
|
+
const isVideo = this.isVideoUrl(cfg.splashScreenUrl);
|
|
24498
|
+
if (haveUrl && isVideo) {
|
|
24499
|
+
// map splashScreenMode to object-fit
|
|
24500
|
+
const fit = cfg.splashScreenMode === "cover" ? "cover" : cfg.splashScreenMode === "stretch" ? "fill" : "contain";
|
|
24501
|
+
const pos = cfg.splashScreenPosition || "center center";
|
|
24502
|
+
this.upsertSplashVideo(cfg.splashScreenUrl, { fit, position: pos, bgColor });
|
|
24503
|
+
// keep background image cleared to avoid layering
|
|
24504
|
+
s.backgroundImage = "none";
|
|
24505
|
+
s.backgroundRepeat = "no-repeat";
|
|
24506
|
+
s.backgroundPosition = "center center";
|
|
24507
|
+
s.backgroundSize = "auto";
|
|
24508
|
+
}
|
|
24509
|
+
else if (haveUrl) {
|
|
24510
|
+
// IMAGE path
|
|
24511
|
+
const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
|
|
24512
|
+
switch (mode) {
|
|
24513
|
+
case "contain":
|
|
24514
|
+
s.backgroundSize = "contain";
|
|
24515
|
+
s.backgroundRepeat = "no-repeat";
|
|
24516
|
+
break;
|
|
24517
|
+
case "cover":
|
|
24518
|
+
s.backgroundSize = "cover";
|
|
24519
|
+
s.backgroundRepeat = "no-repeat";
|
|
24520
|
+
break;
|
|
24521
|
+
case "stretch":
|
|
24522
|
+
s.backgroundSize = "100% 100%";
|
|
24523
|
+
s.backgroundRepeat = "no-repeat";
|
|
24524
|
+
break;
|
|
24525
|
+
case "repeat":
|
|
24526
|
+
s.backgroundSize = "auto";
|
|
24527
|
+
s.backgroundRepeat = "repeat";
|
|
24528
|
+
break;
|
|
24484
24529
|
}
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
|
|
24530
|
+
s.backgroundPosition = cfg.splashScreenPosition || "center center";
|
|
24531
|
+
s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
|
|
24532
|
+
}
|
|
24533
|
+
else {
|
|
24534
|
+
// COLOR only
|
|
24535
|
+
s.backgroundImage = "none";
|
|
24536
|
+
s.backgroundRepeat = "no-repeat";
|
|
24537
|
+
s.backgroundPosition = "center center";
|
|
24538
|
+
s.backgroundSize = "auto";
|
|
24539
|
+
}
|
|
24540
|
+
}
|
|
24541
|
+
ensureSplashHost() {
|
|
24542
|
+
var _a, _b, _c, _d, _e, _f;
|
|
24543
|
+
const el = (_f = (_a = this.loveLettersContainer) !== null && _a !== void 0 ? _a : (_e = (_d = (_c = (_b = this.webRtcController) === null || _b === void 0 ? void 0 : _b.videoPlayer) === null || _c === void 0 ? void 0 : _c.getVideoParentElement) === null || _d === void 0 ? void 0 : _d.call(_c)) === null || _e === void 0 ? void 0 : _e.parentElement) !== null && _f !== void 0 ? _f : null;
|
|
24544
|
+
if (!el)
|
|
24545
|
+
return null;
|
|
24546
|
+
this._splashHost = el;
|
|
24547
|
+
// ensure stacking works
|
|
24548
|
+
if (getComputedStyle(this._splashHost).position === "static")
|
|
24549
|
+
this._splashHost.style.position = "relative";
|
|
24550
|
+
return this._splashHost;
|
|
24551
|
+
}
|
|
24552
|
+
destroySplashVideo() {
|
|
24553
|
+
if (this._splashVideo) {
|
|
24554
|
+
try {
|
|
24555
|
+
this._splashVideo.pause();
|
|
24556
|
+
}
|
|
24557
|
+
catch (_a) { }
|
|
24558
|
+
try {
|
|
24559
|
+
this._splashVideo.remove();
|
|
24491
24560
|
}
|
|
24561
|
+
catch (_b) { }
|
|
24562
|
+
this._splashVideo = undefined;
|
|
24492
24563
|
}
|
|
24493
|
-
|
|
24564
|
+
}
|
|
24565
|
+
upsertSplashVideo(url, opts) {
|
|
24566
|
+
var _a, _b;
|
|
24567
|
+
const host = this.ensureSplashHost();
|
|
24568
|
+
if (!host)
|
|
24569
|
+
return;
|
|
24570
|
+
let v = this._splashVideo;
|
|
24571
|
+
if (!v) {
|
|
24572
|
+
v = document.createElement("video");
|
|
24573
|
+
v.playsInline = true;
|
|
24574
|
+
v.setAttribute("webkit-playsinline", "true");
|
|
24575
|
+
v.muted = true; // for autoplay
|
|
24576
|
+
v.autoplay = true;
|
|
24577
|
+
v.loop = true;
|
|
24578
|
+
v.style.position = "absolute";
|
|
24579
|
+
v.style.inset = "0";
|
|
24580
|
+
v.style.width = "100%";
|
|
24581
|
+
v.style.height = "100%";
|
|
24582
|
+
v.style.objectFit = "contain";
|
|
24583
|
+
v.style.objectPosition = "center center";
|
|
24584
|
+
v.style.pointerEvents = "none";
|
|
24585
|
+
v.style.zIndex = "0";
|
|
24586
|
+
host.appendChild(v);
|
|
24587
|
+
this._splashVideo = v;
|
|
24588
|
+
}
|
|
24589
|
+
v.src = url;
|
|
24590
|
+
v.style.objectFit = (_a = opts.fit) !== null && _a !== void 0 ? _a : "contain";
|
|
24591
|
+
v.style.objectPosition = (_b = opts.position) !== null && _b !== void 0 ? _b : "center center";
|
|
24592
|
+
if (opts.bgColor)
|
|
24593
|
+
host.style.setProperty("background-color", opts.bgColor, "important");
|
|
24594
|
+
v.style.display = "";
|
|
24595
|
+
v.play().catch(() => { });
|
|
24596
|
+
}
|
|
24597
|
+
hideSplashVideo() {
|
|
24598
|
+
if (this._splashVideo) {
|
|
24599
|
+
try {
|
|
24600
|
+
this._splashVideo.pause();
|
|
24601
|
+
}
|
|
24602
|
+
catch (_a) { }
|
|
24603
|
+
this._splashVideo.style.display = "none";
|
|
24604
|
+
}
|
|
24605
|
+
}
|
|
24606
|
+
isVideoUrl(u) {
|
|
24607
|
+
if (!u)
|
|
24608
|
+
return false;
|
|
24609
|
+
const s = u.split("?")[0].toLowerCase();
|
|
24610
|
+
return (s.startsWith("blob:") ||
|
|
24611
|
+
s.endsWith(".mp4") ||
|
|
24612
|
+
s.endsWith(".webm") ||
|
|
24613
|
+
s.endsWith(".ogg") ||
|
|
24614
|
+
s.endsWith(".ogv") ||
|
|
24615
|
+
s.endsWith(".m3u8"));
|
|
24494
24616
|
}
|
|
24495
24617
|
}
|
|
24496
24618
|
exports.ArcwarePixelStreaming = ArcwarePixelStreaming;
|