stormcloud-video-player 0.8.50 → 0.8.51
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/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +272 -223
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +272 -223
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +1 -1
- package/lib/player/AdConfigManager.d.cts +1 -1
- package/lib/player/AdTimingService.d.cts +1 -1
- package/lib/player/HlsEngine.d.cts +1 -1
- package/lib/player/PlayerControls.d.cts +1 -1
- package/lib/player/Scte35CueManager.d.cts +1 -1
- package/lib/player/Scte35Parser.d.cts +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +249 -200
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/player/playerTypes.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +249 -200
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +249 -200
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +220 -28
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +249 -200
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as Scte35Marker, S as StormcloudVideoPlayerConfig, A as AdController } from '../types-iDjS8f_7.cjs';
|
|
2
2
|
import { AdTimingService } from './AdTimingService.cjs';
|
|
3
3
|
import { AdConfigManager } from './AdConfigManager.cjs';
|
|
4
4
|
import { Scte35CueManager } from './Scte35CueManager.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as AdBreak,
|
|
1
|
+
import { b as AdBreak, S as StormcloudVideoPlayerConfig, A as AdController } from '../types-iDjS8f_7.cjs';
|
|
2
2
|
import { PalNonceManager } from '../sdk/pal.cjs';
|
|
3
3
|
import { VastConsentSignals } from '../utils/vastMacros.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as StormcloudVideoPlayerConfig, a as Scte35Marker, A as AdController } from '../types-iDjS8f_7.cjs';
|
|
2
2
|
|
|
3
3
|
interface AdTimingCallbacks {
|
|
4
4
|
onAdStopTimerFired(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Hls from 'hls.js';
|
|
2
|
-
import {
|
|
2
|
+
import { S as StormcloudVideoPlayerConfig, a as Scte35Marker } from '../types-iDjS8f_7.cjs';
|
|
3
3
|
import { Scte35CueContext } from './playerTypes.cjs';
|
|
4
4
|
import { Scte35CueManager } from './Scte35CueManager.cjs';
|
|
5
5
|
import { AdTimingService } from './AdTimingService.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AdController } from '../types-
|
|
1
|
+
import { A as AdController } from '../types-iDjS8f_7.cjs';
|
|
2
2
|
|
|
3
3
|
declare function getAdAudioVolume(adPlayer: AdController): number;
|
|
4
4
|
declare function toggleMute(video: HTMLVideoElement, adPlayer: AdController, debug: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as Scte35Marker, I as Id3TagInfo } from '../types-iDjS8f_7.cjs';
|
|
2
2
|
|
|
3
3
|
declare function parseCueOutDuration(value: string): number | undefined;
|
|
4
4
|
declare function parseCueOutCont(value: string): {
|
|
@@ -349,6 +349,179 @@ __export(StormcloudVideoPlayer_exports, {
|
|
|
349
349
|
module.exports = __toCommonJS(StormcloudVideoPlayer_exports);
|
|
350
350
|
// src/sdk/hlsAdPlayer.ts
|
|
351
351
|
var import_hls = __toESM(require("hls.js"), 1);
|
|
352
|
+
// src/utils/browserCompat.ts
|
|
353
|
+
function getChromeVersion(ua) {
|
|
354
|
+
var match = ua.match(/Chrome\/(\d+)/);
|
|
355
|
+
return match && match[1] ? parseInt(match[1], 10) : 0;
|
|
356
|
+
}
|
|
357
|
+
function getWebKitVersion(ua) {
|
|
358
|
+
var match = ua.match(/AppleWebKit\/(\d+)/);
|
|
359
|
+
return match && match[1] ? parseInt(match[1], 10) : 0;
|
|
360
|
+
}
|
|
361
|
+
function getPlatform() {
|
|
362
|
+
var _navigator_userAgentData;
|
|
363
|
+
if ("userAgentData" in navigator && ((_navigator_userAgentData = navigator.userAgentData) === null || _navigator_userAgentData === void 0 ? void 0 : _navigator_userAgentData.platform)) {
|
|
364
|
+
return navigator.userAgentData.platform;
|
|
365
|
+
}
|
|
366
|
+
var ua = navigator.userAgent;
|
|
367
|
+
if (/Mac|iPhone|iPad|iPod/i.test(ua)) {
|
|
368
|
+
return /iPhone|iPad|iPod/i.test(ua) ? "iPhone" : "MacIntel";
|
|
369
|
+
}
|
|
370
|
+
if (/Win/i.test(ua)) {
|
|
371
|
+
return "Win32";
|
|
372
|
+
}
|
|
373
|
+
if (/Linux/i.test(ua)) {
|
|
374
|
+
return /Android/i.test(ua) ? "Linux armv8l" : "Linux x86_64";
|
|
375
|
+
}
|
|
376
|
+
if (/CrOS/i.test(ua)) {
|
|
377
|
+
return "CrOS";
|
|
378
|
+
}
|
|
379
|
+
return navigator.platform || "Unknown";
|
|
380
|
+
}
|
|
381
|
+
function detectBrowser() {
|
|
382
|
+
var ua = navigator.userAgent;
|
|
383
|
+
var platform = getPlatform();
|
|
384
|
+
var name = "Unknown";
|
|
385
|
+
var version = "0";
|
|
386
|
+
var majorVersion = 0;
|
|
387
|
+
var isSmartTV = false;
|
|
388
|
+
var isLegacyTV = false;
|
|
389
|
+
var supportsModernJS = true;
|
|
390
|
+
var webOSVersion;
|
|
391
|
+
var tizenVersion;
|
|
392
|
+
var chromeVersionNum;
|
|
393
|
+
var chromeVersion = getChromeVersion(ua);
|
|
394
|
+
var webkitVersion = getWebKitVersion(ua);
|
|
395
|
+
chromeVersionNum = chromeVersion > 0 ? chromeVersion : void 0;
|
|
396
|
+
if (/Web0S|webOS|LG Browser|LGSTB/i.test(ua)) {
|
|
397
|
+
name = "LG WebOS";
|
|
398
|
+
isSmartTV = true;
|
|
399
|
+
var match = ua.match(/Web0S[/\s]*([\d.]+)/i) || ua.match(/webOS[/\s]*([\d.]+)/i);
|
|
400
|
+
if (!match || !match[1]) {
|
|
401
|
+
match = ua.match(/webOSTV[/\s-]*([\d.]+)/i) || ua.match(/webOS\.TV[/\s-]*([\d.]+)/i);
|
|
402
|
+
}
|
|
403
|
+
if (match && match[1]) {
|
|
404
|
+
version = match[1];
|
|
405
|
+
var parts = version.split(".");
|
|
406
|
+
majorVersion = parts[0] ? parseInt(parts[0], 10) : 0;
|
|
407
|
+
webOSVersion = majorVersion;
|
|
408
|
+
} else if (chromeVersion > 0) {
|
|
409
|
+
if (chromeVersion >= 79) {
|
|
410
|
+
webOSVersion = 6;
|
|
411
|
+
version = "6.0";
|
|
412
|
+
majorVersion = 6;
|
|
413
|
+
} else if (chromeVersion >= 68) {
|
|
414
|
+
webOSVersion = 5;
|
|
415
|
+
version = "5.0";
|
|
416
|
+
majorVersion = 5;
|
|
417
|
+
} else if (chromeVersion >= 53) {
|
|
418
|
+
webOSVersion = 4;
|
|
419
|
+
version = "4.0";
|
|
420
|
+
majorVersion = 4;
|
|
421
|
+
} else if (chromeVersion >= 38) {
|
|
422
|
+
webOSVersion = 3;
|
|
423
|
+
version = "3.0";
|
|
424
|
+
majorVersion = 3;
|
|
425
|
+
} else {
|
|
426
|
+
webOSVersion = 2;
|
|
427
|
+
version = "2.0";
|
|
428
|
+
majorVersion = 2;
|
|
429
|
+
}
|
|
430
|
+
} else {
|
|
431
|
+
version = "Unknown";
|
|
432
|
+
webOSVersion = void 0;
|
|
433
|
+
}
|
|
434
|
+
isLegacyTV = webOSVersion !== void 0 && webOSVersion < 3;
|
|
435
|
+
} else if (/Tizen/i.test(ua)) {
|
|
436
|
+
name = "Samsung Tizen";
|
|
437
|
+
isSmartTV = true;
|
|
438
|
+
var match1 = ua.match(/Tizen[/\s]*([\d.]+)/i);
|
|
439
|
+
version = match1 && match1[1] ? match1[1] : "Unknown";
|
|
440
|
+
if (version !== "Unknown") {
|
|
441
|
+
var parts1 = version.split(".");
|
|
442
|
+
majorVersion = parts1[0] ? parseInt(parts1[0], 10) : 0;
|
|
443
|
+
tizenVersion = majorVersion;
|
|
444
|
+
}
|
|
445
|
+
isLegacyTV = tizenVersion !== void 0 && tizenVersion < 3;
|
|
446
|
+
} else if (/SMART-TV|SmartTV/i.test(ua)) {
|
|
447
|
+
name = "Smart TV";
|
|
448
|
+
isSmartTV = true;
|
|
449
|
+
isLegacyTV = chromeVersion > 0 && chromeVersion < 53;
|
|
450
|
+
} else if (/NetCast/i.test(ua)) {
|
|
451
|
+
name = "LG NetCast";
|
|
452
|
+
isSmartTV = true;
|
|
453
|
+
isLegacyTV = true;
|
|
454
|
+
} else if (/BRAVIA/i.test(ua)) {
|
|
455
|
+
name = "Sony BRAVIA";
|
|
456
|
+
isSmartTV = true;
|
|
457
|
+
isLegacyTV = chromeVersion > 0 && chromeVersion < 53;
|
|
458
|
+
} else {
|
|
459
|
+
if (chromeVersion > 0) {
|
|
460
|
+
name = "Chrome";
|
|
461
|
+
version = chromeVersion.toString();
|
|
462
|
+
majorVersion = chromeVersion;
|
|
463
|
+
if (chromeVersion < 50) {
|
|
464
|
+
supportsModernJS = false;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
if (webkitVersion > 0 && webkitVersion < 600) {
|
|
468
|
+
supportsModernJS = false;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (typeof Promise === "undefined" || typeof Map === "undefined" || typeof Set === "undefined") {
|
|
472
|
+
supportsModernJS = false;
|
|
473
|
+
}
|
|
474
|
+
if (typeof URLSearchParams === "undefined") {
|
|
475
|
+
supportsModernJS = false;
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
name: name,
|
|
479
|
+
version: version,
|
|
480
|
+
majorVersion: majorVersion,
|
|
481
|
+
isSmartTV: isSmartTV,
|
|
482
|
+
isLegacyTV: isLegacyTV,
|
|
483
|
+
platform: platform,
|
|
484
|
+
supportsModernJS: supportsModernJS,
|
|
485
|
+
webOSVersion: webOSVersion,
|
|
486
|
+
tizenVersion: tizenVersion,
|
|
487
|
+
chromeVersion: chromeVersionNum
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
function requiresMediaPipelineResetAfterAds() {
|
|
491
|
+
var _browser_tizenVersion;
|
|
492
|
+
var browser = detectBrowser();
|
|
493
|
+
return browser.name === "Samsung Tizen" && ((_browser_tizenVersion = browser.tizenVersion) !== null && _browser_tizenVersion !== void 0 ? _browser_tizenVersion : 0) >= 5;
|
|
494
|
+
}
|
|
495
|
+
function getBrowserConfigOverrides() {
|
|
496
|
+
var browser = detectBrowser();
|
|
497
|
+
var overrides = {};
|
|
498
|
+
if (browser.isSmartTV) {
|
|
499
|
+
overrides.allowNativeHls = true;
|
|
500
|
+
overrides.pauseContentDuringAds = true;
|
|
501
|
+
}
|
|
502
|
+
return overrides;
|
|
503
|
+
}
|
|
504
|
+
function logBrowserInfo() {
|
|
505
|
+
var debug = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
506
|
+
if (!debug) return;
|
|
507
|
+
var browser = detectBrowser();
|
|
508
|
+
console.log("[StormcloudVideoPlayer] Browser Compatibility Info:", _object_spread_props(_object_spread({
|
|
509
|
+
browser: "".concat(browser.name, " ").concat(browser.version),
|
|
510
|
+
platform: browser.platform,
|
|
511
|
+
isSmartTV: browser.isSmartTV,
|
|
512
|
+
isLegacyTV: browser.isLegacyTV,
|
|
513
|
+
supportsModernJS: browser.supportsModernJS
|
|
514
|
+
}, browser.webOSVersion !== void 0 ? {
|
|
515
|
+
webOSVersion: browser.webOSVersion
|
|
516
|
+
} : {}, browser.tizenVersion !== void 0 ? {
|
|
517
|
+
tizenVersion: browser.tizenVersion
|
|
518
|
+
} : {}, browser.chromeVersion !== void 0 ? {
|
|
519
|
+
chromeVersion: browser.chromeVersion
|
|
520
|
+
} : {}), {
|
|
521
|
+
userAgent: navigator.userAgent
|
|
522
|
+
}));
|
|
523
|
+
}
|
|
524
|
+
// src/sdk/hlsAdPlayer.ts
|
|
352
525
|
var MAX_VAST_WRAPPER_DEPTH = 5;
|
|
353
526
|
function createHlsAdPlayer(contentVideo, options) {
|
|
354
527
|
var _contentVideo_AD_VIDEO_PROP, _contentVideo_AD_CONTAINER_PROP;
|
|
@@ -381,6 +554,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
381
554
|
var lastAdProgressPosition = 0;
|
|
382
555
|
var sawDecodedVideoFrame = false;
|
|
383
556
|
var videoFrameCallbackHandle;
|
|
557
|
+
var pendingPlayPromise;
|
|
384
558
|
var trackingFired = {
|
|
385
559
|
impression: false,
|
|
386
560
|
start: false,
|
|
@@ -1184,6 +1358,60 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1184
1358
|
complete: false
|
|
1185
1359
|
};
|
|
1186
1360
|
}
|
|
1361
|
+
function isRvfcSupported(video) {
|
|
1362
|
+
return typeof video.requestVideoFrameCallback === "function";
|
|
1363
|
+
}
|
|
1364
|
+
function settlePendingPlay() {
|
|
1365
|
+
pendingPlayPromise = void 0;
|
|
1366
|
+
}
|
|
1367
|
+
function startAdPlayback(context) {
|
|
1368
|
+
if (!adVideoElement) return;
|
|
1369
|
+
var playPromise = adVideoElement.play();
|
|
1370
|
+
pendingPlayPromise = playPromise;
|
|
1371
|
+
playPromise.catch(function(error) {
|
|
1372
|
+
if (pendingPlayPromise !== playPromise) {
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
console.error("[HlsAdPlayer] Error starting ".concat(context, ":"), error);
|
|
1376
|
+
handleAdError();
|
|
1377
|
+
}).finally(function() {
|
|
1378
|
+
if (pendingPlayPromise === playPromise) {
|
|
1379
|
+
pendingPlayPromise = void 0;
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
function prepareVideoElementForNewSource() {
|
|
1384
|
+
settlePendingPlay();
|
|
1385
|
+
if (adHls) {
|
|
1386
|
+
adHls.destroy();
|
|
1387
|
+
adHls = void 0;
|
|
1388
|
+
}
|
|
1389
|
+
if (!adVideoElement) return;
|
|
1390
|
+
try {
|
|
1391
|
+
adVideoElement.pause();
|
|
1392
|
+
adVideoElement.removeAttribute("src");
|
|
1393
|
+
adVideoElement.load();
|
|
1394
|
+
} catch (error) {
|
|
1395
|
+
console.warn("[HlsAdPlayer] Error preparing ad video for new source:", error);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
function recreateAdVideoElement() {
|
|
1399
|
+
console.log("[HlsAdPlayer] Recreating ad video element (single-decoder platform)");
|
|
1400
|
+
teardownAdEventListeners();
|
|
1401
|
+
prepareVideoElementForNewSource();
|
|
1402
|
+
if (adVideoElement) {
|
|
1403
|
+
try {
|
|
1404
|
+
adVideoElement.remove();
|
|
1405
|
+
} catch (error) {
|
|
1406
|
+
console.warn("[HlsAdPlayer] Error removing ad video element:", error);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
adVideoElement = createAdVideoElement();
|
|
1410
|
+
adContainerEl === null || adContainerEl === void 0 ? void 0 : adContainerEl.appendChild(adVideoElement);
|
|
1411
|
+
contentVideo[AD_VIDEO_PROP] = adVideoElement;
|
|
1412
|
+
adVideoElement.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1413
|
+
adVideoElement.muted = originalMutedState;
|
|
1414
|
+
}
|
|
1187
1415
|
function loadCurrentAdMedia() {
|
|
1188
1416
|
if (!adVideoElement || !currentAd) {
|
|
1189
1417
|
throw new Error("No ad video element or ad to load");
|
|
@@ -1206,10 +1434,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1206
1434
|
adHls.attachMedia(adVideoElement);
|
|
1207
1435
|
adHls.on(import_hls.default.Events.MANIFEST_PARSED, function() {
|
|
1208
1436
|
console.log("[HlsAdPlayer] HLS manifest parsed, starting playback");
|
|
1209
|
-
|
|
1210
|
-
console.error("[HlsAdPlayer] Error starting ad playback:", error);
|
|
1211
|
-
handleAdError();
|
|
1212
|
-
});
|
|
1437
|
+
startAdPlayback("HLS ad playback");
|
|
1213
1438
|
});
|
|
1214
1439
|
adHls.on(import_hls.default.Events.ERROR, function(_event, data) {
|
|
1215
1440
|
console.error("[HlsAdPlayer] HLS error:", data);
|
|
@@ -1219,10 +1444,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1219
1444
|
});
|
|
1220
1445
|
} else if (isHlsAd && adVideoElement.canPlayType("application/vnd.apple.mpegurl")) {
|
|
1221
1446
|
adVideoElement.src = mediaFile.url;
|
|
1222
|
-
|
|
1223
|
-
console.error("[HlsAdPlayer] Error starting ad playback:", error);
|
|
1224
|
-
handleAdError();
|
|
1225
|
-
});
|
|
1447
|
+
startAdPlayback("native HLS ad playback");
|
|
1226
1448
|
} else if (!isHlsAd && isProgressiveMediaFile(mediaFile)) {
|
|
1227
1449
|
if (adHls) {
|
|
1228
1450
|
adHls.destroy();
|
|
@@ -1230,10 +1452,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1230
1452
|
}
|
|
1231
1453
|
adVideoElement.src = mediaFile.url;
|
|
1232
1454
|
adVideoElement.load();
|
|
1233
|
-
|
|
1234
|
-
console.error("[HlsAdPlayer] Error starting progressive ad playback:", error);
|
|
1235
|
-
handleAdError();
|
|
1236
|
-
});
|
|
1455
|
+
startAdPlayback("progressive ad playback");
|
|
1237
1456
|
} else {
|
|
1238
1457
|
throw new Error("Unsupported ad media file type: ".concat(mediaFile.type));
|
|
1239
1458
|
}
|
|
@@ -1250,6 +1469,13 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1250
1469
|
trackingFired.impression = true;
|
|
1251
1470
|
console.log("[HlsAdPlayer] Advancing to next pod ad (".concat(podIndex + 1, "/").concat(podAds.length, "): ").concat(currentAd.title, ", duration: ").concat(currentAd.duration, "s"));
|
|
1252
1471
|
}
|
|
1472
|
+
clearStallWatchdog();
|
|
1473
|
+
if (requiresMediaPipelineResetAfterAds()) {
|
|
1474
|
+
recreateAdVideoElement();
|
|
1475
|
+
setupAdEventListeners();
|
|
1476
|
+
} else {
|
|
1477
|
+
prepareVideoElementForNewSource();
|
|
1478
|
+
}
|
|
1253
1479
|
try {
|
|
1254
1480
|
loadCurrentAdMedia();
|
|
1255
1481
|
emit("pod_ad_started", {
|
|
@@ -1361,9 +1587,16 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1361
1587
|
if (decodedFrames !== void 0 && decodedFrames > 0) {
|
|
1362
1588
|
sawDecodedVideoFrame = true;
|
|
1363
1589
|
markFrameCounterReliable();
|
|
1364
|
-
} else if (
|
|
1365
|
-
|
|
1366
|
-
|
|
1590
|
+
} else if (adVideoElement.currentTime >= BLACKFRAME_MIN_PLAYBACK_S) {
|
|
1591
|
+
var timeAdvancing = adVideoElement.currentTime > lastAdProgressPosition + 0.05;
|
|
1592
|
+
if (isRvfcSupported(adVideoElement) && timeAdvancing) {
|
|
1593
|
+
handleVideoDecodeFailure();
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
if (decodedFrames === 0 && timeAdvancing && isFrameCounterReliable()) {
|
|
1597
|
+
handleVideoDecodeFailure();
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1367
1600
|
}
|
|
1368
1601
|
}
|
|
1369
1602
|
if (adVideoElement.currentTime > lastAdProgressPosition + 0.05) {
|
|
@@ -1380,19 +1613,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1380
1613
|
}, STALL_CHECK_INTERVAL_MS);
|
|
1381
1614
|
}
|
|
1382
1615
|
function releaseAdDecoder() {
|
|
1383
|
-
|
|
1384
|
-
adHls.destroy();
|
|
1385
|
-
adHls = void 0;
|
|
1386
|
-
}
|
|
1387
|
-
if (adVideoElement) {
|
|
1388
|
-
try {
|
|
1389
|
-
adVideoElement.pause();
|
|
1390
|
-
adVideoElement.removeAttribute("src");
|
|
1391
|
-
adVideoElement.load();
|
|
1392
|
-
} catch (error) {
|
|
1393
|
-
console.warn("[HlsAdPlayer] Error releasing ad decoder:", error);
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1616
|
+
prepareVideoElementForNewSource();
|
|
1396
1617
|
if (adContainerEl) {
|
|
1397
1618
|
adContainerEl.style.display = "none";
|
|
1398
1619
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -3963,178 +4184,6 @@ function fetchConsentSignals() {
|
|
|
3963
4184
|
return signals;
|
|
3964
4185
|
});
|
|
3965
4186
|
}
|
|
3966
|
-
// src/utils/browserCompat.ts
|
|
3967
|
-
function getChromeVersion(ua) {
|
|
3968
|
-
var match = ua.match(/Chrome\/(\d+)/);
|
|
3969
|
-
return match && match[1] ? parseInt(match[1], 10) : 0;
|
|
3970
|
-
}
|
|
3971
|
-
function getWebKitVersion(ua) {
|
|
3972
|
-
var match = ua.match(/AppleWebKit\/(\d+)/);
|
|
3973
|
-
return match && match[1] ? parseInt(match[1], 10) : 0;
|
|
3974
|
-
}
|
|
3975
|
-
function getPlatform() {
|
|
3976
|
-
var _navigator_userAgentData;
|
|
3977
|
-
if ("userAgentData" in navigator && ((_navigator_userAgentData = navigator.userAgentData) === null || _navigator_userAgentData === void 0 ? void 0 : _navigator_userAgentData.platform)) {
|
|
3978
|
-
return navigator.userAgentData.platform;
|
|
3979
|
-
}
|
|
3980
|
-
var ua = navigator.userAgent;
|
|
3981
|
-
if (/Mac|iPhone|iPad|iPod/i.test(ua)) {
|
|
3982
|
-
return /iPhone|iPad|iPod/i.test(ua) ? "iPhone" : "MacIntel";
|
|
3983
|
-
}
|
|
3984
|
-
if (/Win/i.test(ua)) {
|
|
3985
|
-
return "Win32";
|
|
3986
|
-
}
|
|
3987
|
-
if (/Linux/i.test(ua)) {
|
|
3988
|
-
return /Android/i.test(ua) ? "Linux armv8l" : "Linux x86_64";
|
|
3989
|
-
}
|
|
3990
|
-
if (/CrOS/i.test(ua)) {
|
|
3991
|
-
return "CrOS";
|
|
3992
|
-
}
|
|
3993
|
-
return navigator.platform || "Unknown";
|
|
3994
|
-
}
|
|
3995
|
-
function detectBrowser() {
|
|
3996
|
-
var ua = navigator.userAgent;
|
|
3997
|
-
var platform = getPlatform();
|
|
3998
|
-
var name = "Unknown";
|
|
3999
|
-
var version = "0";
|
|
4000
|
-
var majorVersion = 0;
|
|
4001
|
-
var isSmartTV = false;
|
|
4002
|
-
var isLegacyTV = false;
|
|
4003
|
-
var supportsModernJS = true;
|
|
4004
|
-
var webOSVersion;
|
|
4005
|
-
var tizenVersion;
|
|
4006
|
-
var chromeVersionNum;
|
|
4007
|
-
var chromeVersion = getChromeVersion(ua);
|
|
4008
|
-
var webkitVersion = getWebKitVersion(ua);
|
|
4009
|
-
chromeVersionNum = chromeVersion > 0 ? chromeVersion : void 0;
|
|
4010
|
-
if (/Web0S|webOS|LG Browser|LGSTB/i.test(ua)) {
|
|
4011
|
-
name = "LG WebOS";
|
|
4012
|
-
isSmartTV = true;
|
|
4013
|
-
var match = ua.match(/Web0S[/\s]*([\d.]+)/i) || ua.match(/webOS[/\s]*([\d.]+)/i);
|
|
4014
|
-
if (!match || !match[1]) {
|
|
4015
|
-
match = ua.match(/webOSTV[/\s-]*([\d.]+)/i) || ua.match(/webOS\.TV[/\s-]*([\d.]+)/i);
|
|
4016
|
-
}
|
|
4017
|
-
if (match && match[1]) {
|
|
4018
|
-
version = match[1];
|
|
4019
|
-
var parts = version.split(".");
|
|
4020
|
-
majorVersion = parts[0] ? parseInt(parts[0], 10) : 0;
|
|
4021
|
-
webOSVersion = majorVersion;
|
|
4022
|
-
} else if (chromeVersion > 0) {
|
|
4023
|
-
if (chromeVersion >= 79) {
|
|
4024
|
-
webOSVersion = 6;
|
|
4025
|
-
version = "6.0";
|
|
4026
|
-
majorVersion = 6;
|
|
4027
|
-
} else if (chromeVersion >= 68) {
|
|
4028
|
-
webOSVersion = 5;
|
|
4029
|
-
version = "5.0";
|
|
4030
|
-
majorVersion = 5;
|
|
4031
|
-
} else if (chromeVersion >= 53) {
|
|
4032
|
-
webOSVersion = 4;
|
|
4033
|
-
version = "4.0";
|
|
4034
|
-
majorVersion = 4;
|
|
4035
|
-
} else if (chromeVersion >= 38) {
|
|
4036
|
-
webOSVersion = 3;
|
|
4037
|
-
version = "3.0";
|
|
4038
|
-
majorVersion = 3;
|
|
4039
|
-
} else {
|
|
4040
|
-
webOSVersion = 2;
|
|
4041
|
-
version = "2.0";
|
|
4042
|
-
majorVersion = 2;
|
|
4043
|
-
}
|
|
4044
|
-
} else {
|
|
4045
|
-
version = "Unknown";
|
|
4046
|
-
webOSVersion = void 0;
|
|
4047
|
-
}
|
|
4048
|
-
isLegacyTV = webOSVersion !== void 0 && webOSVersion < 3;
|
|
4049
|
-
} else if (/Tizen/i.test(ua)) {
|
|
4050
|
-
name = "Samsung Tizen";
|
|
4051
|
-
isSmartTV = true;
|
|
4052
|
-
var match1 = ua.match(/Tizen[/\s]*([\d.]+)/i);
|
|
4053
|
-
version = match1 && match1[1] ? match1[1] : "Unknown";
|
|
4054
|
-
if (version !== "Unknown") {
|
|
4055
|
-
var parts1 = version.split(".");
|
|
4056
|
-
majorVersion = parts1[0] ? parseInt(parts1[0], 10) : 0;
|
|
4057
|
-
tizenVersion = majorVersion;
|
|
4058
|
-
}
|
|
4059
|
-
isLegacyTV = tizenVersion !== void 0 && tizenVersion < 3;
|
|
4060
|
-
} else if (/SMART-TV|SmartTV/i.test(ua)) {
|
|
4061
|
-
name = "Smart TV";
|
|
4062
|
-
isSmartTV = true;
|
|
4063
|
-
isLegacyTV = chromeVersion > 0 && chromeVersion < 53;
|
|
4064
|
-
} else if (/NetCast/i.test(ua)) {
|
|
4065
|
-
name = "LG NetCast";
|
|
4066
|
-
isSmartTV = true;
|
|
4067
|
-
isLegacyTV = true;
|
|
4068
|
-
} else if (/BRAVIA/i.test(ua)) {
|
|
4069
|
-
name = "Sony BRAVIA";
|
|
4070
|
-
isSmartTV = true;
|
|
4071
|
-
isLegacyTV = chromeVersion > 0 && chromeVersion < 53;
|
|
4072
|
-
} else {
|
|
4073
|
-
if (chromeVersion > 0) {
|
|
4074
|
-
name = "Chrome";
|
|
4075
|
-
version = chromeVersion.toString();
|
|
4076
|
-
majorVersion = chromeVersion;
|
|
4077
|
-
if (chromeVersion < 50) {
|
|
4078
|
-
supportsModernJS = false;
|
|
4079
|
-
}
|
|
4080
|
-
}
|
|
4081
|
-
if (webkitVersion > 0 && webkitVersion < 600) {
|
|
4082
|
-
supportsModernJS = false;
|
|
4083
|
-
}
|
|
4084
|
-
}
|
|
4085
|
-
if (typeof Promise === "undefined" || typeof Map === "undefined" || typeof Set === "undefined") {
|
|
4086
|
-
supportsModernJS = false;
|
|
4087
|
-
}
|
|
4088
|
-
if (typeof URLSearchParams === "undefined") {
|
|
4089
|
-
supportsModernJS = false;
|
|
4090
|
-
}
|
|
4091
|
-
return {
|
|
4092
|
-
name: name,
|
|
4093
|
-
version: version,
|
|
4094
|
-
majorVersion: majorVersion,
|
|
4095
|
-
isSmartTV: isSmartTV,
|
|
4096
|
-
isLegacyTV: isLegacyTV,
|
|
4097
|
-
platform: platform,
|
|
4098
|
-
supportsModernJS: supportsModernJS,
|
|
4099
|
-
webOSVersion: webOSVersion,
|
|
4100
|
-
tizenVersion: tizenVersion,
|
|
4101
|
-
chromeVersion: chromeVersionNum
|
|
4102
|
-
};
|
|
4103
|
-
}
|
|
4104
|
-
function requiresMediaPipelineResetAfterAds() {
|
|
4105
|
-
var _browser_tizenVersion;
|
|
4106
|
-
var browser = detectBrowser();
|
|
4107
|
-
return browser.name === "Samsung Tizen" && ((_browser_tizenVersion = browser.tizenVersion) !== null && _browser_tizenVersion !== void 0 ? _browser_tizenVersion : 0) >= 5;
|
|
4108
|
-
}
|
|
4109
|
-
function getBrowserConfigOverrides() {
|
|
4110
|
-
var browser = detectBrowser();
|
|
4111
|
-
var overrides = {};
|
|
4112
|
-
if (browser.isSmartTV) {
|
|
4113
|
-
overrides.allowNativeHls = true;
|
|
4114
|
-
overrides.pauseContentDuringAds = true;
|
|
4115
|
-
}
|
|
4116
|
-
return overrides;
|
|
4117
|
-
}
|
|
4118
|
-
function logBrowserInfo() {
|
|
4119
|
-
var debug = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
4120
|
-
if (!debug) return;
|
|
4121
|
-
var browser = detectBrowser();
|
|
4122
|
-
console.log("[StormcloudVideoPlayer] Browser Compatibility Info:", _object_spread_props(_object_spread({
|
|
4123
|
-
browser: "".concat(browser.name, " ").concat(browser.version),
|
|
4124
|
-
platform: browser.platform,
|
|
4125
|
-
isSmartTV: browser.isSmartTV,
|
|
4126
|
-
isLegacyTV: browser.isLegacyTV,
|
|
4127
|
-
supportsModernJS: browser.supportsModernJS
|
|
4128
|
-
}, browser.webOSVersion !== void 0 ? {
|
|
4129
|
-
webOSVersion: browser.webOSVersion
|
|
4130
|
-
} : {}, browser.tizenVersion !== void 0 ? {
|
|
4131
|
-
tizenVersion: browser.tizenVersion
|
|
4132
|
-
} : {}, browser.chromeVersion !== void 0 ? {
|
|
4133
|
-
chromeVersion: browser.chromeVersion
|
|
4134
|
-
} : {}), {
|
|
4135
|
-
userAgent: navigator.userAgent
|
|
4136
|
-
}));
|
|
4137
|
-
}
|
|
4138
4187
|
// src/player/Scte35Parser.ts
|
|
4139
4188
|
function parseCueOutDuration(value) {
|
|
4140
4189
|
var num = parseFloat(value.trim());
|