stormcloud-video-player 0.7.3 → 0.7.4
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 +1026 -1199
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +35 -49
- package/lib/index.d.ts +35 -49
- package/lib/index.js +1023 -1192
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +1000 -1188
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +5 -2
- package/lib/players/HlsPlayer.cjs +1000 -1188
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +1000 -1188
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.cjs +1573 -0
- package/lib/sdk/adstormPlayer.cjs.map +1 -0
- package/lib/sdk/adstormPlayer.d.cts +22 -0
- package/lib/{types-BYwfSJb5.d.cts → types-vCa10HuQ.d.cts} +21 -27
- package/lib/ui/StormcloudVideoPlayer.cjs +1022 -1191
- 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
- package/lib/sdk/vastAdLayer.cjs +0 -1595
- package/lib/sdk/vastAdLayer.cjs.map +0 -1
- package/lib/sdk/vastAdLayer.d.cts +0 -42
- package/lib/sdk/vastManager.cjs +0 -627
- package/lib/sdk/vastManager.cjs.map +0 -1
- package/lib/sdk/vastManager.d.cts +0 -8
package/lib/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties, lazy as lazy$1 } from 'react';
|
|
2
2
|
import * as csstype from 'csstype';
|
|
3
|
-
import Hls from 'hls.js';
|
|
4
3
|
|
|
5
4
|
type LateJoinPolicy = "play_remaining" | "skip_to_content";
|
|
6
5
|
interface AdBreak {
|
|
@@ -37,6 +36,26 @@ interface StormcloudVideoPlayerConfig {
|
|
|
37
36
|
adTransitionGapMs?: number;
|
|
38
37
|
singlePipelineMode?: boolean;
|
|
39
38
|
}
|
|
39
|
+
interface AdController {
|
|
40
|
+
initialize: () => void;
|
|
41
|
+
requestAds: () => Promise<void>;
|
|
42
|
+
play: () => Promise<void>;
|
|
43
|
+
pause: () => void;
|
|
44
|
+
resume: () => void;
|
|
45
|
+
stop: () => Promise<void>;
|
|
46
|
+
destroy: () => void;
|
|
47
|
+
isAdPlaying: () => boolean;
|
|
48
|
+
resize: (width: number, height: number) => void;
|
|
49
|
+
on: (event: string, listener: (payload?: any) => void) => void;
|
|
50
|
+
off: (event: string, listener: (payload?: any) => void) => void;
|
|
51
|
+
updateOriginalMutedState: (muted: boolean, volume?: number) => void;
|
|
52
|
+
getOriginalMutedState: () => boolean;
|
|
53
|
+
getOriginalVolume: () => number;
|
|
54
|
+
setAdVolume: (volume: number) => void;
|
|
55
|
+
getAdVolume: () => number;
|
|
56
|
+
showPlaceholder: () => void;
|
|
57
|
+
hidePlaceholder: () => void;
|
|
58
|
+
}
|
|
40
59
|
interface ClientInfo {
|
|
41
60
|
brand: string;
|
|
42
61
|
os: string;
|
|
@@ -91,24 +110,11 @@ interface VastBidResponse {
|
|
|
91
110
|
adomain?: string[];
|
|
92
111
|
durationSec?: number;
|
|
93
112
|
}
|
|
94
|
-
interface AdBreakContext {
|
|
95
|
-
breakDurationSec?: number;
|
|
96
|
-
remainingBreakSec?: number;
|
|
97
|
-
adIndex?: number;
|
|
98
|
-
}
|
|
99
|
-
interface VastManager {
|
|
100
|
-
initialize: () => Promise<void>;
|
|
101
|
-
requestBids: (context?: AdBreakContext) => Promise<VastBidResponse[]>;
|
|
102
|
-
requestBidsUntilResponse: (context?: AdBreakContext) => Promise<VastBidResponse[]>;
|
|
103
|
-
destroy: () => void;
|
|
104
|
-
readonly isInitialized: boolean;
|
|
105
|
-
}
|
|
106
113
|
|
|
107
114
|
declare class StormcloudVideoPlayer {
|
|
108
115
|
private readonly video;
|
|
109
116
|
private readonly config;
|
|
110
117
|
private hls?;
|
|
111
|
-
private vastManager;
|
|
112
118
|
private adLayer;
|
|
113
119
|
private pendingNextAdBids;
|
|
114
120
|
private continuousFetchLoopPromise;
|
|
@@ -155,6 +161,9 @@ declare class StormcloudVideoPlayer {
|
|
|
155
161
|
private readonly maxBackoffMs;
|
|
156
162
|
private readonly adTransitionGapMs;
|
|
157
163
|
private readonly MIN_AD_REMAINING_MS;
|
|
164
|
+
private readonly adRequestTimeoutMs;
|
|
165
|
+
private readonly adRequestMaxRetries;
|
|
166
|
+
private readonly adRequestRetryBackoffMs;
|
|
158
167
|
private preloadedTokens;
|
|
159
168
|
private fillerVideo;
|
|
160
169
|
private fillerBreakTimerId;
|
|
@@ -184,6 +193,7 @@ declare class StormcloudVideoPlayer {
|
|
|
184
193
|
private sendHeartbeatIfNeeded;
|
|
185
194
|
getCurrentAdIndex(): number;
|
|
186
195
|
getTotalAdsInBreak(): number;
|
|
196
|
+
getRemainingAdSeconds(): number;
|
|
187
197
|
isAdPlaying(): boolean;
|
|
188
198
|
isShowingAds(): boolean;
|
|
189
199
|
private syncMainContentAudioWhenVisible;
|
|
@@ -4063,47 +4073,23 @@ declare function getBrowserConfigOverrides(): {
|
|
|
4063
4073
|
};
|
|
4064
4074
|
declare function supportsFeature(feature: string): boolean;
|
|
4065
4075
|
|
|
4066
|
-
interface
|
|
4076
|
+
interface AdStormPlayerOptions {
|
|
4077
|
+
licenseKey: string;
|
|
4067
4078
|
debug?: boolean;
|
|
4068
4079
|
}
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
interface VastAdLayerOptions {
|
|
4080
|
+
interface AdStormLayerOptionsUpdate {
|
|
4072
4081
|
continueLiveStreamDuringAds?: boolean;
|
|
4073
|
-
mainHlsInstance?:
|
|
4074
|
-
smartTVMode?: boolean;
|
|
4075
|
-
singleElementMode?: boolean;
|
|
4076
|
-
forceMP4Ads?: boolean;
|
|
4077
|
-
debug?: boolean;
|
|
4082
|
+
mainHlsInstance?: unknown;
|
|
4078
4083
|
}
|
|
4079
|
-
interface
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
initialize: () => void;
|
|
4085
|
-
updateOptions: (opts: VastAdLayerOptionsUpdate) => void;
|
|
4086
|
-
playAd: (bids: VastBidResponse[]) => Promise<void>;
|
|
4087
|
-
preloadAd: (bids: VastBidResponse[], token: string) => Promise<void>;
|
|
4084
|
+
interface AdStormAdLayer extends AdController {
|
|
4085
|
+
requestAds: (duration?: string) => Promise<void>;
|
|
4086
|
+
updateOptions: (opts: AdStormLayerOptionsUpdate) => void;
|
|
4087
|
+
playAd: (requestContext?: unknown) => Promise<void>;
|
|
4088
|
+
preloadAd: (arg1: unknown, arg2?: unknown) => Promise<void>;
|
|
4088
4089
|
playPreloaded: (token: string) => Promise<void>;
|
|
4089
4090
|
hasPreloaded: (token: string) => boolean;
|
|
4090
4091
|
cancelPreload: (token: string) => void;
|
|
4091
|
-
pause: () => void;
|
|
4092
|
-
resume: () => void;
|
|
4093
|
-
stop: () => Promise<void>;
|
|
4094
|
-
destroy: () => void;
|
|
4095
|
-
isAdPlaying: () => boolean;
|
|
4096
|
-
resize: (width: number, height: number) => void;
|
|
4097
|
-
on: (event: string, listener: (payload?: any) => void) => void;
|
|
4098
|
-
off: (event: string, listener: (payload?: any) => void) => void;
|
|
4099
|
-
updateOriginalMutedState: (muted: boolean, volume?: number) => void;
|
|
4100
|
-
getOriginalMutedState: () => boolean;
|
|
4101
|
-
getOriginalVolume: () => number;
|
|
4102
|
-
setAdVolume: (volume: number) => void;
|
|
4103
|
-
getAdVolume: () => number;
|
|
4104
|
-
showPlaceholder: () => void;
|
|
4105
|
-
hidePlaceholder: () => void;
|
|
4106
4092
|
}
|
|
4107
|
-
declare function
|
|
4093
|
+
declare function createAdStormPlayer(contentVideo: HTMLVideoElement, options: AdStormPlayerOptions): AdStormAdLayer;
|
|
4108
4094
|
|
|
4109
|
-
export { type AdBreak, type AdSchedule, type BaseStormcloudPlayerProps, type BrowserInfo, type ClientInfo, type HeartbeatData, IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, type LateJoinPolicy, type OnProgressProps, type OverlayCoordinateSpace, SUPPORTS_DASH, SUPPORTS_HLS, StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, type StormcloudVideoPlayerConfig, type StormcloudVideoPlayerProps, type SwirlOverlay, type SwirlOverlayType, type SwirlScrollerConfig, type TrackingData, type
|
|
4095
|
+
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, type OnProgressProps, type OverlayCoordinateSpace, SUPPORTS_DASH, SUPPORTS_HLS, 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, initializePolyfills, isMediaStream, isOverlayActive, lazy, logBrowserInfo, merge, omit, parseQuery, players, randomString, resolveImageUrl, sendHeartbeat, sendInitialTracking, supportsFeature, supportsModernJS, supportsWebKitPresentationMode, timeStringToSeconds };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties, lazy as lazy$1 } from 'react';
|
|
2
2
|
import * as csstype from 'csstype';
|
|
3
|
-
import Hls from 'hls.js';
|
|
4
3
|
|
|
5
4
|
type LateJoinPolicy = "play_remaining" | "skip_to_content";
|
|
6
5
|
interface AdBreak {
|
|
@@ -37,6 +36,26 @@ interface StormcloudVideoPlayerConfig {
|
|
|
37
36
|
adTransitionGapMs?: number;
|
|
38
37
|
singlePipelineMode?: boolean;
|
|
39
38
|
}
|
|
39
|
+
interface AdController {
|
|
40
|
+
initialize: () => void;
|
|
41
|
+
requestAds: () => Promise<void>;
|
|
42
|
+
play: () => Promise<void>;
|
|
43
|
+
pause: () => void;
|
|
44
|
+
resume: () => void;
|
|
45
|
+
stop: () => Promise<void>;
|
|
46
|
+
destroy: () => void;
|
|
47
|
+
isAdPlaying: () => boolean;
|
|
48
|
+
resize: (width: number, height: number) => void;
|
|
49
|
+
on: (event: string, listener: (payload?: any) => void) => void;
|
|
50
|
+
off: (event: string, listener: (payload?: any) => void) => void;
|
|
51
|
+
updateOriginalMutedState: (muted: boolean, volume?: number) => void;
|
|
52
|
+
getOriginalMutedState: () => boolean;
|
|
53
|
+
getOriginalVolume: () => number;
|
|
54
|
+
setAdVolume: (volume: number) => void;
|
|
55
|
+
getAdVolume: () => number;
|
|
56
|
+
showPlaceholder: () => void;
|
|
57
|
+
hidePlaceholder: () => void;
|
|
58
|
+
}
|
|
40
59
|
interface ClientInfo {
|
|
41
60
|
brand: string;
|
|
42
61
|
os: string;
|
|
@@ -91,24 +110,11 @@ interface VastBidResponse {
|
|
|
91
110
|
adomain?: string[];
|
|
92
111
|
durationSec?: number;
|
|
93
112
|
}
|
|
94
|
-
interface AdBreakContext {
|
|
95
|
-
breakDurationSec?: number;
|
|
96
|
-
remainingBreakSec?: number;
|
|
97
|
-
adIndex?: number;
|
|
98
|
-
}
|
|
99
|
-
interface VastManager {
|
|
100
|
-
initialize: () => Promise<void>;
|
|
101
|
-
requestBids: (context?: AdBreakContext) => Promise<VastBidResponse[]>;
|
|
102
|
-
requestBidsUntilResponse: (context?: AdBreakContext) => Promise<VastBidResponse[]>;
|
|
103
|
-
destroy: () => void;
|
|
104
|
-
readonly isInitialized: boolean;
|
|
105
|
-
}
|
|
106
113
|
|
|
107
114
|
declare class StormcloudVideoPlayer {
|
|
108
115
|
private readonly video;
|
|
109
116
|
private readonly config;
|
|
110
117
|
private hls?;
|
|
111
|
-
private vastManager;
|
|
112
118
|
private adLayer;
|
|
113
119
|
private pendingNextAdBids;
|
|
114
120
|
private continuousFetchLoopPromise;
|
|
@@ -155,6 +161,9 @@ declare class StormcloudVideoPlayer {
|
|
|
155
161
|
private readonly maxBackoffMs;
|
|
156
162
|
private readonly adTransitionGapMs;
|
|
157
163
|
private readonly MIN_AD_REMAINING_MS;
|
|
164
|
+
private readonly adRequestTimeoutMs;
|
|
165
|
+
private readonly adRequestMaxRetries;
|
|
166
|
+
private readonly adRequestRetryBackoffMs;
|
|
158
167
|
private preloadedTokens;
|
|
159
168
|
private fillerVideo;
|
|
160
169
|
private fillerBreakTimerId;
|
|
@@ -184,6 +193,7 @@ declare class StormcloudVideoPlayer {
|
|
|
184
193
|
private sendHeartbeatIfNeeded;
|
|
185
194
|
getCurrentAdIndex(): number;
|
|
186
195
|
getTotalAdsInBreak(): number;
|
|
196
|
+
getRemainingAdSeconds(): number;
|
|
187
197
|
isAdPlaying(): boolean;
|
|
188
198
|
isShowingAds(): boolean;
|
|
189
199
|
private syncMainContentAudioWhenVisible;
|
|
@@ -4063,47 +4073,23 @@ declare function getBrowserConfigOverrides(): {
|
|
|
4063
4073
|
};
|
|
4064
4074
|
declare function supportsFeature(feature: string): boolean;
|
|
4065
4075
|
|
|
4066
|
-
interface
|
|
4076
|
+
interface AdStormPlayerOptions {
|
|
4077
|
+
licenseKey: string;
|
|
4067
4078
|
debug?: boolean;
|
|
4068
4079
|
}
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
interface VastAdLayerOptions {
|
|
4080
|
+
interface AdStormLayerOptionsUpdate {
|
|
4072
4081
|
continueLiveStreamDuringAds?: boolean;
|
|
4073
|
-
mainHlsInstance?:
|
|
4074
|
-
smartTVMode?: boolean;
|
|
4075
|
-
singleElementMode?: boolean;
|
|
4076
|
-
forceMP4Ads?: boolean;
|
|
4077
|
-
debug?: boolean;
|
|
4082
|
+
mainHlsInstance?: unknown;
|
|
4078
4083
|
}
|
|
4079
|
-
interface
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
initialize: () => void;
|
|
4085
|
-
updateOptions: (opts: VastAdLayerOptionsUpdate) => void;
|
|
4086
|
-
playAd: (bids: VastBidResponse[]) => Promise<void>;
|
|
4087
|
-
preloadAd: (bids: VastBidResponse[], token: string) => Promise<void>;
|
|
4084
|
+
interface AdStormAdLayer extends AdController {
|
|
4085
|
+
requestAds: (duration?: string) => Promise<void>;
|
|
4086
|
+
updateOptions: (opts: AdStormLayerOptionsUpdate) => void;
|
|
4087
|
+
playAd: (requestContext?: unknown) => Promise<void>;
|
|
4088
|
+
preloadAd: (arg1: unknown, arg2?: unknown) => Promise<void>;
|
|
4088
4089
|
playPreloaded: (token: string) => Promise<void>;
|
|
4089
4090
|
hasPreloaded: (token: string) => boolean;
|
|
4090
4091
|
cancelPreload: (token: string) => void;
|
|
4091
|
-
pause: () => void;
|
|
4092
|
-
resume: () => void;
|
|
4093
|
-
stop: () => Promise<void>;
|
|
4094
|
-
destroy: () => void;
|
|
4095
|
-
isAdPlaying: () => boolean;
|
|
4096
|
-
resize: (width: number, height: number) => void;
|
|
4097
|
-
on: (event: string, listener: (payload?: any) => void) => void;
|
|
4098
|
-
off: (event: string, listener: (payload?: any) => void) => void;
|
|
4099
|
-
updateOriginalMutedState: (muted: boolean, volume?: number) => void;
|
|
4100
|
-
getOriginalMutedState: () => boolean;
|
|
4101
|
-
getOriginalVolume: () => number;
|
|
4102
|
-
setAdVolume: (volume: number) => void;
|
|
4103
|
-
getAdVolume: () => number;
|
|
4104
|
-
showPlaceholder: () => void;
|
|
4105
|
-
hidePlaceholder: () => void;
|
|
4106
4092
|
}
|
|
4107
|
-
declare function
|
|
4093
|
+
declare function createAdStormPlayer(contentVideo: HTMLVideoElement, options: AdStormPlayerOptions): AdStormAdLayer;
|
|
4108
4094
|
|
|
4109
|
-
export { type AdBreak, type AdSchedule, type BaseStormcloudPlayerProps, type BrowserInfo, type ClientInfo, type HeartbeatData, IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, type LateJoinPolicy, type OnProgressProps, type OverlayCoordinateSpace, SUPPORTS_DASH, SUPPORTS_HLS, StormcloudPlayer, StormcloudVideoPlayer, StormcloudVideoPlayerComponent, type StormcloudVideoPlayerConfig, type StormcloudVideoPlayerProps, type SwirlOverlay, type SwirlOverlayType, type SwirlScrollerConfig, type TrackingData, type
|
|
4095
|
+
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, type OnProgressProps, type OverlayCoordinateSpace, SUPPORTS_DASH, SUPPORTS_HLS, 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, initializePolyfills, isMediaStream, isOverlayActive, lazy, logBrowserInfo, merge, omit, parseQuery, players, randomString, resolveImageUrl, sendHeartbeat, sendInitialTracking, supportsFeature, supportsModernJS, supportsWebKitPresentationMode, timeStringToSeconds };
|