boss-web-player-sdk 2.0.1 → 2.0.3
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-COp0xIFG.cjs} +1 -1
- package/dist/chunks/{src-QXXVFxiP.js → src-DyrTp0PW.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +16 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +70 -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
|
|
|
@@ -481,6 +525,9 @@ export declare class VideoPlayerSDK {
|
|
|
481
525
|
private dashInstance;
|
|
482
526
|
private activeQuality;
|
|
483
527
|
private qualityLevels;
|
|
528
|
+
private nativeMasterSrc;
|
|
529
|
+
private nativeVariantUris;
|
|
530
|
+
private nativeQualityGeneration;
|
|
484
531
|
analytics: IAnalyticsModule;
|
|
485
532
|
keyMoments: IKeyMomentsModule;
|
|
486
533
|
chapters: IChaptersModule;
|
|
@@ -502,17 +549,21 @@ export declare class VideoPlayerSDK {
|
|
|
502
549
|
private static readonly MAX_NETWORK_RETRIES;
|
|
503
550
|
private static readonly TERMINAL_HTTP_STATUSES;
|
|
504
551
|
private static readonly STALL_TIMEOUT_MS;
|
|
552
|
+
private static readonly MEDIA_ERROR_RECOVERY_TIMEOUT_MS;
|
|
505
553
|
private static readonly BUFFER_RESOLVE_MIN_ADVANCE_S;
|
|
506
554
|
private stallTimer;
|
|
555
|
+
private mediaErrorTimer;
|
|
507
556
|
private isBuffering;
|
|
508
557
|
private progressTick;
|
|
509
558
|
private hasFailed;
|
|
510
559
|
private mediaEventsAbort;
|
|
511
560
|
private keyMomentsGeneration;
|
|
561
|
+
private thumbnailBlobUrls;
|
|
512
562
|
private lastPlaybackPos;
|
|
513
563
|
private pendingSeekAttribution;
|
|
514
564
|
private eventListeners;
|
|
515
565
|
private static readonly AIRPLAY_POLL_INTERVAL_MS;
|
|
566
|
+
private static readonly PRE_ROLL_HEAD_TOLERANCE_S;
|
|
516
567
|
private airPlayPollTimer;
|
|
517
568
|
private airPlayTargetChangeHandler?;
|
|
518
569
|
private airPlaySeekPin;
|
|
@@ -561,6 +612,7 @@ export declare class VideoPlayerSDK {
|
|
|
561
612
|
on(event: string, callback: (...args: any[]) => void): void;
|
|
562
613
|
off(event: string, callback: (...args: any[]) => void): void;
|
|
563
614
|
private emit;
|
|
615
|
+
private extractNativeQualityLevelsFromManifest;
|
|
564
616
|
private extractSubtitlesFromManifest;
|
|
565
617
|
private findManifestThumbnailUri;
|
|
566
618
|
private parseThumbnailVtt;
|
|
@@ -568,7 +620,11 @@ export declare class VideoPlayerSDK {
|
|
|
568
620
|
private bareThumbnailFilenameBesideVtt;
|
|
569
621
|
private resolveThumbnailCueBase;
|
|
570
622
|
private loadManifestThumbnailCues;
|
|
623
|
+
private revokeThumbnailBlobs;
|
|
624
|
+
private hydrateAuthenticatedThumbnails;
|
|
625
|
+
private fetchThumbnailBlobUrl;
|
|
571
626
|
private thumbnailCueAtTime;
|
|
627
|
+
private applyThumbnailCuesToMoments;
|
|
572
628
|
private extractKeyMomentsFromManifest;
|
|
573
629
|
hasAdBreakDiscoverySettled(): boolean;
|
|
574
630
|
private buildManifestUrl;
|
|
@@ -604,6 +660,7 @@ export declare class VideoPlayerSDK {
|
|
|
604
660
|
setAudioTrack(id: number): void;
|
|
605
661
|
private armStallWatchdog;
|
|
606
662
|
private clearStallWatchdog;
|
|
663
|
+
private clearMediaErrorTimer;
|
|
607
664
|
private fail;
|
|
608
665
|
destroy(options?: {
|
|
609
666
|
releaseVideoElement?: boolean;
|
|
@@ -630,6 +687,9 @@ declare interface WebVideoPlayerProps {
|
|
|
630
687
|
thumbnails?: ThumbnailConfig;
|
|
631
688
|
watermark?: string;
|
|
632
689
|
themeColor?: string;
|
|
690
|
+
adAccentColor?: string;
|
|
691
|
+
playerThemeColor?: string;
|
|
692
|
+
chapterTitle?: string;
|
|
633
693
|
drmConfig?: any;
|
|
634
694
|
onAnalyticsEvent?: (event: AnalyticsEvent) => void;
|
|
635
695
|
onAdBreakChange?: (active: boolean) => void;
|
|
@@ -643,6 +703,7 @@ declare interface WebVideoPlayerProps {
|
|
|
643
703
|
enablePlaybackSpeed?: boolean;
|
|
644
704
|
enablePiP?: boolean;
|
|
645
705
|
enableFullscreen?: boolean;
|
|
706
|
+
enableThumbnailPreview?: boolean;
|
|
646
707
|
autoFullscreen?: boolean;
|
|
647
708
|
watchProgressInterval?: number;
|
|
648
709
|
subtitleStyle?: SubtitleStyle_2;
|