stormcloud-video-player 0.2.3 → 0.2.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 +2 -2
- package/lib/index.cjs +523 -74
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +32 -0
- package/lib/index.d.ts +32 -0
- package/lib/index.js +523 -74
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +105 -18
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +3 -0
- package/lib/players/HlsPlayer.cjs +105 -18
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +105 -18
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/ima.cjs +56 -16
- package/lib/sdk/ima.cjs.map +1 -1
- package/lib/sdk/ima.d.cts +3 -1
- package/lib/types-DOcCdwQI.d.cts +78 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +171 -21
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -28,6 +28,15 @@ interface StormcloudVideoPlayerConfig {
|
|
|
28
28
|
onFullscreenToggle?: () => void;
|
|
29
29
|
onControlClick?: () => void;
|
|
30
30
|
licenseKey?: string;
|
|
31
|
+
adBreakGapToleranceMs?: number;
|
|
32
|
+
maxAdsPerBreak?: number;
|
|
33
|
+
minAdDurationMs?: number;
|
|
34
|
+
enableAdPreloading?: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface AdInfo {
|
|
37
|
+
duration: number;
|
|
38
|
+
vastTagUrl: string;
|
|
39
|
+
isPreloaded: boolean;
|
|
31
40
|
}
|
|
32
41
|
interface ClientInfo {
|
|
33
42
|
brand: string;
|
|
@@ -91,6 +100,10 @@ declare class StormcloudVideoPlayer {
|
|
|
91
100
|
private currentAdIndex;
|
|
92
101
|
private totalAdsInBreak;
|
|
93
102
|
private showAds;
|
|
103
|
+
private isLiveStream;
|
|
104
|
+
private preloadedAdInfo;
|
|
105
|
+
private currentAdBreakTargetDurationMs;
|
|
106
|
+
private cumulativeAdDurationMs;
|
|
94
107
|
constructor(config: StormcloudVideoPlayerConfig);
|
|
95
108
|
load(): Promise<void>;
|
|
96
109
|
private attach;
|
|
@@ -112,8 +125,19 @@ declare class StormcloudVideoPlayer {
|
|
|
112
125
|
getTotalAdsInBreak(): number;
|
|
113
126
|
isAdPlaying(): boolean;
|
|
114
127
|
isShowingAds(): boolean;
|
|
128
|
+
getAdBreakStats(): {
|
|
129
|
+
isInAdBreak: boolean;
|
|
130
|
+
currentAdIndex: number;
|
|
131
|
+
totalAdsInBreak: number;
|
|
132
|
+
targetDurationMs: number | undefined;
|
|
133
|
+
cumulativeDurationMs: number;
|
|
134
|
+
estimatedFillRate: number | undefined;
|
|
135
|
+
remainingDurationMs: number | undefined;
|
|
136
|
+
};
|
|
137
|
+
getPreloadedAdInfo(): AdInfo[];
|
|
115
138
|
getStreamType(): "hls" | "other";
|
|
116
139
|
shouldShowNativeControls(): boolean;
|
|
140
|
+
private shouldContinueLiveStreamDuringAds;
|
|
117
141
|
loadDefaultVastFromAdstorm(adstormApiUrl: string, params?: Record<string, string>): Promise<void>;
|
|
118
142
|
private handleAdStart;
|
|
119
143
|
private findCurrentOrNextBreak;
|
|
@@ -127,15 +151,23 @@ declare class StormcloudVideoPlayer {
|
|
|
127
151
|
private updatePtsDrift;
|
|
128
152
|
private playSingleAd;
|
|
129
153
|
private handleAdFailure;
|
|
154
|
+
private endAdBreak;
|
|
155
|
+
private shouldContinueAdBreak;
|
|
156
|
+
private canRequestMoreAds;
|
|
157
|
+
private requestAdditionalAds;
|
|
130
158
|
private startAdFailsafeTimer;
|
|
131
159
|
private clearAdFailsafeTimer;
|
|
132
160
|
private selectVastTagsForBreak;
|
|
161
|
+
private buildAdQueueForDuration;
|
|
162
|
+
private getEstimatedAdDuration;
|
|
163
|
+
private getAdInfoForQueue;
|
|
133
164
|
private getRemainingAdMs;
|
|
134
165
|
private findBreakForTime;
|
|
135
166
|
toggleMute(): void;
|
|
136
167
|
toggleFullscreen(): Promise<void>;
|
|
137
168
|
isMuted(): boolean;
|
|
138
169
|
isFullscreen(): boolean;
|
|
170
|
+
isLive(): boolean;
|
|
139
171
|
get videoElement(): HTMLVideoElement;
|
|
140
172
|
resize(): void;
|
|
141
173
|
destroy(): void;
|
package/lib/index.d.ts
CHANGED
|
@@ -28,6 +28,15 @@ interface StormcloudVideoPlayerConfig {
|
|
|
28
28
|
onFullscreenToggle?: () => void;
|
|
29
29
|
onControlClick?: () => void;
|
|
30
30
|
licenseKey?: string;
|
|
31
|
+
adBreakGapToleranceMs?: number;
|
|
32
|
+
maxAdsPerBreak?: number;
|
|
33
|
+
minAdDurationMs?: number;
|
|
34
|
+
enableAdPreloading?: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface AdInfo {
|
|
37
|
+
duration: number;
|
|
38
|
+
vastTagUrl: string;
|
|
39
|
+
isPreloaded: boolean;
|
|
31
40
|
}
|
|
32
41
|
interface ClientInfo {
|
|
33
42
|
brand: string;
|
|
@@ -91,6 +100,10 @@ declare class StormcloudVideoPlayer {
|
|
|
91
100
|
private currentAdIndex;
|
|
92
101
|
private totalAdsInBreak;
|
|
93
102
|
private showAds;
|
|
103
|
+
private isLiveStream;
|
|
104
|
+
private preloadedAdInfo;
|
|
105
|
+
private currentAdBreakTargetDurationMs;
|
|
106
|
+
private cumulativeAdDurationMs;
|
|
94
107
|
constructor(config: StormcloudVideoPlayerConfig);
|
|
95
108
|
load(): Promise<void>;
|
|
96
109
|
private attach;
|
|
@@ -112,8 +125,19 @@ declare class StormcloudVideoPlayer {
|
|
|
112
125
|
getTotalAdsInBreak(): number;
|
|
113
126
|
isAdPlaying(): boolean;
|
|
114
127
|
isShowingAds(): boolean;
|
|
128
|
+
getAdBreakStats(): {
|
|
129
|
+
isInAdBreak: boolean;
|
|
130
|
+
currentAdIndex: number;
|
|
131
|
+
totalAdsInBreak: number;
|
|
132
|
+
targetDurationMs: number | undefined;
|
|
133
|
+
cumulativeDurationMs: number;
|
|
134
|
+
estimatedFillRate: number | undefined;
|
|
135
|
+
remainingDurationMs: number | undefined;
|
|
136
|
+
};
|
|
137
|
+
getPreloadedAdInfo(): AdInfo[];
|
|
115
138
|
getStreamType(): "hls" | "other";
|
|
116
139
|
shouldShowNativeControls(): boolean;
|
|
140
|
+
private shouldContinueLiveStreamDuringAds;
|
|
117
141
|
loadDefaultVastFromAdstorm(adstormApiUrl: string, params?: Record<string, string>): Promise<void>;
|
|
118
142
|
private handleAdStart;
|
|
119
143
|
private findCurrentOrNextBreak;
|
|
@@ -127,15 +151,23 @@ declare class StormcloudVideoPlayer {
|
|
|
127
151
|
private updatePtsDrift;
|
|
128
152
|
private playSingleAd;
|
|
129
153
|
private handleAdFailure;
|
|
154
|
+
private endAdBreak;
|
|
155
|
+
private shouldContinueAdBreak;
|
|
156
|
+
private canRequestMoreAds;
|
|
157
|
+
private requestAdditionalAds;
|
|
130
158
|
private startAdFailsafeTimer;
|
|
131
159
|
private clearAdFailsafeTimer;
|
|
132
160
|
private selectVastTagsForBreak;
|
|
161
|
+
private buildAdQueueForDuration;
|
|
162
|
+
private getEstimatedAdDuration;
|
|
163
|
+
private getAdInfoForQueue;
|
|
133
164
|
private getRemainingAdMs;
|
|
134
165
|
private findBreakForTime;
|
|
135
166
|
toggleMute(): void;
|
|
136
167
|
toggleFullscreen(): Promise<void>;
|
|
137
168
|
isMuted(): boolean;
|
|
138
169
|
isFullscreen(): boolean;
|
|
170
|
+
isLive(): boolean;
|
|
139
171
|
get videoElement(): HTMLVideoElement;
|
|
140
172
|
resize(): void;
|
|
141
173
|
destroy(): void;
|