stormcloud-video-player 0.7.41 → 0.7.42
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 +2 -88
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -7
- package/lib/index.d.ts +1 -7
- package/lib/index.js +3 -81
- package/lib/index.js.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +1 -2
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +2 -80
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/overlays.cjs +1 -67
- package/lib/utils/overlays.cjs.map +1 -1
- package/lib/utils/overlays.d.cts +1 -7
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -4089,12 +4089,6 @@ declare function overlayAuthoringDimensions(overlay: SwirlOverlay, decodeWidth:
|
|
|
4089
4089
|
};
|
|
4090
4090
|
declare function swirlProjectHasNabDemoMixedWithOther(overlays: SwirlOverlay[]): boolean;
|
|
4091
4091
|
declare function inferSwirlOverlayCoordinateSpace(overlays: SwirlOverlay[], videoWidth: number, videoHeight: number): OverlayCoordinateSpace;
|
|
4092
|
-
declare function scrollerLooksLikeMarketsStock(o: SwirlOverlay): boolean;
|
|
4093
|
-
type DemoStockTickerOptions = {
|
|
4094
|
-
coordinateWidth?: number;
|
|
4095
|
-
coordinateHeight?: number;
|
|
4096
|
-
};
|
|
4097
|
-
declare function createDemoStockTickerOverlay(projectId: number, opts?: DemoStockTickerOptions): SwirlOverlay;
|
|
4098
4092
|
declare function normalizeSwirlOverlay(raw: SwirlOverlay & Record<string, unknown>): SwirlOverlay;
|
|
4099
4093
|
declare function fetchProjectOverlays(projectId: number, apiBaseUrl?: string): Promise<SwirlOverlay[]>;
|
|
4100
4094
|
declare function resolveImageUrl(imageUrl: string, apiBaseUrl?: string): string;
|
|
@@ -4156,4 +4150,4 @@ interface AdStormAdLayer extends AdController {
|
|
|
4156
4150
|
}
|
|
4157
4151
|
declare function createAdStormPlayer(contentVideo: HTMLVideoElement, options: AdStormPlayerOptions): AdStormAdLayer;
|
|
4158
4152
|
|
|
4159
|
-
export { type AdBreak, type AdSchedule, type AdStormAdLayer, type AdStormLayerOptionsUpdate, type AdStormPlayerOptions, type BaseStormcloudPlayerProps, type BrowserInfo, type ClientInfo, type
|
|
4153
|
+
export { type AdBreak, type AdSchedule, type AdStormAdLayer, type AdStormLayerOptionsUpdate, type AdStormPlayerOptions, type BaseStormcloudPlayerProps, type BrowserInfo, type ClientInfo, type HeartbeatData, IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, type LateJoinPolicy, OVERLAY_API_BASE, type OnProgressProps, type OverlayCoordinateSpace, SUPPORTS_DASH, SUPPORTS_HLS, SWIRL_HD_AUTHORING_HEIGHT, SWIRL_HD_AUTHORING_WIDTH, StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, type StormcloudVideoPlayerConfig, type StormcloudVideoPlayerProps, type SwirlOverlay, type SwirlOverlayType, type SwirlScrollerConfig, type TrackingData, type VastBidResponse, canPlay, createAdStormPlayer, createStormcloudPlayer, StormcloudVideoPlayerComponent as default, detectBrowser, fetchProjectOverlays, getBrowserConfigOverrides, getBrowserID, getClientInfo, inferSwirlOverlayCoordinateSpace, initializePolyfills, isMediaStream, isOverlayActive, lazy, logBrowserInfo, merge, normalizeSwirlOverlay, omit, overlayAuthoringDimensions, parseQuery, players, randomString, resolveImageUrl, sendHeartbeat, sendInitialTracking, supportsFeature, supportsModernJS, supportsWebKitPresentationMode, swirlProjectHasNabDemoMixedWithOther, timeStringToSeconds };
|
package/lib/index.d.ts
CHANGED
|
@@ -4089,12 +4089,6 @@ declare function overlayAuthoringDimensions(overlay: SwirlOverlay, decodeWidth:
|
|
|
4089
4089
|
};
|
|
4090
4090
|
declare function swirlProjectHasNabDemoMixedWithOther(overlays: SwirlOverlay[]): boolean;
|
|
4091
4091
|
declare function inferSwirlOverlayCoordinateSpace(overlays: SwirlOverlay[], videoWidth: number, videoHeight: number): OverlayCoordinateSpace;
|
|
4092
|
-
declare function scrollerLooksLikeMarketsStock(o: SwirlOverlay): boolean;
|
|
4093
|
-
type DemoStockTickerOptions = {
|
|
4094
|
-
coordinateWidth?: number;
|
|
4095
|
-
coordinateHeight?: number;
|
|
4096
|
-
};
|
|
4097
|
-
declare function createDemoStockTickerOverlay(projectId: number, opts?: DemoStockTickerOptions): SwirlOverlay;
|
|
4098
4092
|
declare function normalizeSwirlOverlay(raw: SwirlOverlay & Record<string, unknown>): SwirlOverlay;
|
|
4099
4093
|
declare function fetchProjectOverlays(projectId: number, apiBaseUrl?: string): Promise<SwirlOverlay[]>;
|
|
4100
4094
|
declare function resolveImageUrl(imageUrl: string, apiBaseUrl?: string): string;
|
|
@@ -4156,4 +4150,4 @@ interface AdStormAdLayer extends AdController {
|
|
|
4156
4150
|
}
|
|
4157
4151
|
declare function createAdStormPlayer(contentVideo: HTMLVideoElement, options: AdStormPlayerOptions): AdStormAdLayer;
|
|
4158
4152
|
|
|
4159
|
-
export { type AdBreak, type AdSchedule, type AdStormAdLayer, type AdStormLayerOptionsUpdate, type AdStormPlayerOptions, type BaseStormcloudPlayerProps, type BrowserInfo, type ClientInfo, type
|
|
4153
|
+
export { type AdBreak, type AdSchedule, type AdStormAdLayer, type AdStormLayerOptionsUpdate, type AdStormPlayerOptions, type BaseStormcloudPlayerProps, type BrowserInfo, type ClientInfo, type HeartbeatData, IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, type LateJoinPolicy, OVERLAY_API_BASE, type OnProgressProps, type OverlayCoordinateSpace, SUPPORTS_DASH, SUPPORTS_HLS, SWIRL_HD_AUTHORING_HEIGHT, SWIRL_HD_AUTHORING_WIDTH, StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, type StormcloudVideoPlayerConfig, type StormcloudVideoPlayerProps, type SwirlOverlay, type SwirlOverlayType, type SwirlScrollerConfig, type TrackingData, type VastBidResponse, canPlay, createAdStormPlayer, createStormcloudPlayer, StormcloudVideoPlayerComponent as default, detectBrowser, fetchProjectOverlays, getBrowserConfigOverrides, getBrowserID, getClientInfo, inferSwirlOverlayCoordinateSpace, initializePolyfills, isMediaStream, isOverlayActive, lazy, logBrowserInfo, merge, normalizeSwirlOverlay, omit, overlayAuthoringDimensions, parseQuery, players, randomString, resolveImageUrl, sendHeartbeat, sendInitialTracking, supportsFeature, supportsModernJS, supportsWebKitPresentationMode, swirlProjectHasNabDemoMixedWithOther, timeStringToSeconds };
|
package/lib/index.js
CHANGED
|
@@ -5722,8 +5722,7 @@ function overlayAuthoringDimensions(overlay, decodeWidth, decodeHeight) {
|
|
|
5722
5722
|
var EPS = 2;
|
|
5723
5723
|
var exceedsDecode = extR > decodeWidth + EPS || extB > decodeHeight + EPS;
|
|
5724
5724
|
var isNabDemo = overlay.name.startsWith(NAB_DEMO_NAME_PREFIX);
|
|
5725
|
-
|
|
5726
|
-
if (exceedsDecode && (isNabDemo || isSyntheticMarketsTicker)) {
|
|
5725
|
+
if (exceedsDecode && isNabDemo) {
|
|
5727
5726
|
return {
|
|
5728
5727
|
width: SWIRL_HD_AUTHORING_WIDTH,
|
|
5729
5728
|
height: SWIRL_HD_AUTHORING_HEIGHT
|
|
@@ -5821,63 +5820,6 @@ function inferSwirlOverlayCoordinateSpace(overlays, videoWidth, videoHeight) {
|
|
|
5821
5820
|
height: videoHeight
|
|
5822
5821
|
};
|
|
5823
5822
|
}
|
|
5824
|
-
function scrollerLooksLikeMarketsStock(o) {
|
|
5825
|
-
var _ref, _ref1, _ref2, _ref3;
|
|
5826
|
-
if (o.type !== "scroller") return false;
|
|
5827
|
-
var cfg = o.scroller_config;
|
|
5828
|
-
var blob = "".concat(o.name, " ").concat((_ref = cfg === null || cfg === void 0 ? void 0 : cfg.label) !== null && _ref !== void 0 ? _ref : "", " ").concat((_ref1 = cfg === null || cfg === void 0 ? void 0 : cfg.label_line2) !== null && _ref1 !== void 0 ? _ref1 : "", " ").concat((_ref2 = cfg === null || cfg === void 0 ? void 0 : cfg.custom_text) !== null && _ref2 !== void 0 ? _ref2 : "", " ").concat((_ref3 = cfg === null || cfg === void 0 ? void 0 : cfg.preset) !== null && _ref3 !== void 0 ? _ref3 : "");
|
|
5829
|
-
return /\b(MARKETS?|NYSE|NASDAQ|DJIA|\bS&P\b|STOCK|AAPL|TSLA|NVDA|EQUITIES)\b/i.test(blob);
|
|
5830
|
-
}
|
|
5831
|
-
function createDemoStockTickerOverlay(projectId, opts) {
|
|
5832
|
-
var cw = (opts === null || opts === void 0 ? void 0 : opts.coordinateWidth) && opts.coordinateWidth > 0 ? opts.coordinateWidth : SWIRL_HD_AUTHORING_WIDTH;
|
|
5833
|
-
var ch = (opts === null || opts === void 0 ? void 0 : opts.coordinateHeight) && opts.coordinateHeight > 0 ? opts.coordinateHeight : SWIRL_HD_AUTHORING_HEIGHT;
|
|
5834
|
-
var sx = cw / SWIRL_HD_AUTHORING_WIDTH;
|
|
5835
|
-
var sy = ch / SWIRL_HD_AUTHORING_HEIGHT;
|
|
5836
|
-
var x = 36 * sx;
|
|
5837
|
-
var y = 1002 * sy;
|
|
5838
|
-
var width = 1848 * sx;
|
|
5839
|
-
var height = 66 * sy;
|
|
5840
|
-
var fontSize = Math.max(8, Math.round(13 * sy));
|
|
5841
|
-
var scrollSpeed = Math.max(8, Math.round(36 * sx));
|
|
5842
|
-
var borderRadius = Math.max(1, Math.round(4 * sy));
|
|
5843
|
-
return {
|
|
5844
|
-
id: -9001,
|
|
5845
|
-
project_id: projectId,
|
|
5846
|
-
name: "Demo stock ticker",
|
|
5847
|
-
type: "scroller",
|
|
5848
|
-
visible: true,
|
|
5849
|
-
x: x,
|
|
5850
|
-
y: y,
|
|
5851
|
-
width: width,
|
|
5852
|
-
height: height,
|
|
5853
|
-
opacity: 100,
|
|
5854
|
-
start_time: "00:00:00.000",
|
|
5855
|
-
duration: "24:00:00.000",
|
|
5856
|
-
z_index: 120,
|
|
5857
|
-
scroller_config: {
|
|
5858
|
-
preset: "equities_strip",
|
|
5859
|
-
use_custom_text: true,
|
|
5860
|
-
custom_text: "AAPL +0.84% \u2022 MSFT +0.31% \u2022 GOOGL \u22120.22% \u2022 AMZN +0.47% \u2022 NVDA +1.12% \u2022 META +0.19% \u2022 BRK.B +0.11% \u2022 JPM +0.55% \u2022 V +0.28% \u2022 UNH \u22120.17% \u2022 DJIA +0.41% \u2022 S&P 500 +0.29% \u2022 Nasdaq Composite +0.36% \u2022 Russell 2000 +0.52% \u2022 WTI crude $78.40 +0.6% \u2022 Gold $2,348/oz \u22120.2% \u2022 10Y Treasury 4.28%",
|
|
5861
|
-
direction: "left",
|
|
5862
|
-
scroll_speed: scrollSpeed,
|
|
5863
|
-
font_size: fontSize,
|
|
5864
|
-
font_weight: "600",
|
|
5865
|
-
text_color: "#e2e8f0",
|
|
5866
|
-
background_color: "#0a0f18",
|
|
5867
|
-
background_opacity: 92,
|
|
5868
|
-
border_radius: borderRadius,
|
|
5869
|
-
padding: Math.max(3, Math.round(6 * sy)),
|
|
5870
|
-
label: "U.S. equities",
|
|
5871
|
-
label_line2: "",
|
|
5872
|
-
label_color: "#1e3a5f",
|
|
5873
|
-
label_text_color: "#f8fafc",
|
|
5874
|
-
accent_color: "#38bdf8",
|
|
5875
|
-
show_accent_line: true,
|
|
5876
|
-
separator_char: "\u2022",
|
|
5877
|
-
item_spacing: Math.max(28, Math.round(48 * sx))
|
|
5878
|
-
}
|
|
5879
|
-
};
|
|
5880
|
-
}
|
|
5881
5823
|
function normalizeScrollerConfig(raw) {
|
|
5882
5824
|
if (!raw || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== "object") return void 0;
|
|
5883
5825
|
var r = raw;
|
|
@@ -7898,27 +7840,7 @@ var StormcloudVideoPlayerComponent = React2.memo(function(props) {
|
|
|
7898
7840
|
swirlOverlayApiBaseUrl
|
|
7899
7841
|
]);
|
|
7900
7842
|
var _React2_useState17 = _sliced_to_array(React2.useState(null), 2), overlayCoordSpace = _React2_useState17[0], setOverlayCoordSpace = _React2_useState17[1];
|
|
7901
|
-
var displayOverlays =
|
|
7902
|
-
if (!swirlProjectId || !swirlShowcaseDemo) return overlays;
|
|
7903
|
-
if (overlays.some(scrollerLooksLikeMarketsStock)) return overlays;
|
|
7904
|
-
if (overlays.some(function(o) {
|
|
7905
|
-
return o.visible && o.type === "scroller";
|
|
7906
|
-
})) return overlays;
|
|
7907
|
-
var cw = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.width;
|
|
7908
|
-
var ch = overlayCoordSpace === null || overlayCoordSpace === void 0 ? void 0 : overlayCoordSpace.height;
|
|
7909
|
-
var tickerOpts = cw && cw > 0 && ch && ch > 0 ? {
|
|
7910
|
-
coordinateWidth: cw,
|
|
7911
|
-
coordinateHeight: ch
|
|
7912
|
-
} : {};
|
|
7913
|
-
return _to_consumable_array(overlays).concat([
|
|
7914
|
-
createDemoStockTickerOverlay(swirlProjectId, tickerOpts)
|
|
7915
|
-
]);
|
|
7916
|
-
}, [
|
|
7917
|
-
overlays,
|
|
7918
|
-
swirlProjectId,
|
|
7919
|
-
swirlShowcaseDemo,
|
|
7920
|
-
overlayCoordSpace
|
|
7921
|
-
]);
|
|
7843
|
+
var displayOverlays = overlays;
|
|
7922
7844
|
var _React2_useState18 = _sliced_to_array(React2.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _React2_useState18[0], setViewportWidth = _React2_useState18[1];
|
|
7923
7845
|
var _React2_useState19 = _sliced_to_array(React2.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _React2_useState19[0], setIsPortrait = _React2_useState19[1];
|
|
7924
7846
|
var _React2_useState20 = _sliced_to_array(React2.useState(DEFAULT_PLAYER_ASPECT_RATIO), 2), playerAspectRatio = _React2_useState20[0], setPlayerAspectRatio = _React2_useState20[1];
|
|
@@ -11301,5 +11223,5 @@ var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallbac
|
|
|
11301
11223
|
};
|
|
11302
11224
|
var StormcloudPlayer = createStormcloudPlayer(players_default, players_default[players_default.length - 1]);
|
|
11303
11225
|
var StormcloudPlayer_default = StormcloudPlayer;
|
|
11304
|
-
export { IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, OVERLAY_API_BASE, SUPPORTS_DASH, SUPPORTS_HLS, SWIRL_HD_AUTHORING_HEIGHT, SWIRL_HD_AUTHORING_WIDTH, StormcloudPlayer_default as StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, canPlay, createAdStormPlayer,
|
|
11226
|
+
export { IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, OVERLAY_API_BASE, SUPPORTS_DASH, SUPPORTS_HLS, SWIRL_HD_AUTHORING_HEIGHT, SWIRL_HD_AUTHORING_WIDTH, StormcloudPlayer_default as StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, canPlay, createAdStormPlayer, createStormcloudPlayer, StormcloudVideoPlayerComponent as default, detectBrowser, fetchProjectOverlays, getBrowserConfigOverrides, getBrowserID, getClientInfo, inferSwirlOverlayCoordinateSpace, initializePolyfills, isMediaStream, isOverlayActive, lazy, logBrowserInfo, merge, normalizeSwirlOverlay, omit, overlayAuthoringDimensions, parseQuery, players_default as players, randomString, resolveImageUrl, sendHeartbeat, sendInitialTracking, supportsFeature, supportsModernJS, supportsWebKitPresentationMode, swirlProjectHasNabDemoMixedWithOther, timeStringToSeconds };
|
|
11305
11227
|
//# sourceMappingURL=index.js.map
|