boss-web-player-sdk 1.1.0

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.
@@ -0,0 +1,693 @@
1
+ import { default as default_2 } from 'react';
2
+ import { JSX } from 'react/jsx-runtime';
3
+
4
+ export declare type AnalyticsCallback = (event: AnalyticsEvent) => void;
5
+
6
+ export declare interface AnalyticsEvent {
7
+ eventType: 'play' | 'pause' | 'seek' | 'ended' | 'complete' | 'buffering_start' | 'buffering_end' | 'stall' | 'quality_change' | 'audio_track_change' | 'volume_change' | 'speed_change' | 'subtitle_change' | 'pip_toggle' | 'fullscreen_enter' | 'fullscreen_exit' | 'cast_start' | 'cast_stop' | 'error' | 'network_error' | 'session_start' | 'video_loaded' | 'first_quartile' | 'midpoint' | 'third_quartile' | 'heartbeat' | 'watch_progress' | 'streaming_time';
8
+ timestamp: number;
9
+ currentTime: number;
10
+ duration: number;
11
+ bitrate?: number;
12
+ rendition?: string;
13
+ fromRendition?: string;
14
+ volume?: number;
15
+ speed?: number;
16
+ errorMessage?: string;
17
+ errorCode?: number;
18
+ sessionId?: string;
19
+ videoId?: string;
20
+ deviceType?: string;
21
+ networkType?: string;
22
+ watchPercentage?: number;
23
+ totalWatchTime?: number;
24
+ streamingTime?: number;
25
+ adWatchTime?: number;
26
+ bufferingCount?: number;
27
+ totalBufferingTime?: number;
28
+ seekFrom?: number;
29
+ pipState?: 'entered' | 'exited';
30
+ }
31
+
32
+ declare class AnalyticsModule {
33
+ private callback?;
34
+ private heartbeatInterval?;
35
+ private watchProgressTimer?;
36
+ private isBuffering;
37
+ private sessionId;
38
+ private videoId;
39
+ private deviceType;
40
+ private networkType;
41
+ private adBreaks;
42
+ private isFirstPlay;
43
+ private watchStartTime;
44
+ private totalWatchTime;
45
+ private streamingWindowStart;
46
+ private streamingTime;
47
+ private isInAdBreak;
48
+ private adWatchWindowStart;
49
+ private adWatchTime;
50
+ private bufferingCount;
51
+ private totalBufferingTime;
52
+ private bufferingStartTime;
53
+ private milestonesHit;
54
+ private lastHeartbeatPosition;
55
+ private lastHeartbeatAt;
56
+ constructor(callback?: AnalyticsCallback, src?: string);
57
+ registerCallback(callback: AnalyticsCallback): void;
58
+ setAdBreaks(adBreaks: Array<{
59
+ startTime: number;
60
+ endTime: number;
61
+ }>): void;
62
+ private getTotalAdDuration;
63
+ private getElapsedAdTime;
64
+ track(eventType: AnalyticsEvent['eventType'], videoEl: HTMLVideoElement, extra?: Partial<AnalyticsEvent>): void;
65
+ startHeartbeat(videoEl: HTMLVideoElement, getExtra: () => Partial<AnalyticsEvent>, watchProgressInterval?: number): void;
66
+ stopHeartbeat(): void;
67
+ setBuffering(isBuffering: boolean, videoEl: HTMLVideoElement, getExtra: () => Partial<AnalyticsEvent>): void;
68
+ setAdBreak(inAdBreak: boolean, videoEl: HTMLVideoElement): void;
69
+ private checkMilestones;
70
+ private checkStall;
71
+ private getTotalWatchTime;
72
+ private getStreamingTime;
73
+ private getAdWatchTime;
74
+ private dispatchRaw;
75
+ private generateSessionId;
76
+ private extractVideoId;
77
+ private getDeviceType;
78
+ private getNetworkType;
79
+ }
80
+
81
+ export declare function BossVideoPlayer({ playerKey, src, subtitles, licenseKey, themeColor, firebaseConfig, proxyDomains, apiBaseUrl, adTrackingUrl, overlayAdUrl, title, watermark, autoplay, muted, autoFullscreen, enableControls, enableSkipAd, skipAdAfterSeconds, chaptersDisplayMode, volumeControlType, subtitleStyle, drmConfig, onAnalyticsEvent, onKeyMomentsLoaded, initialTime, onTimeUpdate, }: BossVideoPlayerProps): JSX.Element;
82
+
83
+ export declare interface BossVideoPlayerProps {
84
+ /** Player key from the GoBOSS dashboard — identifies your tenant. */
85
+ playerKey: string;
86
+ /**
87
+ * Stream source(s) to play.
88
+ * - Pass a single URL string for standard single-stream playback.
89
+ * - Pass an array of `{ label, url }` objects to let the user switch between
90
+ * multiple streams at runtime (e.g. 4K, Dolby, Stereo). The first item plays by default.
91
+ */
92
+ src: string | SourceItem[];
93
+ /**
94
+ * External subtitle tracks (WebVTT/SRT) to load alongside any tracks
95
+ * auto-detected from the M3U8 manifest. Merged into a single subtitle menu.
96
+ */
97
+ subtitles?: SubtitleTrack[];
98
+ /** License key for playback authorization. */
99
+ licenseKey?: string;
100
+ /** Accent color for the player UI (hex). Defaults to '#6366f1'. */
101
+ themeColor?: string;
102
+ /** Firebase config for analytics. */
103
+ firebaseConfig?: FirebaseConfig;
104
+ /**
105
+ * CDN proxy domain mappings as a comma-separated string.
106
+ * Format: "cdn.example.com=/my-proxy,other.cdn.com=/other-proxy"
107
+ * Any request URL matching a domain is rewritten to the proxy path.
108
+ */
109
+ proxyDomains?: string;
110
+ /**
111
+ * Base URL for the GoBOSS API. Defaults to 'https://dev-api.go-boss.com'.
112
+ * Override this if you need to route through a reverse proxy.
113
+ */
114
+ apiBaseUrl?: string;
115
+ /** AWS MediaTailor ad tracking URL for skip-ad flow. */
116
+ adTrackingUrl?: string;
117
+ /** AWS MediaTailor overlay ad tracking URL. */
118
+ overlayAdUrl?: string;
119
+ /** Video title shown in the player UI. */
120
+ title?: string;
121
+ /** Watermark text stamped on the video. */
122
+ watermark?: string;
123
+ autoplay?: boolean;
124
+ muted?: boolean;
125
+ autoFullscreen?: boolean;
126
+ enableControls?: boolean;
127
+ enableSkipAd?: boolean;
128
+ skipAdAfterSeconds?: number;
129
+ chaptersDisplayMode?: 'strip' | 'panel';
130
+ volumeControlType?: 'slider' | 'button';
131
+ subtitleStyle?: SubtitleStyle;
132
+ drmConfig?: DRMConfig;
133
+ /** Called for every analytics event — lets consumers add custom tracking. */
134
+ onAnalyticsEvent?: (event: AnalyticsEvent) => void;
135
+ /** Called when chapter/key-moment data is parsed from the stream. */
136
+ onKeyMomentsLoaded?: (keyMoments: Chapter[]) => void;
137
+ /** Seek to this position (in seconds) when the video is ready. Use for resume-playback. */
138
+ initialTime?: number;
139
+ /** Called on every timeupdate with the current playback position in seconds. Use to persist watch progress. */
140
+ onTimeUpdate?: (currentTime: number) => void;
141
+ }
142
+
143
+ declare class CastingModule {
144
+ private isCasting;
145
+ private castDeviceName;
146
+ private onCastStateChangeCallback?;
147
+ private onRemoteStateChangeCallback?;
148
+ private castContext;
149
+ private remotePlayer;
150
+ private remotePlayerController;
151
+ constructor();
152
+ private initCastApi;
153
+ getCastingState(): {
154
+ isCasting: boolean;
155
+ deviceName: string;
156
+ };
157
+ getRemoteState(): RemoteCastState | null;
158
+ /**
159
+ * Prompts the native Google Cast device picker overlay, then loads media on the remote device.
160
+ * The caller is responsible for pausing local playback before/after this resolves.
161
+ */
162
+ requestSession(currentSrc: string, currentTime: number): Promise<void>;
163
+ /**
164
+ * Disconnects the current cast session.
165
+ */
166
+ stopCasting(): void;
167
+ remotePlayPause(): void;
168
+ remoteSeek(time: number): void;
169
+ remoteSetVolume(volume: number): void;
170
+ remoteSetMute(muted: boolean): void;
171
+ onCastStateChange(callback: (isCasting: boolean, deviceName: string) => void): void;
172
+ onRemoteStateChange(callback: (state: RemoteCastState) => void): void;
173
+ requestAirPlaySession(videoElement: HTMLVideoElement): void;
174
+ stopAirPlay(videoElement: HTMLVideoElement): void;
175
+ isAirPlayAvailable(): boolean;
176
+ }
177
+
178
+ export declare interface Chapter {
179
+ title: string;
180
+ startTime: number;
181
+ endTime: number;
182
+ thumbnail?: string;
183
+ description?: string;
184
+ }
185
+
186
+ declare class ChaptersModule extends KeyMomentsModule {
187
+ }
188
+
189
+ /**
190
+ * Mounts the full video player into any DOM element.
191
+ * Identical to <BossVideoPlayer> — handles player key validation, feature gating,
192
+ * session tracking, and heartbeat automatically.
193
+ *
194
+ * Use this in Vue, Angular, Vanilla JS, or any environment where JSX is unavailable.
195
+ *
196
+ * @example Vanilla JS
197
+ * const player = createPlayer(document.getElementById('player'), {
198
+ * playerKey: 'bsp_abc123',
199
+ * src: 'https://my-cdn.com/video.m3u8',
200
+ * });
201
+ * player.destroy(); // cleanup
202
+ *
203
+ * @example Vue 3
204
+ * const player = createPlayer(containerRef.value, { playerKey: 'bsp_abc123', src: props.src });
205
+ * onUnmounted(() => player.destroy());
206
+ *
207
+ * @example Angular
208
+ * const player = createPlayer(this.containerRef.nativeElement, { playerKey: 'bsp_abc123', src: this.src });
209
+ * ngOnDestroy() { this.player.destroy(); }
210
+ */
211
+ export declare function createPlayer(container: HTMLElement, props: PlayerProps): PlayerInstance;
212
+
213
+ export declare interface DRMConfig {
214
+ widevineLicenseUrl?: string;
215
+ playreadyLicenseUrl?: string;
216
+ fairplayLicenseUrl?: string;
217
+ authToken?: string;
218
+ authHeader?: string;
219
+ allowedDomains?: string[];
220
+ watermarkText?: string;
221
+ }
222
+
223
+ declare class DRMModule {
224
+ private config?;
225
+ private watermarkElement?;
226
+ private floatInterval?;
227
+ constructor(config?: DRMConfig);
228
+ /**
229
+ * Validates if the active origin domain is permitted to load this stream asset.
230
+ */
231
+ validateDomain(currentDomain: string): boolean;
232
+ getAuthToken(): string | undefined;
233
+ getAuthHeader(): string | undefined;
234
+ getRequestHeaders(): Record<string, string>;
235
+ /**
236
+ * Injects an animated floating watermark on top of the media container to obstruct piracy or recording.
237
+ */
238
+ setupWatermark(container: HTMLElement): void;
239
+ /**
240
+ * Cleans up active watermarks.
241
+ */
242
+ removeWatermark(): void;
243
+ isDRMProtected(): boolean;
244
+ getDRMDetails(): {
245
+ widevine: string | null;
246
+ playready: string | null;
247
+ fairplay: string | null;
248
+ authTokenPresent: boolean;
249
+ allowedDomains: string[];
250
+ };
251
+ }
252
+
253
+ export declare function endSession(playerKey: string, sessionId: string, apiBase?: string): Promise<void>;
254
+
255
+ export declare type FeatureFlags = {
256
+ m3u8_playback: boolean;
257
+ subtitle_support: boolean;
258
+ playback_speed: boolean;
259
+ airplay: boolean;
260
+ chromecast: boolean;
261
+ picture_in_picture: boolean;
262
+ multiple_resolution: boolean;
263
+ multiple_audio: boolean;
264
+ key_moments: boolean;
265
+ drm_protection: boolean;
266
+ screen_recording_prevention: boolean;
267
+ signal_strength: boolean;
268
+ ad_support: boolean;
269
+ };
270
+
271
+ /**
272
+ * Sends all player analytics events to Firebase Analytics (GA4).
273
+ *
274
+ * Events appear in:
275
+ * Firebase Console → Analytics → Events (24-48 hr aggregated view)
276
+ * Firebase Console → Analytics → DebugView (real-time while testing)
277
+ * Google Analytics 4 → Reports → Realtime (within a few minutes)
278
+ *
279
+ * No Firestore / database setup required — Firebase Analytics handles all storage.
280
+ */
281
+ export declare class FirebaseAnalyticsProvider {
282
+ private analytics;
283
+ private logEventFn;
284
+ private pendingEvents;
285
+ constructor(config: FirebaseConfig);
286
+ private init;
287
+ private flushPending;
288
+ createCallback(): AnalyticsCallback;
289
+ private handleEvent;
290
+ private logToFirebase;
291
+ private buildParams;
292
+ destroy(): Promise<void>;
293
+ }
294
+
295
+ export declare interface FirebaseConfig {
296
+ apiKey: string;
297
+ authDomain: string;
298
+ projectId: string;
299
+ storageBucket: string;
300
+ messagingSenderId: string;
301
+ appId: string;
302
+ measurementId?: string;
303
+ }
304
+
305
+ export declare function initSdk(playerKey: string, apiBase?: string): Promise<SdkInitResponse>;
306
+
307
+ export declare type KeyMoment = Chapter;
308
+
309
+ declare class KeyMomentsModule {
310
+ private keyMoments;
311
+ private currentMomentIndex;
312
+ private onMomentChangeCallback?;
313
+ constructor(keyMoments?: KeyMoment[]);
314
+ /**
315
+ * Sorts and stores the key moments.
316
+ */
317
+ setKeyMoments(keyMoments: KeyMoment[]): void;
318
+ getKeyMoments(): KeyMoment[];
319
+ /**
320
+ * Locates the key moment corresponding to the active playback timestamp.
321
+ */
322
+ getCurrentMoment(currentTime: number): {
323
+ keyMoment: KeyMoment | null;
324
+ index: number;
325
+ };
326
+ /**
327
+ * Evaluates if playback has crossed a key moment boundary.
328
+ */
329
+ updateTime(currentTime: number): void;
330
+ /**
331
+ * Subscribes a callback to change events.
332
+ */
333
+ onMomentChange(callback: (keyMoment: KeyMoment | null, index: number) => void): void;
334
+ setChapters(chapters: KeyMoment[]): void;
335
+ getChapters(): KeyMoment[];
336
+ getCurrentChapter(currentTime: number): {
337
+ chapter: KeyMoment | null;
338
+ index: number;
339
+ };
340
+ onChapterChange(callback: (chapter: KeyMoment | null, index: number) => void): void;
341
+ }
342
+
343
+ export declare interface PlayerInstance {
344
+ /** Re-render the player with updated props (src change, theme, etc.) */
345
+ update(props: Partial<PlayerProps>): void;
346
+ /** Unmounts the player and releases all resources */
347
+ destroy(): void;
348
+ }
349
+
350
+ export declare interface PlayerProps extends BossVideoPlayerProps {
351
+ }
352
+
353
+ export declare interface PlayerSDKOptions {
354
+ container: HTMLElement;
355
+ src: string;
356
+ autoplay?: boolean;
357
+ muted?: boolean;
358
+ controls?: boolean;
359
+ chapters?: Chapter[];
360
+ keyMoments?: KeyMoment[];
361
+ subtitles?: SubtitleTrack[];
362
+ thumbnails?: ThumbnailConfig;
363
+ drm?: DRMConfig;
364
+ analyticsCallback?: AnalyticsCallback;
365
+ watchProgressInterval?: number;
366
+ themeColor?: string;
367
+ watermark?: string;
368
+ /**
369
+ * Optional URL transformer applied to every HLS segment/manifest request.
370
+ * Use this to route requests through a CORS proxy without hardcoding domains.
371
+ * Example: (url) => url.replace('https://cdn.example.com', '/my-proxy')
372
+ */
373
+ urlTransformer?: (url: string) => string;
374
+ }
375
+
376
+ declare interface RemoteCastState {
377
+ currentTime: number;
378
+ duration: number;
379
+ isPaused: boolean;
380
+ volumeLevel: number;
381
+ isMuted: boolean;
382
+ }
383
+
384
+ export declare type SdkInitData = {
385
+ tenantId: string;
386
+ features: SdkInitFeatures;
387
+ planTier: string;
388
+ };
389
+
390
+ export declare type SdkInitFeatures = {
391
+ subtitles: boolean;
392
+ ads: boolean;
393
+ chapterMarkers: boolean;
394
+ [key: string]: boolean;
395
+ };
396
+
397
+ export declare type SdkInitResponse = {
398
+ result: {
399
+ data: SdkInitData;
400
+ metadata: Record<string, unknown>;
401
+ };
402
+ };
403
+
404
+ export declare type SdkPackage = {
405
+ package: string;
406
+ is_active: boolean;
407
+ features: FeatureFlags;
408
+ limits: {
409
+ streaming_minutes: number;
410
+ };
411
+ };
412
+
413
+ export declare function sendHeartbeat(playerKey: string, sessionId: string, currentTime: number, duration: number, apiBase?: string): Promise<void>;
414
+
415
+ export declare interface SourceItem {
416
+ label: string;
417
+ url: string;
418
+ }
419
+
420
+ export declare function startSession(playerKey: string, sessionId: string, videoId: string, apiBase?: string): Promise<void>;
421
+
422
+ declare class SubtitlesModule {
423
+ private tracks;
424
+ private activeTrackId;
425
+ private currentCues;
426
+ private activeText;
427
+ private onSubtitleChangeCallback?;
428
+ private onTrackSwitchCallback?;
429
+ constructor(tracks?: SubtitleTrack[]);
430
+ getTracks(): SubtitleTrack[];
431
+ getActiveTrackId(): string;
432
+ setHlsTracks(hlsTracks: SubtitleTrack[]): void;
433
+ addTrack(track: SubtitleTrack): void;
434
+ onTrackSwitch(callback: (track: SubtitleTrack | null) => void): void;
435
+ setCustomSubtitleText(text: string): void;
436
+ /**
437
+ * Switches the active track. Fetches external tracks if they need loading.
438
+ */
439
+ setActiveTrack(trackId: string): Promise<void>;
440
+ /**
441
+ * Scans the subtitle cues for the current playback position.
442
+ */
443
+ updateTime(currentTime: number): void;
444
+ /**
445
+ * Triggers the text update callback if a change in caption is detected.
446
+ */
447
+ private updateActiveText;
448
+ onSubtitleChange(callback: (text: string) => void): void;
449
+ /**
450
+ * Robust parser supporting WebVTT and SRT formats.
451
+ */
452
+ private parseVttOrSrt;
453
+ }
454
+
455
+ export declare interface SubtitleStyle {
456
+ size?: 'small' | 'medium' | 'large';
457
+ background?: 'none' | 'dim' | 'solid';
458
+ color?: string;
459
+ }
460
+
461
+ declare interface SubtitleStyle_2 {
462
+ size?: 'small' | 'medium' | 'large';
463
+ background?: 'none' | 'dim' | 'solid';
464
+ color?: string;
465
+ }
466
+
467
+ export declare interface SubtitleTrack {
468
+ id: string;
469
+ label: string;
470
+ lang: string;
471
+ src?: string;
472
+ isDefault?: boolean;
473
+ cues?: Array<{
474
+ startTime: number;
475
+ endTime: number;
476
+ text: string;
477
+ }>;
478
+ isHls?: boolean;
479
+ hlsTrackId?: number;
480
+ isNative?: boolean;
481
+ nativeTrackIndex?: number;
482
+ }
483
+
484
+ export declare interface ThumbnailConfig {
485
+ spriteUrl: string;
486
+ tileWidth: number;
487
+ tileHeight: number;
488
+ columns: number;
489
+ rows: number;
490
+ interval: number;
491
+ totalCount: number;
492
+ }
493
+
494
+ declare class ThumbnailsModule {
495
+ private config?;
496
+ constructor(config?: ThumbnailConfig);
497
+ /**
498
+ * Calculates the position offset inside the sprite sheet for a given seek hover time.
499
+ */
500
+ getThumbnail(time: number): {
501
+ url: string;
502
+ x: number;
503
+ y: number;
504
+ width: number;
505
+ height: number;
506
+ } | null;
507
+ hasThumbnails(): boolean;
508
+ }
509
+
510
+ export declare class VideoPlayerSDK {
511
+ private options;
512
+ private videoElement;
513
+ private hlsInstance;
514
+ private dashInstance;
515
+ private activeQuality;
516
+ private qualityLevels;
517
+ analytics: AnalyticsModule;
518
+ keyMoments: KeyMomentsModule;
519
+ chapters: ChaptersModule;
520
+ subtitles: SubtitlesModule;
521
+ drm: DRMModule;
522
+ casting: CastingModule;
523
+ thumbnails: ThumbnailsModule;
524
+ private hlsSubtitleCues;
525
+ private hlsActiveSubtitleKey;
526
+ private audioTrackList;
527
+ private adBreaks;
528
+ private isAdBreak;
529
+ private contentPlaybackRate;
530
+ private networkErrorRetries;
531
+ private mediaErrorRecovered;
532
+ private static readonly MAX_NETWORK_RETRIES;
533
+ private eventListeners;
534
+ constructor(options: PlayerSDKOptions);
535
+ /**
536
+ * Builds the video DOM hierarchy, binds events, validates domain restrictions, and mounts DRM watermarks.
537
+ */
538
+ private initializePlayer;
539
+ /**
540
+ * Binds direct event listeners to the native HTML5 Video tag, routing them to our sub-packages.
541
+ */
542
+ private bindMediaEvents;
543
+ private rewriteToProxy;
544
+ /**
545
+ * Initializes HLS adaptive streaming through Hls.js or falls back to native browser playback.
546
+ */
547
+ private loadSource;
548
+ /**
549
+ * Sets up global lock-screen metadata and media control keys (Media Session API).
550
+ */
551
+ private setupBackgroundControls;
552
+ play(): void;
553
+ pause(): void;
554
+ seek(seconds: number): void;
555
+ setVolume(volume: number): void;
556
+ setMute(muted: boolean): void;
557
+ setPlaybackRate(rate: number): void;
558
+ /**
559
+ * Sets manual video quality rendition or switches back to auto bitrate scaling.
560
+ */
561
+ setQuality(qualityId: number): void;
562
+ /**
563
+ * Activates native Picture-in-Picture floating viewport.
564
+ */
565
+ togglePictureInPicture(): Promise<boolean>;
566
+ /**
567
+ * Requests element-level fullscreen.
568
+ */
569
+ toggleFullscreen(): void;
570
+ getVideoElement(): HTMLVideoElement;
571
+ getCurrentTime(): number;
572
+ getDuration(): number;
573
+ getVolume(): number;
574
+ isMuted(): boolean;
575
+ getPlaybackRate(): number;
576
+ getActiveQuality(): VideoQuality;
577
+ getQualityLevels(): VideoQuality[];
578
+ getBufferLength(): number;
579
+ getBufferedRanges(): Array<{
580
+ start: number;
581
+ end: number;
582
+ }>;
583
+ /**
584
+ * Returns true if the browser can decode at least one of the manifest's renditions.
585
+ *
586
+ * Deliberately conservative to avoid ever blocking a valid stream:
587
+ * - A codec that isn't declared is treated as playable (we never assume unsupported).
588
+ * - Any failure to verify (no MediaSource, isTypeSupported throws) returns true.
589
+ * - The stream is "playable" if even one rendition's declared codecs are all supported,
590
+ * matching how HLS.js itself selects a level.
591
+ * Returns false only when the browser explicitly reports every declared codec as
592
+ * undecodable (e.g. Dolby EC-3/AC-3 in Chrome).
593
+ */
594
+ private hasPlayableLevel;
595
+ private getAnalyticsPayload;
596
+ on(event: string, callback: (...args: any[]) => void): void;
597
+ off(event: string, callback: (...args: any[]) => void): void;
598
+ private emit;
599
+ private extractSubtitlesFromManifest;
600
+ private extractKeyMomentsFromManifest;
601
+ private extractAdBreaksFromManifest;
602
+ private buildManifestUrl;
603
+ private findFirstVariantUri;
604
+ private resolveUrl;
605
+ private parseAdBreaksFromFragments;
606
+ private parseAdBreaksFromPlaylist;
607
+ private isTimeInAdBreak;
608
+ getAdBreaks(): Array<{
609
+ startTime: number;
610
+ endTime: number;
611
+ }>;
612
+ setAdBreaks(breaks: Array<{
613
+ startTime: number;
614
+ endTime: number;
615
+ }>): void;
616
+ isInAdBreak(): boolean;
617
+ getAudioTracks(): Array<{
618
+ id: number;
619
+ label: string;
620
+ lang: string;
621
+ }>;
622
+ setAudioTrack(id: number): void;
623
+ destroy(): void;
624
+ }
625
+
626
+ export declare interface VideoQuality {
627
+ id: number;
628
+ height: number;
629
+ width: number;
630
+ bitrate: number;
631
+ label: string;
632
+ }
633
+
634
+ export declare const WebVideoPlayer: default_2.FC<WebVideoPlayerProps>;
635
+
636
+ declare interface WebVideoPlayerProps {
637
+ src: string;
638
+ autoplay?: boolean;
639
+ muted?: boolean;
640
+ chapters?: Chapter[];
641
+ keyMoments?: KeyMoment[];
642
+ subtitles?: SubtitleTrack[];
643
+ watermark?: string;
644
+ themeColor?: string;
645
+ drmConfig?: any;
646
+ firebaseConfig?: FirebaseConfig;
647
+ onAnalyticsEvent?: (event: AnalyticsEvent) => void;
648
+ onAdBreakChange?: (active: boolean) => void;
649
+ onKeyMomentsLoaded?: (keyMoments: KeyMoment[]) => void;
650
+ enableControls?: boolean;
651
+ enableChromecast?: boolean;
652
+ enableKeyMoments?: boolean;
653
+ enableSubtitles?: boolean;
654
+ enableQuality?: boolean;
655
+ enablePlaybackSpeed?: boolean;
656
+ enablePiP?: boolean;
657
+ enableFullscreen?: boolean;
658
+ autoFullscreen?: boolean;
659
+ watchProgressInterval?: number;
660
+ subtitleStyle?: SubtitleStyle_2;
661
+ /**
662
+ * Pre-resolved entitlement package from BossVideoPlayer.
663
+ * When provided, features are determined exclusively by this package (API mode).
664
+ * When absent, features fall back to explicit props with true defaults (standalone mode).
665
+ */
666
+ resolvedEntitlement?: {
667
+ package: string;
668
+ is_active: boolean;
669
+ features: Record<string, boolean>;
670
+ limits: {
671
+ streaming_minutes: number;
672
+ };
673
+ } | null;
674
+ licenseKey?: string | null;
675
+ title?: string;
676
+ chaptersDisplayMode?: 'strip' | 'panel';
677
+ volumeControlType?: 'slider' | 'button';
678
+ urlTransformer?: (url: string) => string;
679
+ pauseAdOnTabSwitch?: boolean;
680
+ enableSkipAd?: boolean;
681
+ skipAdAfterSeconds?: number;
682
+ overlayAdUrl?: string;
683
+ adTrackingUrl?: string;
684
+ sources?: SourceItem[];
685
+ activeSourceIndex?: number;
686
+ onSourceChange?: (index: number) => void;
687
+ /** Seek to this position (in seconds) as soon as the video is ready. Use for resume-playback. */
688
+ initialTime?: number;
689
+ /** Called on every timeupdate with the current playback position in seconds. Use to persist watch progress. */
690
+ onTimeUpdate?: (currentTime: number) => void;
691
+ }
692
+
693
+ export { }