stormcloud-video-player 0.2.4 → 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/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;
@@ -92,6 +101,9 @@ declare class StormcloudVideoPlayer {
92
101
  private totalAdsInBreak;
93
102
  private showAds;
94
103
  private isLiveStream;
104
+ private preloadedAdInfo;
105
+ private currentAdBreakTargetDurationMs;
106
+ private cumulativeAdDurationMs;
95
107
  constructor(config: StormcloudVideoPlayerConfig);
96
108
  load(): Promise<void>;
97
109
  private attach;
@@ -113,6 +125,16 @@ declare class StormcloudVideoPlayer {
113
125
  getTotalAdsInBreak(): number;
114
126
  isAdPlaying(): boolean;
115
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[];
116
138
  getStreamType(): "hls" | "other";
117
139
  shouldShowNativeControls(): boolean;
118
140
  private shouldContinueLiveStreamDuringAds;
@@ -129,9 +151,16 @@ declare class StormcloudVideoPlayer {
129
151
  private updatePtsDrift;
130
152
  private playSingleAd;
131
153
  private handleAdFailure;
154
+ private endAdBreak;
155
+ private shouldContinueAdBreak;
156
+ private canRequestMoreAds;
157
+ private requestAdditionalAds;
132
158
  private startAdFailsafeTimer;
133
159
  private clearAdFailsafeTimer;
134
160
  private selectVastTagsForBreak;
161
+ private buildAdQueueForDuration;
162
+ private getEstimatedAdDuration;
163
+ private getAdInfoForQueue;
135
164
  private getRemainingAdMs;
136
165
  private findBreakForTime;
137
166
  toggleMute(): 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;
@@ -92,6 +101,9 @@ declare class StormcloudVideoPlayer {
92
101
  private totalAdsInBreak;
93
102
  private showAds;
94
103
  private isLiveStream;
104
+ private preloadedAdInfo;
105
+ private currentAdBreakTargetDurationMs;
106
+ private cumulativeAdDurationMs;
95
107
  constructor(config: StormcloudVideoPlayerConfig);
96
108
  load(): Promise<void>;
97
109
  private attach;
@@ -113,6 +125,16 @@ declare class StormcloudVideoPlayer {
113
125
  getTotalAdsInBreak(): number;
114
126
  isAdPlaying(): boolean;
115
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[];
116
138
  getStreamType(): "hls" | "other";
117
139
  shouldShowNativeControls(): boolean;
118
140
  private shouldContinueLiveStreamDuringAds;
@@ -129,9 +151,16 @@ declare class StormcloudVideoPlayer {
129
151
  private updatePtsDrift;
130
152
  private playSingleAd;
131
153
  private handleAdFailure;
154
+ private endAdBreak;
155
+ private shouldContinueAdBreak;
156
+ private canRequestMoreAds;
157
+ private requestAdditionalAds;
132
158
  private startAdFailsafeTimer;
133
159
  private clearAdFailsafeTimer;
134
160
  private selectVastTagsForBreak;
161
+ private buildAdQueueForDuration;
162
+ private getEstimatedAdDuration;
163
+ private getAdInfoForQueue;
135
164
  private getRemainingAdMs;
136
165
  private findBreakForTime;
137
166
  toggleMute(): void;