stormcloud-video-player 0.7.4 → 0.7.5
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 +296 -6
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +25 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +297 -7
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +73 -4
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +20 -1
- package/lib/players/HlsPlayer.cjs +73 -4
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +73 -4
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.cjs +4 -4
- package/lib/sdk/adstormPlayer.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.d.cts +1 -1
- package/lib/types-BII_CKbE.d.cts +105 -0
- package/lib/{types-vCa10HuQ.d.cts → types-ClqQZM3U.d.cts} +7 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +296 -6
- 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
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
interface StormcloudVideoPlayerConfig {
|
|
2
|
+
videoElement: HTMLVideoElement;
|
|
3
|
+
src: string;
|
|
4
|
+
autoplay?: boolean;
|
|
5
|
+
muted?: boolean;
|
|
6
|
+
allowNativeHls?: boolean;
|
|
7
|
+
lowLatencyMode?: boolean;
|
|
8
|
+
driftToleranceMs?: number;
|
|
9
|
+
immediateManifestAds?: boolean;
|
|
10
|
+
debugAdTiming?: boolean;
|
|
11
|
+
adFailsafeTimeoutMs?: number;
|
|
12
|
+
adBreakCheckIntervalMs?: number;
|
|
13
|
+
maxAdBreakExtensionMs?: number;
|
|
14
|
+
showCustomControls?: boolean;
|
|
15
|
+
hideLoadingIndicator?: boolean;
|
|
16
|
+
onVolumeToggle?: () => void;
|
|
17
|
+
onFullscreenToggle?: () => void;
|
|
18
|
+
onControlClick?: () => void;
|
|
19
|
+
licenseKey?: string;
|
|
20
|
+
minSegmentsBeforePlay?: number;
|
|
21
|
+
disableAds?: boolean;
|
|
22
|
+
disableFiller?: boolean;
|
|
23
|
+
adTransitionGapMs?: number;
|
|
24
|
+
singlePipelineMode?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface Scte35Marker {
|
|
27
|
+
type: "start" | "end" | "progress";
|
|
28
|
+
ptsSeconds?: number;
|
|
29
|
+
durationSeconds?: number;
|
|
30
|
+
raw?: unknown;
|
|
31
|
+
}
|
|
32
|
+
interface AdController {
|
|
33
|
+
initialize: () => void;
|
|
34
|
+
requestAds: () => Promise<void>;
|
|
35
|
+
play: () => Promise<void>;
|
|
36
|
+
pause: () => void;
|
|
37
|
+
resume: () => void;
|
|
38
|
+
stop: () => Promise<void>;
|
|
39
|
+
destroy: () => void;
|
|
40
|
+
isAdPlaying: () => boolean;
|
|
41
|
+
resize: (width: number, height: number) => void;
|
|
42
|
+
on: (event: string, listener: (payload?: any) => void) => void;
|
|
43
|
+
off: (event: string, listener: (payload?: any) => void) => void;
|
|
44
|
+
updateOriginalMutedState: (muted: boolean, volume?: number) => void;
|
|
45
|
+
getOriginalMutedState: () => boolean;
|
|
46
|
+
getOriginalVolume: () => number;
|
|
47
|
+
setAdVolume: (volume: number) => void;
|
|
48
|
+
getAdVolume: () => number;
|
|
49
|
+
showPlaceholder: () => void;
|
|
50
|
+
hidePlaceholder: () => void;
|
|
51
|
+
}
|
|
52
|
+
interface ClientInfo {
|
|
53
|
+
brand: string;
|
|
54
|
+
os: string;
|
|
55
|
+
model: string;
|
|
56
|
+
deviceType: "tv" | "mobile" | "tablet" | "desktop";
|
|
57
|
+
isSmartTV: boolean;
|
|
58
|
+
isAndroid: boolean;
|
|
59
|
+
isWebView: boolean;
|
|
60
|
+
isWebApp: boolean;
|
|
61
|
+
domain: string;
|
|
62
|
+
origin: string;
|
|
63
|
+
path: string;
|
|
64
|
+
userAgent: string;
|
|
65
|
+
vendor: string;
|
|
66
|
+
platform: string;
|
|
67
|
+
screen: {
|
|
68
|
+
width?: number;
|
|
69
|
+
height?: number;
|
|
70
|
+
availWidth?: number;
|
|
71
|
+
availHeight?: number;
|
|
72
|
+
orientation?: string;
|
|
73
|
+
pixelDepth?: number;
|
|
74
|
+
};
|
|
75
|
+
hardwareConcurrency: number;
|
|
76
|
+
deviceMemory: number | null;
|
|
77
|
+
maxTouchPoints: number;
|
|
78
|
+
language: string;
|
|
79
|
+
languages: string;
|
|
80
|
+
cookieEnabled: boolean;
|
|
81
|
+
doNotTrack: string;
|
|
82
|
+
referrer: string;
|
|
83
|
+
visibilityState: string;
|
|
84
|
+
}
|
|
85
|
+
interface AdDetectInfo {
|
|
86
|
+
source: "scte35";
|
|
87
|
+
durationSeconds?: number;
|
|
88
|
+
ptsSeconds?: number;
|
|
89
|
+
detectedAtFragmentSn?: number;
|
|
90
|
+
timestamp: string;
|
|
91
|
+
}
|
|
92
|
+
interface AdLoadedInfo {
|
|
93
|
+
source: "vast" | "ima" | "hls";
|
|
94
|
+
vastUrl?: string;
|
|
95
|
+
durationSeconds?: number;
|
|
96
|
+
timestamp: string;
|
|
97
|
+
}
|
|
98
|
+
interface AdImpressionInfo {
|
|
99
|
+
source: "vast" | "ima" | "hls";
|
|
100
|
+
adIndex: number;
|
|
101
|
+
durationSeconds?: number;
|
|
102
|
+
timestamp: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type { AdDetectInfo as A, ClientInfo as C, StormcloudVideoPlayerConfig as S, Scte35Marker as a, AdImpressionInfo as b, AdLoadedInfo as c, AdController as d };
|
|
@@ -23,6 +23,12 @@ interface StormcloudVideoPlayerConfig {
|
|
|
23
23
|
adTransitionGapMs?: number;
|
|
24
24
|
singlePipelineMode?: boolean;
|
|
25
25
|
}
|
|
26
|
+
interface Scte35Marker {
|
|
27
|
+
type: "start" | "end" | "progress";
|
|
28
|
+
ptsSeconds?: number;
|
|
29
|
+
durationSeconds?: number;
|
|
30
|
+
raw?: unknown;
|
|
31
|
+
}
|
|
26
32
|
interface AdController {
|
|
27
33
|
initialize: () => void;
|
|
28
34
|
requestAds: () => Promise<void>;
|
|
@@ -96,4 +102,4 @@ interface AdImpressionInfo {
|
|
|
96
102
|
timestamp: string;
|
|
97
103
|
}
|
|
98
104
|
|
|
99
|
-
export type { AdController as A, ClientInfo as C, StormcloudVideoPlayerConfig as S,
|
|
105
|
+
export type { AdController as A, ClientInfo as C, StormcloudVideoPlayerConfig as S, Scte35Marker as a, AdDetectInfo as b, AdImpressionInfo as c, AdLoadedInfo as d };
|
|
@@ -529,8 +529,8 @@ var UNSUPPORTED_VIDEO_EXTENSIONS = [
|
|
|
529
529
|
var REQUEST_TIMEOUT_MS = 5e3;
|
|
530
530
|
var REQUEST_MAX_RETRIES = 3;
|
|
531
531
|
var REQUEST_RETRY_BACKOFF_MS = 1500;
|
|
532
|
-
var AD_LAYER_Z_INDEX = "
|
|
533
|
-
var COUNTDOWN_Z_INDEX = "
|
|
532
|
+
var AD_LAYER_Z_INDEX = "30";
|
|
533
|
+
var COUNTDOWN_Z_INDEX = "31";
|
|
534
534
|
var STALL_TIMEOUT_MS = 8e3;
|
|
535
535
|
function getFileExtension(url) {
|
|
536
536
|
try {
|
|
@@ -1234,7 +1234,7 @@ function createAdStormPlayer(contentVideo, options) {
|
|
|
1234
1234
|
container.style.isolation = "isolate";
|
|
1235
1235
|
var countdown = document.createElement("div");
|
|
1236
1236
|
countdown.style.position = "absolute";
|
|
1237
|
-
countdown.style.
|
|
1237
|
+
countdown.style.left = "12px";
|
|
1238
1238
|
countdown.style.top = "12px";
|
|
1239
1239
|
countdown.style.padding = "4px 8px";
|
|
1240
1240
|
countdown.style.borderRadius = "4px";
|
|
@@ -1685,7 +1685,7 @@ function createAdStormPlayer(contentVideo, options) {
|
|
|
1685
1685
|
container.style.isolation = "isolate";
|
|
1686
1686
|
var countdown = document.createElement("div");
|
|
1687
1687
|
countdown.style.position = "absolute";
|
|
1688
|
-
countdown.style.
|
|
1688
|
+
countdown.style.left = "12px";
|
|
1689
1689
|
countdown.style.top = "12px";
|
|
1690
1690
|
countdown.style.padding = "4px 8px";
|
|
1691
1691
|
countdown.style.borderRadius = "4px";
|
|
@@ -2781,6 +2781,7 @@ function getBrowserConfigOverrides() {
|
|
|
2781
2781
|
return overrides;
|
|
2782
2782
|
}
|
|
2783
2783
|
// src/player/StormcloudVideoPlayer.ts
|
|
2784
|
+
var DEBUG_HISTORY_LIMIT = 120;
|
|
2784
2785
|
var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
2785
2786
|
function StormcloudVideoPlayer(config) {
|
|
2786
2787
|
_class_call_check(this, StormcloudVideoPlayer);
|
|
@@ -2823,6 +2824,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2823
2824
|
this.adRequestMaxRetries = 3;
|
|
2824
2825
|
this.adRequestRetryBackoffMs = 1500;
|
|
2825
2826
|
this.preloadedTokens = [];
|
|
2827
|
+
this.debugLogEntries = [];
|
|
2828
|
+
this.scteMarkerHistory = [];
|
|
2826
2829
|
initializePolyfills();
|
|
2827
2830
|
var browserOverrides = getBrowserConfigOverrides();
|
|
2828
2831
|
this.config = _object_spread({}, browserOverrides, config);
|
|
@@ -3329,6 +3332,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3329
3332
|
errorMessage += ". Caused by: ".concat(causeMessage);
|
|
3330
3333
|
}
|
|
3331
3334
|
}
|
|
3335
|
+
_this.pushDebugLog("error", "ad", errorMessage, _object_spread({}, errorPayload ? {
|
|
3336
|
+
payload: errorPayload
|
|
3337
|
+
} : {}));
|
|
3332
3338
|
console.error("[AD-ERROR]", errorMessage, errorPayload || "");
|
|
3333
3339
|
_this.adLayer.stop().catch(function() {});
|
|
3334
3340
|
_this.handleAdFailure();
|
|
@@ -3770,6 +3776,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3770
3776
|
value: function onScte35Marker(marker) {
|
|
3771
3777
|
var _this = this;
|
|
3772
3778
|
if (this.config.disableAds) return;
|
|
3779
|
+
this.pushScteMarker(marker);
|
|
3780
|
+
this.pushDebugLog("info", "scte35", "SCTE-35 marker detected", {
|
|
3781
|
+
type: marker.type,
|
|
3782
|
+
ptsSeconds: marker.ptsSeconds,
|
|
3783
|
+
durationSeconds: marker.durationSeconds,
|
|
3784
|
+
currentTime: this.video.currentTime
|
|
3785
|
+
});
|
|
3773
3786
|
if (this.config.debugAdTiming) {
|
|
3774
3787
|
console.log("[StormcloudVideoPlayer] SCTE-35 marker detected:", {
|
|
3775
3788
|
type: marker.type,
|
|
@@ -5638,6 +5651,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5638
5651
|
if (!this.config.debugAdTiming) {
|
|
5639
5652
|
return;
|
|
5640
5653
|
}
|
|
5654
|
+
this.pushDebugLog("info", "ad-state", event, extra);
|
|
5641
5655
|
console.log("[StormcloudVideoPlayer][AdState]", _object_spread({
|
|
5642
5656
|
event: event,
|
|
5643
5657
|
timestamp: /* @__PURE__ */ new Date().toISOString(),
|
|
@@ -5657,6 +5671,59 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5657
5671
|
return Math.max(0, this.expectedAdBreakDurationMs - elapsed);
|
|
5658
5672
|
}
|
|
5659
5673
|
},
|
|
5674
|
+
{
|
|
5675
|
+
key: "pushScteMarker",
|
|
5676
|
+
value: function pushScteMarker(marker) {
|
|
5677
|
+
if (!this.config.debugAdTiming) return;
|
|
5678
|
+
this.scteMarkerHistory.push({
|
|
5679
|
+
timestampMs: Date.now(),
|
|
5680
|
+
marker: marker
|
|
5681
|
+
});
|
|
5682
|
+
if (this.scteMarkerHistory.length > DEBUG_HISTORY_LIMIT) {
|
|
5683
|
+
this.scteMarkerHistory = this.scteMarkerHistory.slice(-DEBUG_HISTORY_LIMIT);
|
|
5684
|
+
}
|
|
5685
|
+
}
|
|
5686
|
+
},
|
|
5687
|
+
{
|
|
5688
|
+
key: "pushDebugLog",
|
|
5689
|
+
value: function pushDebugLog(level, category, message, details) {
|
|
5690
|
+
if (!this.config.debugAdTiming) return;
|
|
5691
|
+
this.debugLogEntries.push(_object_spread({
|
|
5692
|
+
timestampMs: Date.now(),
|
|
5693
|
+
level: level,
|
|
5694
|
+
category: category,
|
|
5695
|
+
message: message
|
|
5696
|
+
}, details ? {
|
|
5697
|
+
details: details
|
|
5698
|
+
} : {}));
|
|
5699
|
+
if (this.debugLogEntries.length > DEBUG_HISTORY_LIMIT) {
|
|
5700
|
+
this.debugLogEntries = this.debugLogEntries.slice(-DEBUG_HISTORY_LIMIT);
|
|
5701
|
+
}
|
|
5702
|
+
}
|
|
5703
|
+
},
|
|
5704
|
+
{
|
|
5705
|
+
key: "getRecentScteMarkers",
|
|
5706
|
+
value: function getRecentScteMarkers() {
|
|
5707
|
+
return this.scteMarkerHistory.map(function(entry) {
|
|
5708
|
+
return _object_spread({
|
|
5709
|
+
timestampMs: entry.timestampMs,
|
|
5710
|
+
type: entry.marker.type
|
|
5711
|
+
}, entry.marker.ptsSeconds !== void 0 ? {
|
|
5712
|
+
ptsSeconds: entry.marker.ptsSeconds
|
|
5713
|
+
} : {}, entry.marker.durationSeconds !== void 0 ? {
|
|
5714
|
+
durationSeconds: entry.marker.durationSeconds
|
|
5715
|
+
} : {}, entry.marker.raw !== void 0 ? {
|
|
5716
|
+
raw: entry.marker.raw
|
|
5717
|
+
} : {});
|
|
5718
|
+
});
|
|
5719
|
+
}
|
|
5720
|
+
},
|
|
5721
|
+
{
|
|
5722
|
+
key: "getDebugLogs",
|
|
5723
|
+
value: function getDebugLogs() {
|
|
5724
|
+
return this.debugLogEntries.slice();
|
|
5725
|
+
}
|
|
5726
|
+
},
|
|
5660
5727
|
{
|
|
5661
5728
|
key: "toggleMute",
|
|
5662
5729
|
value: function toggleMute() {
|
|
@@ -5902,6 +5969,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5902
5969
|
(_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : _this_hls.destroy();
|
|
5903
5970
|
(_this_adLayer = this.adLayer) === null || _this_adLayer === void 0 ? void 0 : _this_adLayer.destroy();
|
|
5904
5971
|
this.consecutiveFailures = 0;
|
|
5972
|
+
this.debugLogEntries = [];
|
|
5973
|
+
this.scteMarkerHistory = [];
|
|
5905
5974
|
}
|
|
5906
5975
|
}
|
|
5907
5976
|
]);
|
|
@@ -7015,10 +7084,12 @@ var CRITICAL_PROPS = [
|
|
|
7015
7084
|
"allowNativeHls",
|
|
7016
7085
|
"licenseKey",
|
|
7017
7086
|
"lowLatencyMode",
|
|
7018
|
-
"driftToleranceMs"
|
|
7087
|
+
"driftToleranceMs",
|
|
7088
|
+
"debugAdTiming"
|
|
7019
7089
|
];
|
|
7020
7090
|
var CONTROLS_HIDE_DELAY = 3e3;
|
|
7021
7091
|
var DEFAULT_PLAYER_ASPECT_RATIO = 16 / 9;
|
|
7092
|
+
var DEBUG_PANEL_MARKER_LIMIT = 12;
|
|
7022
7093
|
var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props) {
|
|
7023
7094
|
var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, minSegmentsBeforePlay = props.minSegmentsBeforePlay, disableAds = props.disableAds, disableFiller = props.disableFiller, swirlProjectId = props.swirlProjectId, restVideoAttrs = _object_without_properties(props, [
|
|
7024
7095
|
"src",
|
|
@@ -7081,6 +7152,8 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7081
7152
|
var _import_react2_default_useState18 = _sliced_to_array(import_react2.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react2_default_useState18[0], setViewportWidth = _import_react2_default_useState18[1];
|
|
7082
7153
|
var _import_react2_default_useState19 = _sliced_to_array(import_react2.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react2_default_useState19[0], setIsPortrait = _import_react2_default_useState19[1];
|
|
7083
7154
|
var _import_react2_default_useState20 = _sliced_to_array(import_react2.default.useState(DEFAULT_PLAYER_ASPECT_RATIO), 2), playerAspectRatio = _import_react2_default_useState20[0], setPlayerAspectRatio = _import_react2_default_useState20[1];
|
|
7155
|
+
var _import_react2_default_useState21 = _sliced_to_array(import_react2.default.useState(false), 2), showDebugPanel = _import_react2_default_useState21[0], setShowDebugPanel = _import_react2_default_useState21[1];
|
|
7156
|
+
var _import_react2_default_useState22 = _sliced_to_array(import_react2.default.useState([]), 2), debugMarkers = _import_react2_default_useState22[0], setDebugMarkers = _import_react2_default_useState22[1];
|
|
7084
7157
|
var getResponsiveScale = function getResponsiveScale() {
|
|
7085
7158
|
if (viewportWidth < 480) return 0.7;
|
|
7086
7159
|
if (viewportWidth < 768) return 0.8;
|
|
@@ -7088,6 +7161,28 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7088
7161
|
return 1;
|
|
7089
7162
|
};
|
|
7090
7163
|
var responsiveScale = getResponsiveScale();
|
|
7164
|
+
var formatDebugClock = function formatDebugClock(timestampMs) {
|
|
7165
|
+
try {
|
|
7166
|
+
var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
7167
|
+
return new Date(timestampMs).toLocaleTimeString("en-GB", {
|
|
7168
|
+
hour12: false,
|
|
7169
|
+
hour: "2-digit",
|
|
7170
|
+
minute: "2-digit",
|
|
7171
|
+
second: "2-digit",
|
|
7172
|
+
timeZone: localTimeZone
|
|
7173
|
+
});
|
|
7174
|
+
} catch (unused) {
|
|
7175
|
+
return "--:--:--";
|
|
7176
|
+
}
|
|
7177
|
+
};
|
|
7178
|
+
var formatDebugRaw = function formatDebugRaw(raw) {
|
|
7179
|
+
if (!raw || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== "object") return "";
|
|
7180
|
+
var obj = raw;
|
|
7181
|
+
if (typeof obj.tag === "string") return obj.tag;
|
|
7182
|
+
if (typeof obj.id3 === "string") return "ID3";
|
|
7183
|
+
if (typeof obj.splice_command_type === "number") return "binary splice";
|
|
7184
|
+
return "marker";
|
|
7185
|
+
};
|
|
7091
7186
|
var resetControlsTimer = (0, import_react2.useCallback)(function() {
|
|
7092
7187
|
if (controlsTimerRef.current) {
|
|
7093
7188
|
clearTimeout(controlsTimerRef.current);
|
|
@@ -7470,6 +7565,26 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7470
7565
|
}
|
|
7471
7566
|
};
|
|
7472
7567
|
}, []);
|
|
7568
|
+
(0, import_react2.useEffect)(function() {
|
|
7569
|
+
if (!debugAdTiming) {
|
|
7570
|
+
setShowDebugPanel(false);
|
|
7571
|
+
setDebugMarkers([]);
|
|
7572
|
+
return;
|
|
7573
|
+
}
|
|
7574
|
+
var updateDebugData = function updateDebugData() {
|
|
7575
|
+
var player = playerRef.current;
|
|
7576
|
+
if (!player) return;
|
|
7577
|
+
setDebugMarkers(player.getRecentScteMarkers().slice(-DEBUG_PANEL_MARKER_LIMIT).reverse());
|
|
7578
|
+
};
|
|
7579
|
+
updateDebugData();
|
|
7580
|
+
var interval = window.setInterval(updateDebugData, 500);
|
|
7581
|
+
return function() {
|
|
7582
|
+
return clearInterval(interval);
|
|
7583
|
+
};
|
|
7584
|
+
}, [
|
|
7585
|
+
debugAdTiming,
|
|
7586
|
+
criticalPropsKey
|
|
7587
|
+
]);
|
|
7473
7588
|
var handleWrapperMouseMove = (0, import_react2.useCallback)(function() {
|
|
7474
7589
|
resetControlsTimer();
|
|
7475
7590
|
}, [
|
|
@@ -7488,7 +7603,7 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7488
7603
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
7489
7604
|
children: [
|
|
7490
7605
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", {
|
|
7491
|
-
children: "\n @keyframes sc-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes sc-loading-glow {\n 0%, 100% { opacity: 0.85; transform: scale(1); }\n 50% { opacity: 1; transform: scale(1.05); }\n }\n @keyframes sc-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes sc-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .sc-wrapper:fullscreen,\n .sc-wrapper:has(*:fullscreen) {\n border-radius: 0 !important;\n box-shadow: none !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 999999 !important;\n background: #000 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n }\n .sc-ctrl-btn {\n background: none;\n border: none;\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n padding: 8px;\n transition: background 0.15s ease, opacity 0.15s ease;\n opacity: 0.9;\n }\n .sc-ctrl-btn:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n }\n .sc-ctrl-btn:active {\n opacity: 0.7;\n }\n .sc-controls-bar {\n transition: opacity 0.35s ease, transform 0.35s ease;\n }\n .sc-progress-track:hover .sc-progress-thumb {\n transform: translate(-50%, -50%) scale(1) !important;\n }\n .sc-loading-hidden .sc-loading-indicator {\n display: none !important;\n }\n "
|
|
7606
|
+
children: "\n @keyframes sc-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes sc-loading-glow {\n 0%, 100% { opacity: 0.85; transform: scale(1); }\n 50% { opacity: 1; transform: scale(1.05); }\n }\n @keyframes sc-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.6; }\n }\n @keyframes sc-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n .sc-wrapper:fullscreen,\n .sc-wrapper:has(*:fullscreen) {\n border-radius: 0 !important;\n box-shadow: none !important;\n width: 100vw !important;\n height: 100vh !important;\n max-width: 100vw !important;\n max-height: 100vh !important;\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 999999 !important;\n background: #000 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n }\n .sc-ctrl-btn {\n background: none;\n border: none;\n color: #fff;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n padding: 8px;\n transition: background 0.15s ease, opacity 0.15s ease;\n opacity: 0.9;\n }\n .sc-ctrl-btn:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n }\n .sc-ctrl-btn:active {\n opacity: 0.7;\n }\n .sc-controls-bar {\n transition: opacity 0.35s ease, transform 0.35s ease;\n }\n .sc-progress-track:hover .sc-progress-thumb {\n transform: translate(-50%, -50%) scale(1) !important;\n }\n .sc-loading-hidden .sc-loading-indicator {\n display: none !important;\n }\n .sc-debug-scroll::-webkit-scrollbar {\n width: 8px;\n }\n .sc-debug-scroll::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.22);\n border-radius: 4px;\n }\n .sc-debug-scroll {\n overflow-x: hidden !important;\n }\n "
|
|
7492
7607
|
}),
|
|
7493
7608
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7494
7609
|
ref: wrapperRef,
|
|
@@ -7730,6 +7845,181 @@ var StormcloudVideoPlayerComponent = import_react2.default.memo(function(props)
|
|
|
7730
7845
|
})
|
|
7731
7846
|
]
|
|
7732
7847
|
}),
|
|
7848
|
+
debugAdTiming && !showLicenseWarning && !showDebugPanel && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7849
|
+
className: "sc-ctrl-btn",
|
|
7850
|
+
onClick: function onClick() {
|
|
7851
|
+
setShowDebugPanel(function(prev) {
|
|
7852
|
+
return !prev;
|
|
7853
|
+
});
|
|
7854
|
+
resetControlsTimer();
|
|
7855
|
+
},
|
|
7856
|
+
style: {
|
|
7857
|
+
position: "absolute",
|
|
7858
|
+
top: "".concat(12 * responsiveScale, "px"),
|
|
7859
|
+
right: "".concat(12 * responsiveScale, "px"),
|
|
7860
|
+
zIndex: 61,
|
|
7861
|
+
width: "".concat(34 * responsiveScale, "px"),
|
|
7862
|
+
height: "".concat(34 * responsiveScale, "px"),
|
|
7863
|
+
borderRadius: "50%",
|
|
7864
|
+
background: showDebugPanel ? "rgba(255, 255, 255, 0.2)" : "rgba(0, 0, 0, 0.55)",
|
|
7865
|
+
border: "1px solid rgba(255, 255, 255, 0.2)",
|
|
7866
|
+
backdropFilter: "blur(12px)",
|
|
7867
|
+
WebkitBackdropFilter: "blur(12px)"
|
|
7868
|
+
},
|
|
7869
|
+
title: showDebugPanel ? "Hide debug panel" : "Show debug panel",
|
|
7870
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaCog, {
|
|
7871
|
+
size: Math.max(12, 15 * responsiveScale)
|
|
7872
|
+
})
|
|
7873
|
+
}),
|
|
7874
|
+
debugAdTiming && showDebugPanel && !showLicenseWarning && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7875
|
+
style: {
|
|
7876
|
+
position: "absolute",
|
|
7877
|
+
top: "".concat(12 * responsiveScale, "px"),
|
|
7878
|
+
right: "".concat(12 * responsiveScale, "px"),
|
|
7879
|
+
width: "".concat(Math.min(440, Math.max(320, viewportWidth * 0.42)), "px"),
|
|
7880
|
+
maxWidth: "92vw",
|
|
7881
|
+
height: isPortrait ? "52vh" : "420px",
|
|
7882
|
+
maxHeight: "58vh",
|
|
7883
|
+
zIndex: 60,
|
|
7884
|
+
background: "rgba(10, 10, 10, 0.74)",
|
|
7885
|
+
border: "1px solid rgba(255, 255, 255, 0.14)",
|
|
7886
|
+
borderRadius: "12px",
|
|
7887
|
+
boxShadow: "0 16px 48px rgba(0, 0, 0, 0.45)",
|
|
7888
|
+
backdropFilter: "blur(16px)",
|
|
7889
|
+
WebkitBackdropFilter: "blur(16px)",
|
|
7890
|
+
color: "rgba(255,255,255,0.94)",
|
|
7891
|
+
overflow: "hidden"
|
|
7892
|
+
},
|
|
7893
|
+
children: [
|
|
7894
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7895
|
+
style: {
|
|
7896
|
+
display: "flex",
|
|
7897
|
+
alignItems: "center",
|
|
7898
|
+
justifyContent: "space-between",
|
|
7899
|
+
padding: "10px 12px",
|
|
7900
|
+
borderBottom: "1px solid rgba(255,255,255,0.1)"
|
|
7901
|
+
},
|
|
7902
|
+
children: [
|
|
7903
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7904
|
+
style: {
|
|
7905
|
+
fontSize: "13px",
|
|
7906
|
+
fontWeight: 700,
|
|
7907
|
+
letterSpacing: "0.02em"
|
|
7908
|
+
},
|
|
7909
|
+
children: "Debug Ad Timing"
|
|
7910
|
+
}),
|
|
7911
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
7912
|
+
className: "sc-ctrl-btn",
|
|
7913
|
+
onClick: function onClick() {
|
|
7914
|
+
return setShowDebugPanel(false);
|
|
7915
|
+
},
|
|
7916
|
+
style: {
|
|
7917
|
+
padding: "4px",
|
|
7918
|
+
borderRadius: "6px",
|
|
7919
|
+
minWidth: "26px",
|
|
7920
|
+
minHeight: "26px"
|
|
7921
|
+
},
|
|
7922
|
+
title: "Close panel",
|
|
7923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_fa.FaTimes, {
|
|
7924
|
+
size: 12
|
|
7925
|
+
})
|
|
7926
|
+
})
|
|
7927
|
+
]
|
|
7928
|
+
}),
|
|
7929
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7930
|
+
className: "sc-debug-scroll",
|
|
7931
|
+
style: {
|
|
7932
|
+
padding: "10px 12px 12px",
|
|
7933
|
+
overflowY: "auto",
|
|
7934
|
+
overflowX: "hidden",
|
|
7935
|
+
height: "calc(100% - 46px)",
|
|
7936
|
+
display: "grid",
|
|
7937
|
+
gap: "12px"
|
|
7938
|
+
},
|
|
7939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7940
|
+
children: [
|
|
7941
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7942
|
+
style: {
|
|
7943
|
+
fontSize: "11px",
|
|
7944
|
+
fontWeight: 700,
|
|
7945
|
+
textTransform: "uppercase",
|
|
7946
|
+
letterSpacing: "0.08em",
|
|
7947
|
+
color: "rgba(255,255,255,0.68)",
|
|
7948
|
+
marginBottom: "8px"
|
|
7949
|
+
},
|
|
7950
|
+
children: "SCTE-35 markers"
|
|
7951
|
+
}),
|
|
7952
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7953
|
+
style: {
|
|
7954
|
+
display: "grid",
|
|
7955
|
+
gap: "6px"
|
|
7956
|
+
},
|
|
7957
|
+
children: debugMarkers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
7958
|
+
style: {
|
|
7959
|
+
fontSize: "12px",
|
|
7960
|
+
color: "rgba(255,255,255,0.55)"
|
|
7961
|
+
},
|
|
7962
|
+
children: "No markers detected yet."
|
|
7963
|
+
}) : debugMarkers.map(function(entry, idx) {
|
|
7964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7965
|
+
style: {
|
|
7966
|
+
display: "grid",
|
|
7967
|
+
gridTemplateColumns: "56px 52px 1fr",
|
|
7968
|
+
gap: "8px",
|
|
7969
|
+
alignItems: "center",
|
|
7970
|
+
fontFamily: "'SF Mono', 'Cascadia Code', monospace",
|
|
7971
|
+
fontSize: "11px",
|
|
7972
|
+
background: "rgba(255,255,255,0.05)",
|
|
7973
|
+
border: "1px solid rgba(255,255,255,0.08)",
|
|
7974
|
+
borderRadius: "8px",
|
|
7975
|
+
padding: "6px 8px"
|
|
7976
|
+
},
|
|
7977
|
+
children: [
|
|
7978
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
7979
|
+
style: {
|
|
7980
|
+
color: "rgba(255,255,255,0.68)"
|
|
7981
|
+
},
|
|
7982
|
+
children: formatDebugClock(entry.timestampMs)
|
|
7983
|
+
}),
|
|
7984
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
7985
|
+
style: {
|
|
7986
|
+
textTransform: "uppercase",
|
|
7987
|
+
fontWeight: 700,
|
|
7988
|
+
color: entry.type === "start" ? "#34d399" : entry.type === "end" ? "#f87171" : "#fbbf24"
|
|
7989
|
+
},
|
|
7990
|
+
children: entry.type
|
|
7991
|
+
}),
|
|
7992
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
7993
|
+
style: {
|
|
7994
|
+
color: "rgba(255,255,255,0.88)"
|
|
7995
|
+
},
|
|
7996
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", {
|
|
7997
|
+
style: {
|
|
7998
|
+
display: "inline-block",
|
|
7999
|
+
maxWidth: "100%",
|
|
8000
|
+
verticalAlign: "bottom",
|
|
8001
|
+
overflow: "hidden",
|
|
8002
|
+
textOverflow: "ellipsis",
|
|
8003
|
+
whiteSpace: "nowrap"
|
|
8004
|
+
},
|
|
8005
|
+
children: [
|
|
8006
|
+
entry.durationSeconds != null ? "dur:".concat(entry.durationSeconds.toFixed(2), "s") : "dur:-",
|
|
8007
|
+
" ",
|
|
8008
|
+
entry.ptsSeconds != null ? "pts:".concat(entry.ptsSeconds.toFixed(2)) : "pts:-",
|
|
8009
|
+
" ",
|
|
8010
|
+
formatDebugRaw(entry.raw)
|
|
8011
|
+
]
|
|
8012
|
+
})
|
|
8013
|
+
})
|
|
8014
|
+
]
|
|
8015
|
+
}, "".concat(entry.timestampMs, "-").concat(idx));
|
|
8016
|
+
})
|
|
8017
|
+
})
|
|
8018
|
+
]
|
|
8019
|
+
})
|
|
8020
|
+
})
|
|
8021
|
+
]
|
|
8022
|
+
}),
|
|
7733
8023
|
shouldShowEnhancedControls && !showLicenseWarning ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
7734
8024
|
className: "sc-controls-bar",
|
|
7735
8025
|
style: {
|