boss-web-player-sdk 2.0.1 → 2.0.2
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/LICENSE +21 -21
- package/README.md +366 -366
- package/dist/boss-web-player-sdk.css +1 -1
- package/dist/chunks/{src-B9W4IMGS.cjs → src-CWZEcSuf.cjs} +1 -1
- package/dist/chunks/{src-QXXVFxiP.js → src-iIPWY3xk.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +11 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +65 -9
- package/dist/index.js +47 -46
- package/package.json +68 -68
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ declare interface AnalyticsSessionSnapshot {
|
|
|
53
53
|
milestonesHit: string[];
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export declare function BossVideoPlayer({ playerKey, src, subtitles, licenseKey, themeColor, proxyDomains, apiBaseUrl, adTrackingUrl, overlayAdUrl, videoId: videoIdProp, title, artworkUrl, watermark, autoplay, muted, autoFullscreen, enableControls, enableSkipAd, skipAdAfterSeconds, chaptersDisplayMode, keyMoments: propKeyMoments, chapters: propChapters, keyMomentsTray, keyMomentsPosition, defaultKeyMomentsOpen, enableKeyMoments, onKeyMomentsToggle, volumeControlType, subtitleStyle, drmConfig, onAnalyticsEvent, delegate, onKeyMomentsLoaded, initialTime, onTimeUpdate, skipMarkers, introStartTime, introEndTime, hasNextEpisode, outroStartTime, nextEpisodeLabel, onNextEpisode, nextEpisodeAutoAdvanceSeconds, nextEpisodeThumbnailUrl, featureOverrides, enableQuality, enableSources, }: BossVideoPlayerProps): JSX.Element;
|
|
56
|
+
export declare function BossVideoPlayer({ playerKey, src, subtitles, licenseKey, themeColor, adAccentColor: adAccentColorProp, playerThemeColor: playerThemeColorProp, chapterTitle: chapterTitleProp, enableFullscreen: enableFullscreenProp, enableThumbnailPreview: enableThumbnailPreviewProp, proxyDomains, apiBaseUrl, adTrackingUrl, overlayAdUrl, videoId: videoIdProp, title, artworkUrl, watermark, autoplay, muted, autoFullscreen, enableControls, enableSkipAd, skipAdAfterSeconds, chaptersDisplayMode, keyMoments: propKeyMoments, chapters: propChapters, keyMomentsTray, keyMomentsPosition, defaultKeyMomentsOpen, enableKeyMoments, onKeyMomentsToggle, volumeControlType, subtitleStyle, drmConfig, onAnalyticsEvent, delegate, onKeyMomentsLoaded, initialTime, onTimeUpdate, skipMarkers, introStartTime, introEndTime, hasNextEpisode, outroStartTime, nextEpisodeLabel, onNextEpisode, nextEpisodeAutoAdvanceSeconds, nextEpisodeThumbnailUrl, featureOverrides, enableQuality, enableSources, }: BossVideoPlayerProps): JSX.Element;
|
|
57
57
|
|
|
58
58
|
export declare interface BossVideoPlayerProps {
|
|
59
59
|
playerKey: string;
|
|
@@ -62,6 +62,11 @@ export declare interface BossVideoPlayerProps {
|
|
|
62
62
|
subtitles?: SubtitleTrack[];
|
|
63
63
|
licenseKey?: string;
|
|
64
64
|
themeColor?: string;
|
|
65
|
+
adAccentColor?: string | null;
|
|
66
|
+
playerThemeColor?: string | null;
|
|
67
|
+
chapterTitle?: string;
|
|
68
|
+
enableFullscreen?: boolean;
|
|
69
|
+
enableThumbnailPreview?: boolean;
|
|
65
70
|
proxyDomains?: string;
|
|
66
71
|
apiBaseUrl?: string;
|
|
67
72
|
adTrackingUrl?: string;
|
|
@@ -76,15 +81,15 @@ export declare interface BossVideoPlayerProps {
|
|
|
76
81
|
enableControls?: boolean;
|
|
77
82
|
enableSkipAd?: boolean;
|
|
78
83
|
skipAdAfterSeconds?: number;
|
|
79
|
-
chaptersDisplayMode?:
|
|
84
|
+
chaptersDisplayMode?: "strip" | "panel";
|
|
80
85
|
keyMoments?: KeyMoment[];
|
|
81
86
|
chapters?: Chapter[];
|
|
82
|
-
keyMomentsTray?:
|
|
83
|
-
keyMomentsPosition?:
|
|
87
|
+
keyMomentsTray?: "bottom" | "right" | "strip" | "panel" | "none" | boolean;
|
|
88
|
+
keyMomentsPosition?: "bottom" | "right";
|
|
84
89
|
defaultKeyMomentsOpen?: boolean;
|
|
85
90
|
enableKeyMoments?: boolean;
|
|
86
91
|
onKeyMomentsToggle?: (isOpen: boolean) => void;
|
|
87
|
-
volumeControlType?:
|
|
92
|
+
volumeControlType?: "slider" | "button";
|
|
88
93
|
subtitleStyle?: SubtitleStyle;
|
|
89
94
|
drmConfig?: DRMConfig;
|
|
90
95
|
onAnalyticsEvent?: (event: AnalyticsEvent) => void;
|
|
@@ -107,14 +112,16 @@ export declare interface BossVideoPlayerProps {
|
|
|
107
112
|
|
|
108
113
|
declare interface CastCustomData {
|
|
109
114
|
headers?: Record<string, string>;
|
|
110
|
-
watermark?: string;
|
|
111
115
|
externalSubtitles?: Array<{
|
|
112
116
|
id: string;
|
|
113
117
|
label: string;
|
|
114
118
|
language: string;
|
|
115
119
|
src: string;
|
|
116
120
|
}>;
|
|
121
|
+
selectedSubtitle?: CastTrackRef | null;
|
|
117
122
|
adTrackingUrl?: string;
|
|
123
|
+
themeColor?: string;
|
|
124
|
+
adAccentColor?: string;
|
|
118
125
|
}
|
|
119
126
|
|
|
120
127
|
declare interface CastTrackRef {
|
|
@@ -135,6 +142,12 @@ export declare interface Chapter {
|
|
|
135
142
|
|
|
136
143
|
export declare function createPlayer(container: HTMLElement, props: PlayerProps): PlayerInstance;
|
|
137
144
|
|
|
145
|
+
export declare const DEFAULT_AD_ACCENT_COLOR = "#ead81a";
|
|
146
|
+
|
|
147
|
+
export declare const DEFAULT_CHAPTER_TITLE = "Key Moments";
|
|
148
|
+
|
|
149
|
+
export declare const DEFAULT_PLAYER_THEME_COLOR = "#ffffff";
|
|
150
|
+
|
|
138
151
|
export declare interface DRMConfig {
|
|
139
152
|
widevineLicenseUrl?: string;
|
|
140
153
|
playreadyLicenseUrl?: string;
|
|
@@ -171,6 +184,7 @@ export declare type FeatureFlags = {
|
|
|
171
184
|
screen_recording_prevention: boolean;
|
|
172
185
|
signal_strength: boolean;
|
|
173
186
|
ad_support: boolean;
|
|
187
|
+
skip_segments: boolean;
|
|
174
188
|
};
|
|
175
189
|
|
|
176
190
|
declare interface IAnalyticsModule {
|
|
@@ -370,17 +384,47 @@ declare interface RemoteCastState {
|
|
|
370
384
|
isMuted: boolean;
|
|
371
385
|
}
|
|
372
386
|
|
|
387
|
+
export declare function resolveThemeColor(value: string | null | undefined, fallback: string): string;
|
|
388
|
+
|
|
389
|
+
export declare type SdkInitChapterMarkersConfig = {
|
|
390
|
+
title?: string | null;
|
|
391
|
+
trayPosition?: string | null;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
export declare type SdkInitConfig = {
|
|
395
|
+
chapterMarkers?: SdkInitChapterMarkersConfig;
|
|
396
|
+
adAccentColor?: string | null;
|
|
397
|
+
playerThemeColor?: string | null;
|
|
398
|
+
aspectRatio?: boolean;
|
|
399
|
+
fullscreen?: boolean;
|
|
400
|
+
orientation?: boolean;
|
|
401
|
+
thumbnailPreview?: boolean;
|
|
402
|
+
};
|
|
403
|
+
|
|
373
404
|
export declare type SdkInitData = {
|
|
374
405
|
tenantId: string;
|
|
375
406
|
features: SdkInitFeatures;
|
|
407
|
+
config?: SdkInitConfig;
|
|
376
408
|
heartbeatIntervalSeconds?: number;
|
|
409
|
+
expiresAt?: string;
|
|
410
|
+
validForSeconds?: number;
|
|
377
411
|
};
|
|
378
412
|
|
|
379
413
|
export declare type SdkInitFeatures = {
|
|
380
414
|
subtitles: boolean;
|
|
381
415
|
ads: boolean;
|
|
382
416
|
chapterMarkers: boolean;
|
|
383
|
-
|
|
417
|
+
skipSegments?: boolean;
|
|
418
|
+
playbackSpeed?: boolean;
|
|
419
|
+
chromecast?: boolean;
|
|
420
|
+
airplay?: boolean;
|
|
421
|
+
pictureInPicture?: boolean;
|
|
422
|
+
multipleResolution?: boolean;
|
|
423
|
+
multipleAudio?: boolean;
|
|
424
|
+
drmProtection?: boolean;
|
|
425
|
+
screenRecordingPrevention?: boolean;
|
|
426
|
+
signalStrength?: boolean;
|
|
427
|
+
[key: string]: boolean | undefined;
|
|
384
428
|
};
|
|
385
429
|
|
|
386
430
|
export declare interface SdkInitOptions {
|
|
@@ -429,8 +473,8 @@ export declare interface StartSessionOptions {
|
|
|
429
473
|
}
|
|
430
474
|
|
|
431
475
|
export declare interface SubtitleStyle {
|
|
432
|
-
size?:
|
|
433
|
-
background?:
|
|
476
|
+
size?: "small" | "medium" | "large";
|
|
477
|
+
background?: "none" | "dim" | "solid";
|
|
434
478
|
color?: string;
|
|
435
479
|
}
|
|
436
480
|
|
|
@@ -502,13 +546,16 @@ export declare class VideoPlayerSDK {
|
|
|
502
546
|
private static readonly MAX_NETWORK_RETRIES;
|
|
503
547
|
private static readonly TERMINAL_HTTP_STATUSES;
|
|
504
548
|
private static readonly STALL_TIMEOUT_MS;
|
|
549
|
+
private static readonly MEDIA_ERROR_RECOVERY_TIMEOUT_MS;
|
|
505
550
|
private static readonly BUFFER_RESOLVE_MIN_ADVANCE_S;
|
|
506
551
|
private stallTimer;
|
|
552
|
+
private mediaErrorTimer;
|
|
507
553
|
private isBuffering;
|
|
508
554
|
private progressTick;
|
|
509
555
|
private hasFailed;
|
|
510
556
|
private mediaEventsAbort;
|
|
511
557
|
private keyMomentsGeneration;
|
|
558
|
+
private thumbnailBlobUrls;
|
|
512
559
|
private lastPlaybackPos;
|
|
513
560
|
private pendingSeekAttribution;
|
|
514
561
|
private eventListeners;
|
|
@@ -568,7 +615,11 @@ export declare class VideoPlayerSDK {
|
|
|
568
615
|
private bareThumbnailFilenameBesideVtt;
|
|
569
616
|
private resolveThumbnailCueBase;
|
|
570
617
|
private loadManifestThumbnailCues;
|
|
618
|
+
private revokeThumbnailBlobs;
|
|
619
|
+
private hydrateAuthenticatedThumbnails;
|
|
620
|
+
private fetchThumbnailBlobUrl;
|
|
571
621
|
private thumbnailCueAtTime;
|
|
622
|
+
private applyThumbnailCuesToMoments;
|
|
572
623
|
private extractKeyMomentsFromManifest;
|
|
573
624
|
hasAdBreakDiscoverySettled(): boolean;
|
|
574
625
|
private buildManifestUrl;
|
|
@@ -604,6 +655,7 @@ export declare class VideoPlayerSDK {
|
|
|
604
655
|
setAudioTrack(id: number): void;
|
|
605
656
|
private armStallWatchdog;
|
|
606
657
|
private clearStallWatchdog;
|
|
658
|
+
private clearMediaErrorTimer;
|
|
607
659
|
private fail;
|
|
608
660
|
destroy(options?: {
|
|
609
661
|
releaseVideoElement?: boolean;
|
|
@@ -630,6 +682,9 @@ declare interface WebVideoPlayerProps {
|
|
|
630
682
|
thumbnails?: ThumbnailConfig;
|
|
631
683
|
watermark?: string;
|
|
632
684
|
themeColor?: string;
|
|
685
|
+
adAccentColor?: string;
|
|
686
|
+
playerThemeColor?: string;
|
|
687
|
+
chapterTitle?: string;
|
|
633
688
|
drmConfig?: any;
|
|
634
689
|
onAnalyticsEvent?: (event: AnalyticsEvent) => void;
|
|
635
690
|
onAdBreakChange?: (active: boolean) => void;
|
|
@@ -643,6 +698,7 @@ declare interface WebVideoPlayerProps {
|
|
|
643
698
|
enablePlaybackSpeed?: boolean;
|
|
644
699
|
enablePiP?: boolean;
|
|
645
700
|
enableFullscreen?: boolean;
|
|
701
|
+
enableThumbnailPreview?: boolean;
|
|
646
702
|
autoFullscreen?: boolean;
|
|
647
703
|
watchProgressInterval?: number;
|
|
648
704
|
subtitleStyle?: SubtitleStyle_2;
|