streamit-player 1.0.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.
- package/CHANGELOG.md +35 -0
- package/LICENSE +203 -0
- package/README.md +552 -0
- package/dist/Player-BfmqCREY.cjs +11616 -0
- package/dist/Player-YpukGRGt.js +11617 -0
- package/dist/PlayerController-Bt7Po42U.cjs +14093 -0
- package/dist/PlayerController-CW0pxrIt.js +14072 -0
- package/dist/core/index.cjs +194 -0
- package/dist/core/index.js +194 -0
- package/dist/core/src/AdScheduler.d.ts +56 -0
- package/dist/core/src/AdScheduler.d.ts.map +1 -0
- package/dist/core/src/AdsController.d.ts +48 -0
- package/dist/core/src/AdsController.d.ts.map +1 -0
- package/dist/core/src/AdsManager.d.ts +181 -0
- package/dist/core/src/AdsManager.d.ts.map +1 -0
- package/dist/core/src/DrmManager.d.ts +162 -0
- package/dist/core/src/DrmManager.d.ts.map +1 -0
- package/dist/core/src/DrmValidator.d.ts +36 -0
- package/dist/core/src/DrmValidator.d.ts.map +1 -0
- package/dist/core/src/KeyboardManager.d.ts +73 -0
- package/dist/core/src/KeyboardManager.d.ts.map +1 -0
- package/dist/core/src/PictureInPictureManager.d.ts +47 -0
- package/dist/core/src/PictureInPictureManager.d.ts.map +1 -0
- package/dist/core/src/PlayerController.d.ts +231 -0
- package/dist/core/src/PlayerController.d.ts.map +1 -0
- package/dist/core/src/PlaylistManager.d.ts +63 -0
- package/dist/core/src/PlaylistManager.d.ts.map +1 -0
- package/dist/core/src/SourceManager.d.ts +142 -0
- package/dist/core/src/SourceManager.d.ts.map +1 -0
- package/dist/core/src/SubtitleManager.d.ts +77 -0
- package/dist/core/src/SubtitleManager.d.ts.map +1 -0
- package/dist/core/src/TimelineMath.d.ts +14 -0
- package/dist/core/src/TimelineMath.d.ts.map +1 -0
- package/dist/core/src/html-overlay/HtmlOverlayRenderer.d.ts +103 -0
- package/dist/core/src/html-overlay/HtmlOverlayRenderer.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +21 -0
- package/dist/core/src/index.d.ts.map +1 -0
- package/dist/core/src/providers/ImaProvider.d.ts +135 -0
- package/dist/core/src/providers/ImaProvider.d.ts.map +1 -0
- package/dist/core/src/providers/ThumbnailProviders.d.ts +102 -0
- package/dist/core/src/providers/ThumbnailProviders.d.ts.map +1 -0
- package/dist/core/src/providers/VastProvider.d.ts +202 -0
- package/dist/core/src/providers/VastProvider.d.ts.map +1 -0
- package/dist/core/src/providers/VmapProvider.d.ts +98 -0
- package/dist/core/src/providers/VmapProvider.d.ts.map +1 -0
- package/dist/core/src/providers/fetchXmlWithPolicy.d.ts +9 -0
- package/dist/core/src/providers/fetchXmlWithPolicy.d.ts.map +1 -0
- package/dist/core/src/simid/SimidBridge.d.ts +44 -0
- package/dist/core/src/simid/SimidBridge.d.ts.map +1 -0
- package/dist/core/src/simid/SimidManager.d.ts +21 -0
- package/dist/core/src/simid/SimidManager.d.ts.map +1 -0
- package/dist/core/src/simid/SimidRuntime.d.ts +113 -0
- package/dist/core/src/simid/SimidRuntime.d.ts.map +1 -0
- package/dist/core/src/simid/SimidSession.d.ts +48 -0
- package/dist/core/src/simid/SimidSession.d.ts.map +1 -0
- package/dist/core/src/simid/types.d.ts +115 -0
- package/dist/core/src/simid/types.d.ts.map +1 -0
- package/dist/core/src/storage.d.ts +10 -0
- package/dist/core/src/storage.d.ts.map +1 -0
- package/dist/core/src/types.d.ts +1403 -0
- package/dist/core/src/types.d.ts.map +1 -0
- package/dist/core/src/utils.d.ts +34 -0
- package/dist/core/src/utils.d.ts.map +1 -0
- package/dist/core/src/vendorLoaders.d.ts +16 -0
- package/dist/core/src/vendorLoaders.d.ts.map +1 -0
- package/dist/index.cjs +55 -0
- package/dist/index.js +55 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/streamit-player.esm.js +26226 -0
- package/dist/streamit-player.esm.min.js +18830 -0
- package/dist/streamit-player.iife.js +26229 -0
- package/dist/streamit-player.iife.min.js +4750 -0
- package/dist/web-components/index.cjs +15 -0
- package/dist/web-components/index.js +15 -0
- package/dist/web-components/src/ChaptersButton.d.ts +27 -0
- package/dist/web-components/src/ChaptersButton.d.ts.map +1 -0
- package/dist/web-components/src/ChaptersButton.styles.d.ts +2 -0
- package/dist/web-components/src/ChaptersButton.styles.d.ts.map +1 -0
- package/dist/web-components/src/PlayButton.d.ts +17 -0
- package/dist/web-components/src/PlayButton.d.ts.map +1 -0
- package/dist/web-components/src/PlayButton.styles.d.ts +2 -0
- package/dist/web-components/src/PlayButton.styles.d.ts.map +1 -0
- package/dist/web-components/src/Player.d.ts +271 -0
- package/dist/web-components/src/Player.d.ts.map +1 -0
- package/dist/web-components/src/Player.styles.d.ts +2 -0
- package/dist/web-components/src/Player.styles.d.ts.map +1 -0
- package/dist/web-components/src/SeekButton.d.ts +18 -0
- package/dist/web-components/src/SeekButton.d.ts.map +1 -0
- package/dist/web-components/src/SeekButton.styles.d.ts +2 -0
- package/dist/web-components/src/SeekButton.styles.d.ts.map +1 -0
- package/dist/web-components/src/Seekbar.d.ts +101 -0
- package/dist/web-components/src/Seekbar.d.ts.map +1 -0
- package/dist/web-components/src/Seekbar.styles.d.ts +2 -0
- package/dist/web-components/src/Seekbar.styles.d.ts.map +1 -0
- package/dist/web-components/src/Themes.d.ts +5 -0
- package/dist/web-components/src/Themes.d.ts.map +1 -0
- package/dist/web-components/src/VerticalControls.d.ts +49 -0
- package/dist/web-components/src/VerticalControls.d.ts.map +1 -0
- package/dist/web-components/src/VerticalControls.styles.d.ts +2 -0
- package/dist/web-components/src/VerticalControls.styles.d.ts.map +1 -0
- package/dist/web-components/src/VolumeControl.d.ts +21 -0
- package/dist/web-components/src/VolumeControl.d.ts.map +1 -0
- package/dist/web-components/src/VolumeControl.styles.d.ts +2 -0
- package/dist/web-components/src/VolumeControl.styles.d.ts.map +1 -0
- package/dist/web-components/src/icons/IconRegistry.d.ts +24 -0
- package/dist/web-components/src/icons/IconRegistry.d.ts.map +1 -0
- package/dist/web-components/src/index.d.ts +10 -0
- package/dist/web-components/src/index.d.ts.map +1 -0
- package/dist/web-components/src/player-internals/GestureController.d.ts +140 -0
- package/dist/web-components/src/player-internals/GestureController.d.ts.map +1 -0
- package/dist/web-components/src/player-internals/PrefetchController.d.ts +34 -0
- package/dist/web-components/src/player-internals/PrefetchController.d.ts.map +1 -0
- package/dist/web-components/src/player-internals/SettingsMenuController.d.ts +59 -0
- package/dist/web-components/src/player-internals/SettingsMenuController.d.ts.map +1 -0
- package/dist/web-components/src/player-internals/ThumbnailCache.d.ts +64 -0
- package/dist/web-components/src/player-internals/ThumbnailCache.d.ts.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,1403 @@
|
|
|
1
|
+
import { SimidConfig } from './simid/types';
|
|
2
|
+
import { HtmlOverlayDiagnostics } from './html-overlay/HtmlOverlayRenderer';
|
|
3
|
+
import { PlayerController } from './PlayerController';
|
|
4
|
+
|
|
5
|
+
export interface ThumbnailInfo {
|
|
6
|
+
url: string;
|
|
7
|
+
x?: number;
|
|
8
|
+
y?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
time?: number;
|
|
12
|
+
}
|
|
13
|
+
export type ThumbnailProviderType = 'auto' | 'frame-capture' | 'vtt' | 'sprite' | 'cdn' | 'custom';
|
|
14
|
+
export interface SpriteInfo {
|
|
15
|
+
tileWidth: number;
|
|
16
|
+
tileHeight: number;
|
|
17
|
+
totalColumns: number;
|
|
18
|
+
totalRows?: number;
|
|
19
|
+
interval: number;
|
|
20
|
+
}
|
|
21
|
+
export interface SmartSeekConfig {
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
type?: 'auto' | 'frame-capture' | 'vtt' | 'sprite' | 'none';
|
|
24
|
+
vttUrl?: string;
|
|
25
|
+
spriteUrl?: string;
|
|
26
|
+
spriteInfo?: SpriteInfo;
|
|
27
|
+
thumbnails?: boolean;
|
|
28
|
+
storyboard?: boolean;
|
|
29
|
+
hoverTime?: boolean;
|
|
30
|
+
chapters?: boolean;
|
|
31
|
+
markers?: boolean;
|
|
32
|
+
snapToChapters?: boolean;
|
|
33
|
+
snapToMarkers?: boolean;
|
|
34
|
+
cache?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface PreciseSeekConfig {
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
frameAccurate?: boolean;
|
|
39
|
+
smoothDragging?: boolean;
|
|
40
|
+
dragInterpolation?: boolean;
|
|
41
|
+
liveDragging?: boolean;
|
|
42
|
+
keyboardPrecision?: boolean;
|
|
43
|
+
snapToMarkers?: boolean;
|
|
44
|
+
snapToChapters?: boolean;
|
|
45
|
+
continuousUpdates?: boolean;
|
|
46
|
+
seekSmoothing?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface ThumbnailProvider {
|
|
49
|
+
readonly type: ThumbnailProviderType | string;
|
|
50
|
+
getThumbnail(time: number, priority?: 'high' | 'low'): Promise<ThumbnailInfo | null> | ThumbnailInfo | null;
|
|
51
|
+
getNearestCachedThumbnail?(time: number): ThumbnailInfo | null;
|
|
52
|
+
setSource?(src: string, sourceOptions?: PlayerSource): void;
|
|
53
|
+
destroy?(): void;
|
|
54
|
+
isUnavailable?(): boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface OverlayOptions {
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Custom overlay renderer. The player instance and context are UI-layer
|
|
60
|
+
* concerns that `@player/core` has no knowledge of (it has zero UI
|
|
61
|
+
* dependencies), so both are intentionally `unknown` - the web-components
|
|
62
|
+
* consumer narrows/casts these at the call site.
|
|
63
|
+
*/
|
|
64
|
+
template?: (player: unknown, context?: unknown) => unknown;
|
|
65
|
+
animation?: string;
|
|
66
|
+
position?: string;
|
|
67
|
+
style?: Record<string, string> | string;
|
|
68
|
+
timing?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface ShortcutBinding {
|
|
71
|
+
key: string;
|
|
72
|
+
shiftKey?: boolean;
|
|
73
|
+
ctrlKey?: boolean;
|
|
74
|
+
altKey?: boolean;
|
|
75
|
+
action: string;
|
|
76
|
+
}
|
|
77
|
+
export interface HotkeysConfig {
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
bindings?: ShortcutBinding[];
|
|
80
|
+
overrides?: ShortcutBinding[];
|
|
81
|
+
}
|
|
82
|
+
export interface EmptyStateConfig {
|
|
83
|
+
/** Opaque UI icon value (string, template, Element, or render function) - see `IconRegistry` in `@player/web-components`. */
|
|
84
|
+
icon?: unknown;
|
|
85
|
+
title?: string;
|
|
86
|
+
subtitle?: string;
|
|
87
|
+
buttonText?: string;
|
|
88
|
+
render?: (player: unknown) => unknown;
|
|
89
|
+
}
|
|
90
|
+
export interface PlayerConfig {
|
|
91
|
+
/** Enables automatic media playback on source load. */
|
|
92
|
+
autoplay?: boolean;
|
|
93
|
+
/** Starts playback with audio muted. */
|
|
94
|
+
muted?: boolean;
|
|
95
|
+
/** Sets the initial volume level (number between 0 and 1). */
|
|
96
|
+
volume?: number;
|
|
97
|
+
/** Determines if the video should play inline on mobile browsers instead of entering native fullscreen. */
|
|
98
|
+
playsinline?: boolean;
|
|
99
|
+
/** Enables automatic looping of single videos or active playlists. */
|
|
100
|
+
loop?: boolean;
|
|
101
|
+
/** Custom provider for timeline seek hover preview thumbnails. */
|
|
102
|
+
thumbnailProvider?: ThumbnailProvider;
|
|
103
|
+
/** Enables Smart Seek (skipping silence, ads, or intro chunks). */
|
|
104
|
+
smartSeek?: SmartSeekConfig | boolean;
|
|
105
|
+
/** Enables Precise Seek frame-by-frame scrubbing. */
|
|
106
|
+
preciseSeek?: PreciseSeekConfig | boolean;
|
|
107
|
+
/** Custom icons registry to override standard default SVGs (opaque UI icon values). */
|
|
108
|
+
icons?: Record<string, unknown>;
|
|
109
|
+
/** The theme/icon pack ID to load. */
|
|
110
|
+
iconPack?: string;
|
|
111
|
+
/** Initial sleep timer setting (duration in minutes or 'end' of video). */
|
|
112
|
+
sleepTimerSetting?: 'off' | 10 | 15 | 20 | 30 | 45 | 60 | 'end';
|
|
113
|
+
/** The display/layout mode of the player. */
|
|
114
|
+
displayMode?: 'standard' | 'vertical' | 'audio-only' | 'custom' | 'mini' | 'floating';
|
|
115
|
+
/** Duration threshold (in seconds) near the end of video to trigger auto-advance. */
|
|
116
|
+
nearEndThreshold?: number;
|
|
117
|
+
/** Loop behavior when a playlist reaches the end. */
|
|
118
|
+
playlistRepeatMode?: 'off' | 'repeat-all';
|
|
119
|
+
/** Enables vertical page scroll controls on swipes. */
|
|
120
|
+
autoScroll?: boolean;
|
|
121
|
+
/** Configurations for live streams. */
|
|
122
|
+
live?: {
|
|
123
|
+
/** The live playback mode ('live-only' or 'live-dvr'). */
|
|
124
|
+
mode?: 'live-only' | 'live-dvr';
|
|
125
|
+
};
|
|
126
|
+
settings?: {
|
|
127
|
+
/** Defines the order of setting menu items. */
|
|
128
|
+
order?: string[];
|
|
129
|
+
/** Enables/disables the playback speed selector menu item. */
|
|
130
|
+
playbackSpeed?: boolean;
|
|
131
|
+
/** Enables/disables the resolution/quality selector menu item. */
|
|
132
|
+
quality?: boolean;
|
|
133
|
+
/** Enables/disables the audio track selection menu item. */
|
|
134
|
+
audioTracks?: boolean;
|
|
135
|
+
/** Enables/disables the subtitle track selector menu item. */
|
|
136
|
+
subtitles?: boolean;
|
|
137
|
+
/** Enables/disables the loop toggle menu item. */
|
|
138
|
+
loop?: boolean;
|
|
139
|
+
/** Enables/disables the sleep timer selector menu item. */
|
|
140
|
+
sleepTimer?: boolean;
|
|
141
|
+
/** Enables/disables the chapters navigation menu item. */
|
|
142
|
+
chapters?: boolean;
|
|
143
|
+
/** Enables/disables the timeline markers menu item. */
|
|
144
|
+
markers?: boolean;
|
|
145
|
+
/** Enables/disables the vertical auto scroll toggle menu item. */
|
|
146
|
+
autoScroll?: boolean;
|
|
147
|
+
/** Enables/disables the picture-in-picture toggle menu item. */
|
|
148
|
+
pictureInPicture?: boolean;
|
|
149
|
+
/** Alias for pictureInPicture option. */
|
|
150
|
+
pip?: boolean;
|
|
151
|
+
/** Enables/disables the fullscreen toggle menu item. */
|
|
152
|
+
fullscreen?: boolean;
|
|
153
|
+
/** Enables or disables the settings menu button in controls bar. */
|
|
154
|
+
enabled?: boolean;
|
|
155
|
+
/** Custom options/items to inject statically into the Settings menu. */
|
|
156
|
+
customItems?: Array<{
|
|
157
|
+
id: string;
|
|
158
|
+
label: string;
|
|
159
|
+
valueLabel?: string;
|
|
160
|
+
onClick?: (player: unknown) => void;
|
|
161
|
+
}>;
|
|
162
|
+
/** Custom groupings for setting items. Map group names to arrays of item keys. */
|
|
163
|
+
groups?: Record<string, string[]>;
|
|
164
|
+
/** Escape hatch for consumer-defined settings menu extension flags. */
|
|
165
|
+
[key: string]: unknown;
|
|
166
|
+
};
|
|
167
|
+
/** Preload policy of standard HTML video element. */
|
|
168
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
169
|
+
/** Cross-origin attribute parameter for credential resolution. */
|
|
170
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
171
|
+
/** @deprecated Use `crossorigin` instead for standard HTML element property alignment. */
|
|
172
|
+
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
173
|
+
/** @deprecated Use `playsinline` instead for standard HTML element property alignment. */
|
|
174
|
+
playsInline?: boolean;
|
|
175
|
+
/** Poster image URL displayed before source playback start. */
|
|
176
|
+
poster?: string;
|
|
177
|
+
/** Configures standard hotkeys and shortcuts. */
|
|
178
|
+
hotkeys?: boolean | HotkeysConfig;
|
|
179
|
+
/** Exposes analytics tracking callback triggers. */
|
|
180
|
+
analytics?: {
|
|
181
|
+
handlers?: Array<(event: string, detail: unknown) => void>;
|
|
182
|
+
};
|
|
183
|
+
/** Custom UI empty state placeholders parameters. */
|
|
184
|
+
emptyState?: EmptyStateConfig;
|
|
185
|
+
/** Static locale mappings translations table. */
|
|
186
|
+
locale?: Record<string, string>;
|
|
187
|
+
/** Optional global DRM configuration defaults. */
|
|
188
|
+
drm?: DrmConfig;
|
|
189
|
+
/** Optional global advertisement configuration options. */
|
|
190
|
+
ads?: AdsConfig;
|
|
191
|
+
}
|
|
192
|
+
export interface PlayerThemeConfig {
|
|
193
|
+
preset?: 'light' | 'dark' | 'glass-dark' | 'glass-light' | string;
|
|
194
|
+
primaryColor?: string;
|
|
195
|
+
accentColor?: string;
|
|
196
|
+
backgroundColor?: string;
|
|
197
|
+
textColor?: string;
|
|
198
|
+
menuColor?: string;
|
|
199
|
+
seekbarBg?: string;
|
|
200
|
+
seekbarPlayed?: string;
|
|
201
|
+
seekbarBuffered?: string;
|
|
202
|
+
borderRadius?: string;
|
|
203
|
+
fontFamily?: string;
|
|
204
|
+
fontSize?: string;
|
|
205
|
+
blur?: string;
|
|
206
|
+
shadows?: string;
|
|
207
|
+
spacing?: string;
|
|
208
|
+
transitions?: string;
|
|
209
|
+
primaryGlow?: string;
|
|
210
|
+
glassBg?: string;
|
|
211
|
+
glassPanel?: string;
|
|
212
|
+
glassBorder?: string;
|
|
213
|
+
glassShadow?: string;
|
|
214
|
+
menuBg?: string;
|
|
215
|
+
tooltipBg?: string;
|
|
216
|
+
tooltipColor?: string;
|
|
217
|
+
buttonColor?: string;
|
|
218
|
+
buttonHoverColor?: string;
|
|
219
|
+
buttonHoverBg?: string;
|
|
220
|
+
buttonIconSize?: string;
|
|
221
|
+
volumePlayedBg?: string;
|
|
222
|
+
volumeUnplayedBg?: string;
|
|
223
|
+
verticalMaxWidth?: string;
|
|
224
|
+
overlayBg?: string;
|
|
225
|
+
liveBadgeLiveBg?: string;
|
|
226
|
+
liveBadgeLiveBorder?: string;
|
|
227
|
+
liveBadgeLiveColor?: string;
|
|
228
|
+
liveBadgeBehindBg?: string;
|
|
229
|
+
liveBadgeBehindBorder?: string;
|
|
230
|
+
liveBadgeBehindColor?: string;
|
|
231
|
+
previewBorderColor?: string;
|
|
232
|
+
previewBorderWidth?: string;
|
|
233
|
+
previewBorderRadius?: string;
|
|
234
|
+
previewShadow?: string;
|
|
235
|
+
previewBg?: string;
|
|
236
|
+
previewTimeBg?: string;
|
|
237
|
+
previewTimeColor?: string;
|
|
238
|
+
previewTimeFont?: string;
|
|
239
|
+
previewTimeSize?: string;
|
|
240
|
+
previewWidth?: string;
|
|
241
|
+
previewHeight?: string;
|
|
242
|
+
previewOffset?: string;
|
|
243
|
+
previewAnimation?: string;
|
|
244
|
+
previewOpacity?: string;
|
|
245
|
+
previewBlur?: string;
|
|
246
|
+
previewArrowColor?: string;
|
|
247
|
+
previewArrowSize?: string;
|
|
248
|
+
previewArrowVisible?: string;
|
|
249
|
+
previewTransition?: string;
|
|
250
|
+
previewZIndex?: string;
|
|
251
|
+
previewPadding?: string;
|
|
252
|
+
previewSpacing?: string;
|
|
253
|
+
previewBackdropFilter?: string;
|
|
254
|
+
previewVerticalWidth?: string;
|
|
255
|
+
previewVerticalHeight?: string;
|
|
256
|
+
customVariables?: Record<string, string>;
|
|
257
|
+
}
|
|
258
|
+
export interface PlayerConfiguration extends PlayerConfig {
|
|
259
|
+
theme?: PlayerThemeConfig;
|
|
260
|
+
controls?: {
|
|
261
|
+
/** Enables the play/pause interaction on video click. */
|
|
262
|
+
play?: boolean;
|
|
263
|
+
/** Renders the Play/Pause button in the controls bar. */
|
|
264
|
+
playButton?: boolean;
|
|
265
|
+
/** Renders the Pause icon. */
|
|
266
|
+
pause?: boolean;
|
|
267
|
+
/** Renders the Seekbar slider timeline. */
|
|
268
|
+
seekbar?: boolean;
|
|
269
|
+
/** Renders the full interactive seek track. */
|
|
270
|
+
timeline?: boolean;
|
|
271
|
+
/** Renders the current time counter text. */
|
|
272
|
+
currentTime?: boolean;
|
|
273
|
+
/** Renders the total media duration text. */
|
|
274
|
+
duration?: boolean;
|
|
275
|
+
/** Renders the Volume slider control. */
|
|
276
|
+
volume?: boolean;
|
|
277
|
+
/** Renders the mute/unmute button. */
|
|
278
|
+
mute?: boolean;
|
|
279
|
+
/** Renders the Settings gear button. */
|
|
280
|
+
settings?: boolean;
|
|
281
|
+
/** Renders the subtitles selection button. */
|
|
282
|
+
subtitles?: boolean;
|
|
283
|
+
/** Alias for subtitles button. */
|
|
284
|
+
captions?: boolean;
|
|
285
|
+
/** Renders the audio tracks selector button. */
|
|
286
|
+
audioTracks?: boolean;
|
|
287
|
+
/** Renders the quality resolution selector button. */
|
|
288
|
+
quality?: boolean;
|
|
289
|
+
/** Renders the playback speed selector button. */
|
|
290
|
+
playbackSpeed?: boolean;
|
|
291
|
+
/** Renders the sleep timer selection button. */
|
|
292
|
+
sleepTimer?: boolean;
|
|
293
|
+
/** Renders the Picture-in-Picture button. */
|
|
294
|
+
pictureInPicture?: boolean;
|
|
295
|
+
/** Alias for pictureInPicture button. */
|
|
296
|
+
pip?: boolean;
|
|
297
|
+
/** Renders the Fullscreen button. */
|
|
298
|
+
fullscreen?: boolean;
|
|
299
|
+
/** Renders the Live badge overlay. */
|
|
300
|
+
liveBadge?: boolean;
|
|
301
|
+
/** Renders timeline segment indicators. */
|
|
302
|
+
markers?: boolean;
|
|
303
|
+
/** Renders timeline chapter dividers. */
|
|
304
|
+
chapters?: boolean;
|
|
305
|
+
/** Enables hover thumbnail pre-scrubbing. */
|
|
306
|
+
timelinePreview?: boolean;
|
|
307
|
+
/** Legacy alias for the hover tooltip visibility toggle. */
|
|
308
|
+
hoverTooltip?: boolean;
|
|
309
|
+
/** Legacy alias for the hover tooltip visibility toggle. */
|
|
310
|
+
tooltip?: boolean;
|
|
311
|
+
/** Renders replay action trigger. */
|
|
312
|
+
replayButton?: boolean;
|
|
313
|
+
/** Renders buffer loading indicator. */
|
|
314
|
+
loadingSpinner?: boolean;
|
|
315
|
+
/** Renders user action feedback overlay (e.g. double tap indicator). */
|
|
316
|
+
feedbackOverlay?: boolean;
|
|
317
|
+
/** Renders center volume adjustment indicator. */
|
|
318
|
+
volumeOverlay?: boolean;
|
|
319
|
+
/** Enables standard player context menu options. */
|
|
320
|
+
contextMenu?: boolean;
|
|
321
|
+
/** Enables vertical page rail actions. */
|
|
322
|
+
actionRail?: boolean;
|
|
323
|
+
/** Enables seeking backwards inside live DVR windows. */
|
|
324
|
+
liveDVR?: boolean;
|
|
325
|
+
/** Renders a snap-to-live-edge overlay button on delay. */
|
|
326
|
+
liveEdgeButton?: boolean;
|
|
327
|
+
/** Renders default empty/error cards. */
|
|
328
|
+
emptyState?: boolean;
|
|
329
|
+
/** Renders the main landscape control bar. */
|
|
330
|
+
controlsBar?: boolean;
|
|
331
|
+
/** Renders the vertical mobile layout overlay bar. */
|
|
332
|
+
verticalControls?: boolean;
|
|
333
|
+
/** Enables external integrations/plugins extension hooks. */
|
|
334
|
+
plugins?: boolean;
|
|
335
|
+
/** Renders the loop video controls bar icon. */
|
|
336
|
+
loop?: boolean;
|
|
337
|
+
/** Renders the auto-scroll overlay toggle button. */
|
|
338
|
+
autoScroll?: boolean;
|
|
339
|
+
/** Custom order of control elements inside control group layout containers. */
|
|
340
|
+
order?: string[];
|
|
341
|
+
/** Custom groupings for control items. */
|
|
342
|
+
groups?: Record<string, string[]>;
|
|
343
|
+
/** Control layout templates mapping lists of items. */
|
|
344
|
+
layout?: string[];
|
|
345
|
+
};
|
|
346
|
+
overlays?: Record<string, OverlayOptions | boolean>;
|
|
347
|
+
vertical?: {
|
|
348
|
+
swipeThreshold?: number;
|
|
349
|
+
autoScroll?: boolean;
|
|
350
|
+
loopSingleVideo?: boolean;
|
|
351
|
+
loopPlaylist?: boolean;
|
|
352
|
+
railPosition?: 'left' | 'right';
|
|
353
|
+
railButtons?: string[];
|
|
354
|
+
showCenterPlayButton?: boolean;
|
|
355
|
+
showProgressBar?: boolean;
|
|
356
|
+
snapBehavior?: 'snap' | 'none';
|
|
357
|
+
animationTiming?: number;
|
|
358
|
+
gestures?: {
|
|
359
|
+
doubleTapToSeek?: boolean;
|
|
360
|
+
swipeToNavigate?: boolean;
|
|
361
|
+
longPressToSpeed?: boolean;
|
|
362
|
+
longPressSpeed?: number;
|
|
363
|
+
};
|
|
364
|
+
menus?: {
|
|
365
|
+
playbackSpeed?: boolean;
|
|
366
|
+
quality?: boolean;
|
|
367
|
+
audioTracks?: boolean;
|
|
368
|
+
subtitles?: boolean;
|
|
369
|
+
sleepTimer?: boolean;
|
|
370
|
+
autoScroll?: boolean;
|
|
371
|
+
chapters?: boolean;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
layout?: {
|
|
375
|
+
/**
|
|
376
|
+
* The layout mode of the player.
|
|
377
|
+
* - 'standard': Standard VOD/Live landscape layout.
|
|
378
|
+
* - 'vertical': Mobile vertical layout.
|
|
379
|
+
* - 'audio-only': Audio-only layout with album art placeholder.
|
|
380
|
+
* - 'custom': Empty layout rendering only child slots.
|
|
381
|
+
* - 'mini' (Experimental/Internal): Mini overlay player.
|
|
382
|
+
* - 'floating' (Experimental/Internal): Centered floating dialog player.
|
|
383
|
+
*/
|
|
384
|
+
mode?: 'standard' | 'vertical' | 'audio-only' | 'custom' | 'mini' | 'floating';
|
|
385
|
+
};
|
|
386
|
+
playback?: {
|
|
387
|
+
autoplay?: boolean;
|
|
388
|
+
muted?: boolean;
|
|
389
|
+
volume?: number;
|
|
390
|
+
loop?: boolean;
|
|
391
|
+
playbackRate?: number;
|
|
392
|
+
playbackRates?: number[];
|
|
393
|
+
doubleTapInterval?: number;
|
|
394
|
+
};
|
|
395
|
+
sleepTimer?: {
|
|
396
|
+
presets?: number[];
|
|
397
|
+
};
|
|
398
|
+
shortcuts?: {
|
|
399
|
+
enabled?: boolean;
|
|
400
|
+
};
|
|
401
|
+
plugins?: PlayerPlugin[];
|
|
402
|
+
}
|
|
403
|
+
export type SourceType = 'mp4' | 'mov' | 'hls' | 'dash' | 'webm' | 'file' | 'blob' | 'embed' | 'unknown';
|
|
404
|
+
export interface Chapter {
|
|
405
|
+
id: string;
|
|
406
|
+
title: string;
|
|
407
|
+
startTime: number;
|
|
408
|
+
endTime?: number;
|
|
409
|
+
description?: string;
|
|
410
|
+
}
|
|
411
|
+
export interface TimelineMarker {
|
|
412
|
+
id: string;
|
|
413
|
+
time: number;
|
|
414
|
+
label: string;
|
|
415
|
+
type: 'chapter' | 'ad' | 'bookmark' | 'analytics' | 'metadata' | string;
|
|
416
|
+
color?: string;
|
|
417
|
+
/** Caller-supplied opaque metadata attached to this marker - no fixed shape. */
|
|
418
|
+
metadata?: unknown;
|
|
419
|
+
}
|
|
420
|
+
export interface PlayerPlugin {
|
|
421
|
+
name: string;
|
|
422
|
+
install(controller: PlayerController): void;
|
|
423
|
+
destroy?(): void;
|
|
424
|
+
getSettingsItems?(controller: PlayerController): Array<{
|
|
425
|
+
id: string;
|
|
426
|
+
label: string;
|
|
427
|
+
valueLabel?: string;
|
|
428
|
+
onClick: () => void;
|
|
429
|
+
}>;
|
|
430
|
+
renderSettingsScreen?(screenId: string, controller: PlayerController, onBack: () => void): unknown;
|
|
431
|
+
getControlButtons?(controller: PlayerController): Array<{
|
|
432
|
+
id: string;
|
|
433
|
+
position: 'left' | 'center' | 'right' | 'rail';
|
|
434
|
+
render(): unknown;
|
|
435
|
+
}>;
|
|
436
|
+
onPlayerAttached?(player: unknown): void;
|
|
437
|
+
onPlayerDetached?(player: unknown): void;
|
|
438
|
+
onSourceLoaded?(source: unknown): void;
|
|
439
|
+
onBeforePlay?(): void;
|
|
440
|
+
onAfterPlay?(): void;
|
|
441
|
+
}
|
|
442
|
+
export interface PlaybackInterceptor {
|
|
443
|
+
play?: () => Promise<boolean> | boolean;
|
|
444
|
+
pause?: () => boolean;
|
|
445
|
+
seek?: (time: number) => boolean;
|
|
446
|
+
setVolume?: (vol: number) => boolean;
|
|
447
|
+
setMuted?: (muted: boolean) => boolean;
|
|
448
|
+
}
|
|
449
|
+
export interface PlayerSourceVariant {
|
|
450
|
+
src: string;
|
|
451
|
+
label: string;
|
|
452
|
+
type?: SourceType;
|
|
453
|
+
}
|
|
454
|
+
export interface PlayerSource {
|
|
455
|
+
src?: string;
|
|
456
|
+
srcObject?: MediaStream;
|
|
457
|
+
type?: SourceType;
|
|
458
|
+
variants?: PlayerSourceVariant[];
|
|
459
|
+
chapters?: Chapter[];
|
|
460
|
+
subtitles?: TextTrackSource[];
|
|
461
|
+
live?: {
|
|
462
|
+
mode?: 'live-only' | 'live-dvr';
|
|
463
|
+
};
|
|
464
|
+
smartSeek?: Omit<SmartSeekConfig, 'enabled'>;
|
|
465
|
+
preciseSeek?: Omit<PreciseSeekConfig, 'enabled'> | boolean;
|
|
466
|
+
/** Optional source-specific DRM configuration parameters. */
|
|
467
|
+
drm?: DrmConfig;
|
|
468
|
+
/** Optional source-specific advertisement tag URL override. */
|
|
469
|
+
adsUrl?: string;
|
|
470
|
+
/** Optional source-specific advertisement configuration overrides. */
|
|
471
|
+
ads?: AdsConfig;
|
|
472
|
+
}
|
|
473
|
+
export interface TextTrackSource {
|
|
474
|
+
src: string;
|
|
475
|
+
label: string;
|
|
476
|
+
srclang: string;
|
|
477
|
+
default?: boolean;
|
|
478
|
+
}
|
|
479
|
+
export type SubtitleTrackKind = 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
|
|
480
|
+
export interface SubtitleTrack {
|
|
481
|
+
id: string;
|
|
482
|
+
language: string;
|
|
483
|
+
label: string;
|
|
484
|
+
default: boolean;
|
|
485
|
+
forced: boolean;
|
|
486
|
+
kind: SubtitleTrackKind;
|
|
487
|
+
source: 'native' | 'external' | 'hls' | 'dash';
|
|
488
|
+
index?: number;
|
|
489
|
+
}
|
|
490
|
+
export type SubtitleFontFamily = 'default' | 'proportional-sans-serif' | 'monospace-sans-serif' | 'proportional-serif' | 'monospace-serif' | 'casual' | 'cursive' | 'small-capitals';
|
|
491
|
+
export type SubtitleCharacterEdgeStyle = 'default' | 'none' | 'raised' | 'depressed' | 'uniform' | 'drop-shadow';
|
|
492
|
+
export interface SubtitleAppearance {
|
|
493
|
+
fontFamily: SubtitleFontFamily;
|
|
494
|
+
fontSize: number;
|
|
495
|
+
fontColor: string;
|
|
496
|
+
backgroundColor: string;
|
|
497
|
+
backgroundOpacity: number;
|
|
498
|
+
windowColor: string;
|
|
499
|
+
windowOpacity: number;
|
|
500
|
+
characterEdgeStyle: SubtitleCharacterEdgeStyle;
|
|
501
|
+
fontOpacity: number;
|
|
502
|
+
}
|
|
503
|
+
export interface RawLiveInfo {
|
|
504
|
+
isLive: boolean;
|
|
505
|
+
isLowLatency: boolean;
|
|
506
|
+
hasDvr?: boolean;
|
|
507
|
+
dvrWindow?: number;
|
|
508
|
+
liveEdgeTarget: number | null;
|
|
509
|
+
}
|
|
510
|
+
export interface LiveCapabilities {
|
|
511
|
+
isLive: boolean;
|
|
512
|
+
isLowLatency: boolean;
|
|
513
|
+
hasDvr: boolean;
|
|
514
|
+
dvrWindow: number;
|
|
515
|
+
seekableRange: {
|
|
516
|
+
start: number;
|
|
517
|
+
end: number;
|
|
518
|
+
};
|
|
519
|
+
liveLatency: number;
|
|
520
|
+
isAtLiveEdge: boolean;
|
|
521
|
+
}
|
|
522
|
+
export type PlayerStatus = 'idle' | 'loading' | 'ready' | 'playing' | 'paused' | 'buffering' | 'ended' | 'error';
|
|
523
|
+
export interface PlayerState {
|
|
524
|
+
status: PlayerStatus;
|
|
525
|
+
isPlaying: boolean;
|
|
526
|
+
currentTime: number;
|
|
527
|
+
duration: number;
|
|
528
|
+
volume: number;
|
|
529
|
+
isMuted: boolean;
|
|
530
|
+
isFullscreen: boolean;
|
|
531
|
+
bufferedRanges: Array<{
|
|
532
|
+
start: number;
|
|
533
|
+
end: number;
|
|
534
|
+
}>;
|
|
535
|
+
playbackRate: number;
|
|
536
|
+
captionsEnabled: boolean;
|
|
537
|
+
currentSource: string | null;
|
|
538
|
+
sourceType: SourceType;
|
|
539
|
+
isBuffering: boolean;
|
|
540
|
+
isSeeking: boolean;
|
|
541
|
+
hasCaptions: boolean;
|
|
542
|
+
error: string | null;
|
|
543
|
+
qualities: string[];
|
|
544
|
+
activeQuality: string;
|
|
545
|
+
audioTracks: string[];
|
|
546
|
+
activeAudioTrack: number;
|
|
547
|
+
subtitleTracks: SubtitleTrack[];
|
|
548
|
+
activeSubtitleTrack: number;
|
|
549
|
+
activeSubtitleTrackId: string | null;
|
|
550
|
+
subtitleAppearance: SubtitleAppearance;
|
|
551
|
+
isLive: boolean | null;
|
|
552
|
+
isLowLatency: boolean;
|
|
553
|
+
isAtLiveEdge: boolean;
|
|
554
|
+
liveLatency: number | null;
|
|
555
|
+
hasDvr: boolean;
|
|
556
|
+
dvrWindow: number;
|
|
557
|
+
canSeekInDvr: boolean;
|
|
558
|
+
seekableRange: {
|
|
559
|
+
start: number;
|
|
560
|
+
end: number;
|
|
561
|
+
};
|
|
562
|
+
liveMode: 'live-only' | 'live-dvr';
|
|
563
|
+
thumbnailProvider?: ThumbnailProvider;
|
|
564
|
+
pictureInPicture: boolean;
|
|
565
|
+
pictureInPictureSupported: boolean;
|
|
566
|
+
loop: boolean;
|
|
567
|
+
sleepTimerSetting: 'off' | 10 | 15 | 20 | 30 | 45 | 60 | 'end';
|
|
568
|
+
sleepTimerSecondsRemaining: number | null;
|
|
569
|
+
sleepTimerExpired: boolean;
|
|
570
|
+
chapters: Chapter[];
|
|
571
|
+
activeChapterIndex: number;
|
|
572
|
+
markers: TimelineMarker[];
|
|
573
|
+
visibleMarkerTypes: string[] | null;
|
|
574
|
+
displayMode: 'standard' | 'vertical' | 'audio-only' | 'custom' | 'mini' | 'floating';
|
|
575
|
+
playlist: PlayerSource[];
|
|
576
|
+
activePlaylistIndex: number;
|
|
577
|
+
playlistRepeatMode: 'off' | 'repeat-all';
|
|
578
|
+
autoScroll: boolean;
|
|
579
|
+
isAdPlaying: boolean;
|
|
580
|
+
isAdLoading: boolean;
|
|
581
|
+
currentAd: Advertisement | null;
|
|
582
|
+
currentAdBreak: AdBreak | null;
|
|
583
|
+
adCurrentTime: number | null;
|
|
584
|
+
adRemainingTime: number | null;
|
|
585
|
+
adDuration: number | null;
|
|
586
|
+
canSkipAd: boolean;
|
|
587
|
+
skipAvailableAt: number | null;
|
|
588
|
+
adPosition: number | null;
|
|
589
|
+
adProvider: string | null;
|
|
590
|
+
adLinear: boolean | null;
|
|
591
|
+
adMuted: boolean | null;
|
|
592
|
+
}
|
|
593
|
+
export interface SleepTimerFullState {
|
|
594
|
+
setting: 'off' | 10 | 15 | 20 | 30 | 45 | 60 | 'end';
|
|
595
|
+
secondsRemaining: number | null;
|
|
596
|
+
endTimeMs: number | null;
|
|
597
|
+
isExpired: boolean;
|
|
598
|
+
isRunning: boolean;
|
|
599
|
+
}
|
|
600
|
+
export type PlayerStateCallback = (state: PlayerState) => void;
|
|
601
|
+
export interface PlayerMetadataEvent {
|
|
602
|
+
timestamp: number;
|
|
603
|
+
type: string;
|
|
604
|
+
sourceProtocol: 'hls' | 'dash' | 'mp4' | 'unknown';
|
|
605
|
+
/** Raw, protocol-specific metadata payload (e.g. hls.js/dash.js event data) - shape varies by protocol/muxer. */
|
|
606
|
+
rawData: unknown;
|
|
607
|
+
parsedData: Record<string, unknown>;
|
|
608
|
+
}
|
|
609
|
+
export interface PlayerEvents {
|
|
610
|
+
/** Allows consumers/plugins to dispatch/listen to custom event names beyond the fixed set below. */
|
|
611
|
+
[key: string]: unknown;
|
|
612
|
+
play: undefined;
|
|
613
|
+
ended: undefined;
|
|
614
|
+
adbreakstart: {
|
|
615
|
+
adId?: string;
|
|
616
|
+
duration?: number;
|
|
617
|
+
} | undefined;
|
|
618
|
+
adbreakend: undefined;
|
|
619
|
+
adclick: {
|
|
620
|
+
adId?: string;
|
|
621
|
+
clickUrl?: string;
|
|
622
|
+
} | undefined;
|
|
623
|
+
pause: undefined;
|
|
624
|
+
seekstart: undefined;
|
|
625
|
+
seekend: undefined;
|
|
626
|
+
error: {
|
|
627
|
+
message: string;
|
|
628
|
+
};
|
|
629
|
+
chapterchange: {
|
|
630
|
+
activeChapterIndex: number;
|
|
631
|
+
chapter: Chapter | null;
|
|
632
|
+
};
|
|
633
|
+
volumechange: {
|
|
634
|
+
volume: number;
|
|
635
|
+
};
|
|
636
|
+
mutechange: {
|
|
637
|
+
isMuted: boolean;
|
|
638
|
+
};
|
|
639
|
+
subtitletrackschanged: {
|
|
640
|
+
tracks: SubtitleTrack[];
|
|
641
|
+
};
|
|
642
|
+
subtitletrackchange: {
|
|
643
|
+
activeTrack: SubtitleTrack | null;
|
|
644
|
+
};
|
|
645
|
+
subtitleenabled: {
|
|
646
|
+
activeTrack: SubtitleTrack | null;
|
|
647
|
+
};
|
|
648
|
+
subtitledisabled: undefined;
|
|
649
|
+
subtitlechange: {
|
|
650
|
+
activeSubtitleTrack: number;
|
|
651
|
+
};
|
|
652
|
+
fullscreenchange: {
|
|
653
|
+
isFullscreen: boolean;
|
|
654
|
+
};
|
|
655
|
+
pipchange: {
|
|
656
|
+
isPictureInPicture: boolean;
|
|
657
|
+
};
|
|
658
|
+
sourcechange: {
|
|
659
|
+
source: PlayerSource | null;
|
|
660
|
+
};
|
|
661
|
+
qualitychange: {
|
|
662
|
+
qualityIndex: number;
|
|
663
|
+
};
|
|
664
|
+
audiochange: {
|
|
665
|
+
trackIndex: number;
|
|
666
|
+
};
|
|
667
|
+
subtitleappearancechange: {
|
|
668
|
+
appearance: SubtitleAppearance;
|
|
669
|
+
};
|
|
670
|
+
replay: undefined;
|
|
671
|
+
audioTracksChanged: {
|
|
672
|
+
audioTracks: string[];
|
|
673
|
+
};
|
|
674
|
+
audioTrackChanged: {
|
|
675
|
+
activeAudioTrack: number;
|
|
676
|
+
};
|
|
677
|
+
seek: {
|
|
678
|
+
seconds: number;
|
|
679
|
+
} | undefined;
|
|
680
|
+
metadata: PlayerMetadataEvent;
|
|
681
|
+
playbackratechange: {
|
|
682
|
+
playbackRate: number;
|
|
683
|
+
} | undefined;
|
|
684
|
+
markerclick: {
|
|
685
|
+
marker: TimelineMarker;
|
|
686
|
+
type: string;
|
|
687
|
+
time: number;
|
|
688
|
+
label: string;
|
|
689
|
+
originalEvent: MouseEvent;
|
|
690
|
+
} | undefined;
|
|
691
|
+
markerhover: {
|
|
692
|
+
marker: TimelineMarker;
|
|
693
|
+
type: string;
|
|
694
|
+
time: number;
|
|
695
|
+
label: string;
|
|
696
|
+
} | undefined;
|
|
697
|
+
'playlist-loaded': {
|
|
698
|
+
playlist: PlayerSource[];
|
|
699
|
+
startIndex: number;
|
|
700
|
+
};
|
|
701
|
+
'playlist-cleared': undefined;
|
|
702
|
+
'playlist-change': {
|
|
703
|
+
playlist: PlayerSource[];
|
|
704
|
+
};
|
|
705
|
+
'playlist-index-change': {
|
|
706
|
+
index: number;
|
|
707
|
+
source: PlayerSource | null;
|
|
708
|
+
};
|
|
709
|
+
'playlist-next': {
|
|
710
|
+
index: number;
|
|
711
|
+
source: PlayerSource;
|
|
712
|
+
};
|
|
713
|
+
'playlist-previous': {
|
|
714
|
+
index: number;
|
|
715
|
+
source: PlayerSource;
|
|
716
|
+
};
|
|
717
|
+
'playlist-item-added': {
|
|
718
|
+
index: number;
|
|
719
|
+
source: PlayerSource;
|
|
720
|
+
};
|
|
721
|
+
'playlist-item-removed': {
|
|
722
|
+
index: number;
|
|
723
|
+
source: PlayerSource;
|
|
724
|
+
};
|
|
725
|
+
'playlist-item-replaced': {
|
|
726
|
+
index: number;
|
|
727
|
+
source: PlayerSource;
|
|
728
|
+
};
|
|
729
|
+
'playlist-item-moved': {
|
|
730
|
+
fromIndex: number;
|
|
731
|
+
toIndex: number;
|
|
732
|
+
source: PlayerSource;
|
|
733
|
+
};
|
|
734
|
+
'playlist-near-end': {
|
|
735
|
+
index: number;
|
|
736
|
+
length: number;
|
|
737
|
+
remainingItems: number;
|
|
738
|
+
threshold: number;
|
|
739
|
+
};
|
|
740
|
+
'playlist-repeat-change': {
|
|
741
|
+
repeatMode: 'off' | 'repeat-all';
|
|
742
|
+
};
|
|
743
|
+
'autoscroll-change': {
|
|
744
|
+
autoScroll: boolean;
|
|
745
|
+
};
|
|
746
|
+
'live-status-change': {
|
|
747
|
+
isLive: boolean;
|
|
748
|
+
isLowLatency: boolean;
|
|
749
|
+
};
|
|
750
|
+
'live-sync-update': {
|
|
751
|
+
latency: number;
|
|
752
|
+
isAtLiveEdge: boolean;
|
|
753
|
+
playbackRate: number;
|
|
754
|
+
};
|
|
755
|
+
'live-edge-sync': {
|
|
756
|
+
latency: number;
|
|
757
|
+
};
|
|
758
|
+
sleeptimerstart: {
|
|
759
|
+
setting: 'off' | 10 | 15 | 20 | 30 | 45 | 60 | 'end';
|
|
760
|
+
secondsRemaining: number | null;
|
|
761
|
+
endTimeMs: number | null;
|
|
762
|
+
};
|
|
763
|
+
sleeptimerupdate: {
|
|
764
|
+
secondsRemaining: number;
|
|
765
|
+
endTimeMs: number;
|
|
766
|
+
};
|
|
767
|
+
sleeptimerexpired: undefined;
|
|
768
|
+
sleeptimercancelled: undefined;
|
|
769
|
+
'config-change': PlayerConfiguration;
|
|
770
|
+
timeupdate: {
|
|
771
|
+
currentTime: number;
|
|
772
|
+
duration: number;
|
|
773
|
+
};
|
|
774
|
+
waiting: undefined;
|
|
775
|
+
playing: undefined;
|
|
776
|
+
drmsessioncreated: {
|
|
777
|
+
session: MediaKeySession;
|
|
778
|
+
system: string;
|
|
779
|
+
};
|
|
780
|
+
drmsessionclosed: {
|
|
781
|
+
session: MediaKeySession;
|
|
782
|
+
system: string;
|
|
783
|
+
};
|
|
784
|
+
drmmessage: {
|
|
785
|
+
session: MediaKeySession;
|
|
786
|
+
messageType: MediaKeyMessageType;
|
|
787
|
+
message: ArrayBuffer;
|
|
788
|
+
};
|
|
789
|
+
drmkeychange: {
|
|
790
|
+
session: MediaKeySession;
|
|
791
|
+
keyStatuses: Record<string, string>;
|
|
792
|
+
};
|
|
793
|
+
drmerror: {
|
|
794
|
+
message: string;
|
|
795
|
+
system?: string;
|
|
796
|
+
code?: number;
|
|
797
|
+
errorType: 'key-system' | 'session' | 'license' | 'certificate';
|
|
798
|
+
/** Native EME/DRM error object caught while handling the failure - shape varies by browser/CDM. */
|
|
799
|
+
originalError?: unknown;
|
|
800
|
+
};
|
|
801
|
+
drmlicenserequest: {
|
|
802
|
+
url: string;
|
|
803
|
+
challengeSize: number;
|
|
804
|
+
system: string;
|
|
805
|
+
};
|
|
806
|
+
drmlicenseresponse: {
|
|
807
|
+
url: string;
|
|
808
|
+
responseSize: number;
|
|
809
|
+
system: string;
|
|
810
|
+
};
|
|
811
|
+
manifestloaded: {
|
|
812
|
+
system: 'hls' | 'dash';
|
|
813
|
+
levels?: number;
|
|
814
|
+
/** Raw manifest-parsed event payload from hls.js/dash.js - shape varies by library/version. */
|
|
815
|
+
data?: unknown;
|
|
816
|
+
};
|
|
817
|
+
adloadstart: {
|
|
818
|
+
adTagUrl: string;
|
|
819
|
+
} | undefined;
|
|
820
|
+
adloaded: {
|
|
821
|
+
ad: Advertisement;
|
|
822
|
+
} | undefined;
|
|
823
|
+
adstart: {
|
|
824
|
+
ad: Advertisement;
|
|
825
|
+
} | undefined;
|
|
826
|
+
adpause: {
|
|
827
|
+
ad: Advertisement;
|
|
828
|
+
} | undefined;
|
|
829
|
+
adresume: {
|
|
830
|
+
ad: Advertisement;
|
|
831
|
+
} | undefined;
|
|
832
|
+
adskip: {
|
|
833
|
+
ad: Advertisement;
|
|
834
|
+
} | undefined;
|
|
835
|
+
adcomplete: {
|
|
836
|
+
ad: Advertisement;
|
|
837
|
+
} | undefined;
|
|
838
|
+
adquartile: {
|
|
839
|
+
ad: Advertisement;
|
|
840
|
+
quartile: 1 | 2 | 3 | 4;
|
|
841
|
+
} | undefined;
|
|
842
|
+
admute: {
|
|
843
|
+
ad: Advertisement;
|
|
844
|
+
} | undefined;
|
|
845
|
+
adunmute: {
|
|
846
|
+
ad: Advertisement;
|
|
847
|
+
} | undefined;
|
|
848
|
+
adtimeupdate: {
|
|
849
|
+
currentTime: number;
|
|
850
|
+
duration: number;
|
|
851
|
+
remainingTime?: number;
|
|
852
|
+
} | undefined;
|
|
853
|
+
adproviderchange: {
|
|
854
|
+
providerName: string;
|
|
855
|
+
} | undefined;
|
|
856
|
+
aderror: {
|
|
857
|
+
error: AdError;
|
|
858
|
+
} | undefined;
|
|
859
|
+
adverificationready: {
|
|
860
|
+
ad: Advertisement;
|
|
861
|
+
verifications: AdVerification[];
|
|
862
|
+
} | undefined;
|
|
863
|
+
skipavailable: {
|
|
864
|
+
ad: Advertisement;
|
|
865
|
+
} | undefined;
|
|
866
|
+
admilestone: {
|
|
867
|
+
milestone: 'start' | 'firstQuartile' | 'midpoint' | 'thirdQuartile' | 'complete';
|
|
868
|
+
} | undefined;
|
|
869
|
+
companionshown: {
|
|
870
|
+
adId?: string;
|
|
871
|
+
slotId: string;
|
|
872
|
+
} | undefined;
|
|
873
|
+
companionerror: {
|
|
874
|
+
adId?: string;
|
|
875
|
+
slotId?: string;
|
|
876
|
+
reason: string;
|
|
877
|
+
} | undefined;
|
|
878
|
+
vmapparseerror: {
|
|
879
|
+
message: string;
|
|
880
|
+
} | undefined;
|
|
881
|
+
vmapbreakerror: {
|
|
882
|
+
breakId: string;
|
|
883
|
+
tagUrl: string;
|
|
884
|
+
message: string;
|
|
885
|
+
} | undefined;
|
|
886
|
+
htmloverlayavailable: {
|
|
887
|
+
adId?: string;
|
|
888
|
+
} | undefined;
|
|
889
|
+
htmloverlayloaded: {
|
|
890
|
+
adId?: string;
|
|
891
|
+
} | undefined;
|
|
892
|
+
htmloverlayshown: {
|
|
893
|
+
adId?: string;
|
|
894
|
+
} | undefined;
|
|
895
|
+
htmloverlayhidden: {
|
|
896
|
+
adId?: string;
|
|
897
|
+
} | undefined;
|
|
898
|
+
htmloverlayclosed: {
|
|
899
|
+
adId?: string;
|
|
900
|
+
} | undefined;
|
|
901
|
+
htmloverlayclick: {
|
|
902
|
+
adId?: string;
|
|
903
|
+
} | undefined;
|
|
904
|
+
htmloverlayerror: {
|
|
905
|
+
message: string;
|
|
906
|
+
} | undefined;
|
|
907
|
+
htmloverlaycompleted: {
|
|
908
|
+
adId?: string;
|
|
909
|
+
} | undefined;
|
|
910
|
+
htmloverlayupdated: {
|
|
911
|
+
adId?: string;
|
|
912
|
+
} | undefined;
|
|
913
|
+
adschedulerconflict: {
|
|
914
|
+
source: 'scheduler' | 'vmap';
|
|
915
|
+
reason: string;
|
|
916
|
+
} | undefined;
|
|
917
|
+
simidavailable: {
|
|
918
|
+
sessionId: string;
|
|
919
|
+
} | undefined;
|
|
920
|
+
simidstart: {
|
|
921
|
+
sessionId: string;
|
|
922
|
+
} | undefined;
|
|
923
|
+
simidready: {
|
|
924
|
+
sessionId: string;
|
|
925
|
+
} | undefined;
|
|
926
|
+
simiderror: {
|
|
927
|
+
message: string;
|
|
928
|
+
code?: number;
|
|
929
|
+
fatal?: boolean;
|
|
930
|
+
} | undefined;
|
|
931
|
+
simidcomplete: undefined;
|
|
932
|
+
simidinteraction: Record<string, unknown> | undefined;
|
|
933
|
+
simidsecurityerror: {
|
|
934
|
+
reason: string;
|
|
935
|
+
url?: string;
|
|
936
|
+
} | undefined;
|
|
937
|
+
simidclick: {
|
|
938
|
+
url?: string;
|
|
939
|
+
trackingUrls?: string[];
|
|
940
|
+
playerHandled?: boolean;
|
|
941
|
+
} | undefined;
|
|
942
|
+
simiddurationchange: {
|
|
943
|
+
duration: number;
|
|
944
|
+
extensionSec: number;
|
|
945
|
+
maxAllowed: number;
|
|
946
|
+
} | undefined;
|
|
947
|
+
simidcreativeerror: {
|
|
948
|
+
code?: number;
|
|
949
|
+
message: string;
|
|
950
|
+
fatal?: boolean;
|
|
951
|
+
} | undefined;
|
|
952
|
+
simidpause: undefined;
|
|
953
|
+
simidresume: undefined;
|
|
954
|
+
simidresize: {
|
|
955
|
+
width: number;
|
|
956
|
+
height: number;
|
|
957
|
+
} | undefined;
|
|
958
|
+
simidfullscreen: undefined;
|
|
959
|
+
simidexitfullscreen: undefined;
|
|
960
|
+
simidcollapse: undefined;
|
|
961
|
+
simidexpand: undefined;
|
|
962
|
+
simidskip: undefined;
|
|
963
|
+
simidstop: undefined;
|
|
964
|
+
}
|
|
965
|
+
export interface PlayerStatistics {
|
|
966
|
+
currentTime: number;
|
|
967
|
+
duration: number;
|
|
968
|
+
playbackRate: number;
|
|
969
|
+
paused: boolean;
|
|
970
|
+
ended: boolean;
|
|
971
|
+
muted: boolean;
|
|
972
|
+
volume: number;
|
|
973
|
+
width?: number;
|
|
974
|
+
height?: number;
|
|
975
|
+
fps?: number;
|
|
976
|
+
droppedFrames?: number;
|
|
977
|
+
decodedFrames?: number;
|
|
978
|
+
bufferedLength?: number;
|
|
979
|
+
bufferHealth?: number;
|
|
980
|
+
bitrate?: number;
|
|
981
|
+
bandwidthEstimate?: number;
|
|
982
|
+
isLive?: boolean;
|
|
983
|
+
liveLatency?: number;
|
|
984
|
+
isLowLatency?: boolean;
|
|
985
|
+
}
|
|
986
|
+
export interface DrmSystemConfig {
|
|
987
|
+
/** The license acquisition server URL. */
|
|
988
|
+
licenseUrl?: string;
|
|
989
|
+
/** Optional custom HTTP headers sent with the licensing requests. */
|
|
990
|
+
headers?: Record<string, string>;
|
|
991
|
+
/** Set to true to include cookies or authentication credentials in requests. */
|
|
992
|
+
withCredentials?: boolean;
|
|
993
|
+
/** Optional server certificate URL (primarily Widevine/PlayReady). */
|
|
994
|
+
serverCertificateUrl?: string;
|
|
995
|
+
/** Server certificate payload raw binary data (can be passed synchronously). */
|
|
996
|
+
serverCertificate?: Uint8Array;
|
|
997
|
+
/** Number of retries for transient failures. Default: 3. */
|
|
998
|
+
retryCount?: number;
|
|
999
|
+
/** Timeout in milliseconds for requests. Default: 10000. */
|
|
1000
|
+
timeout?: number;
|
|
1001
|
+
/** Optional custom function to intercept/modify the raw license challenge before sending. */
|
|
1002
|
+
licenseRequestInterceptor?: (challenge: ArrayBuffer, system: string) => ArrayBuffer | Promise<ArrayBuffer> | {
|
|
1003
|
+
body: ArrayBuffer | ArrayBufferView | string;
|
|
1004
|
+
headers?: Record<string, string>;
|
|
1005
|
+
} | Promise<{
|
|
1006
|
+
body: ArrayBuffer | ArrayBufferView | string;
|
|
1007
|
+
headers?: Record<string, string>;
|
|
1008
|
+
}>;
|
|
1009
|
+
/** Optional custom function to intercept/modify the raw license response from the server. */
|
|
1010
|
+
licenseResponseInterceptor?: (response: ArrayBuffer, system: string) => ArrayBuffer | Promise<ArrayBuffer>;
|
|
1011
|
+
}
|
|
1012
|
+
export interface FairPlayConfig extends DrmSystemConfig {
|
|
1013
|
+
/** The certificate URL of the FairPlay application. Required for FairPlay. */
|
|
1014
|
+
certificateUrl?: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* Optional custom function to extract the FairPlay content/asset ID from
|
|
1017
|
+
* the raw initData. Defaults to parsing the `skd://` URI scheme out of it.
|
|
1018
|
+
*/
|
|
1019
|
+
extractContentId?: (initData: Uint8Array) => string;
|
|
1020
|
+
}
|
|
1021
|
+
export interface DrmConfig {
|
|
1022
|
+
/** Widevine configurations. */
|
|
1023
|
+
widevine?: DrmSystemConfig;
|
|
1024
|
+
/** PlayReady configurations. */
|
|
1025
|
+
playready?: DrmSystemConfig;
|
|
1026
|
+
/** FairPlay configurations (Safari/iOS/macOS). */
|
|
1027
|
+
fairplay?: FairPlayConfig;
|
|
1028
|
+
/** ClearKey licensing parameters. */
|
|
1029
|
+
clearkey?: {
|
|
1030
|
+
/** ClearKey Key ID -> Key mapping. Hex is the primary format; base64url is also accepted for compatibility. */
|
|
1031
|
+
clearkeys?: Record<string, string>;
|
|
1032
|
+
/** Optional license server url fallback. */
|
|
1033
|
+
licenseUrl?: string;
|
|
1034
|
+
/** Custom headers for ClearKey licensing requests. */
|
|
1035
|
+
headers?: Record<string, string>;
|
|
1036
|
+
};
|
|
1037
|
+
/** Robustness preferences for EME capability resolution. */
|
|
1038
|
+
robustness?: {
|
|
1039
|
+
audio?: string;
|
|
1040
|
+
video?: string;
|
|
1041
|
+
};
|
|
1042
|
+
/** Distinctive identifier setting. */
|
|
1043
|
+
distinctiveIdentifier?: 'required' | 'optional' | 'not-allowed';
|
|
1044
|
+
/** Persistent state setting. */
|
|
1045
|
+
persistentState?: 'required' | 'optional' | 'not-allowed';
|
|
1046
|
+
/** Global number of retries for transient failures. Default: 3. */
|
|
1047
|
+
retryCount?: number;
|
|
1048
|
+
/** Global timeout in milliseconds for requests. Default: 10000. */
|
|
1049
|
+
timeout?: number;
|
|
1050
|
+
}
|
|
1051
|
+
export declare enum AdState {
|
|
1052
|
+
IDLE = "idle",
|
|
1053
|
+
REQUESTING = "ad-requesting",
|
|
1054
|
+
LOADED = "ad-loaded",
|
|
1055
|
+
PLAYING = "ad-playing",
|
|
1056
|
+
PAUSED = "ad-paused",
|
|
1057
|
+
BUFFERING = "ad-buffering",
|
|
1058
|
+
SKIPPING = "ad-skipping",
|
|
1059
|
+
ENDED = "ad-ended",
|
|
1060
|
+
ERROR = "ad-error",
|
|
1061
|
+
CONTENT_RESUMING = "content-resuming"
|
|
1062
|
+
}
|
|
1063
|
+
export declare enum AdBreakType {
|
|
1064
|
+
PREROLL = "preroll",
|
|
1065
|
+
MIDROLL = "midroll",
|
|
1066
|
+
POSTROLL = "postroll"
|
|
1067
|
+
}
|
|
1068
|
+
export declare enum AdProviderType {
|
|
1069
|
+
IMA = "IMA",
|
|
1070
|
+
VAST = "VAST",
|
|
1071
|
+
VMAP = "VMAP",
|
|
1072
|
+
CUSTOM = "CUSTOM"
|
|
1073
|
+
}
|
|
1074
|
+
export declare enum AdSkipMode {
|
|
1075
|
+
AUTO = "auto",
|
|
1076
|
+
USER = "user",
|
|
1077
|
+
DISABLED = "disabled"
|
|
1078
|
+
}
|
|
1079
|
+
export declare enum AdPlacementType {
|
|
1080
|
+
LINEAR = "linear",
|
|
1081
|
+
NON_LINEAR = "non-linear",
|
|
1082
|
+
COMPANION = "companion",
|
|
1083
|
+
OVERLAY = "overlay"
|
|
1084
|
+
}
|
|
1085
|
+
export declare enum TrackingEventName {
|
|
1086
|
+
IMPRESSION = "impression",
|
|
1087
|
+
CREATIVE_VIEW = "creativeView",
|
|
1088
|
+
START = "start",
|
|
1089
|
+
FIRST_QUARTILE = "firstQuartile",
|
|
1090
|
+
MIDPOINT = "midpoint",
|
|
1091
|
+
THIRD_QUARTILE = "thirdQuartile",
|
|
1092
|
+
COMPLETE = "complete",
|
|
1093
|
+
PAUSE = "pause",
|
|
1094
|
+
RESUME = "resume",
|
|
1095
|
+
MUTE = "mute",
|
|
1096
|
+
UNMUTE = "unmute",
|
|
1097
|
+
CLICK = "click",
|
|
1098
|
+
SKIP = "skip",
|
|
1099
|
+
CLOSE = "close",
|
|
1100
|
+
ERROR = "error"
|
|
1101
|
+
}
|
|
1102
|
+
export interface AdsRequestConfig {
|
|
1103
|
+
timeout?: number;
|
|
1104
|
+
retryCount?: number;
|
|
1105
|
+
withCredentials?: boolean;
|
|
1106
|
+
headers?: Record<string, string>;
|
|
1107
|
+
/** Caller-supplied opaque metadata forwarded to the ad request - no fixed shape. */
|
|
1108
|
+
customMetadata?: Record<string, unknown>;
|
|
1109
|
+
}
|
|
1110
|
+
export interface AdsPlaybackConfig {
|
|
1111
|
+
autoplay?: boolean;
|
|
1112
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
1113
|
+
skipMode?: AdSkipMode;
|
|
1114
|
+
skipOffset?: number;
|
|
1115
|
+
}
|
|
1116
|
+
export interface AdsTrackingConfig {
|
|
1117
|
+
trackImpression?: boolean;
|
|
1118
|
+
trackQuartiles?: boolean;
|
|
1119
|
+
customTracker?: (event: string, url: string) => void;
|
|
1120
|
+
}
|
|
1121
|
+
export interface AdsUiConfig {
|
|
1122
|
+
enabled?: boolean;
|
|
1123
|
+
showCountdown?: boolean;
|
|
1124
|
+
showSkipButton?: boolean;
|
|
1125
|
+
adOverlaySlot?: string;
|
|
1126
|
+
companionSlots?: CompanionSlot[];
|
|
1127
|
+
/**
|
|
1128
|
+
* Default HTML sanitizer applied to HTML-string overlay/companion creatives
|
|
1129
|
+
* (htmlContent) that don't set their own per-ad `sanitizeHtml`. Ad-server
|
|
1130
|
+
* supplied HTML is rendered via innerHTML - without a sanitizer (here or
|
|
1131
|
+
* per-ad), that HTML is trusted as-is, which is an XSS risk for untrusted
|
|
1132
|
+
* ad sources. Strongly recommended in production.
|
|
1133
|
+
*/
|
|
1134
|
+
sanitizeHtml?: (html: string) => string;
|
|
1135
|
+
}
|
|
1136
|
+
export interface AdsConfig {
|
|
1137
|
+
enabled?: boolean;
|
|
1138
|
+
provider?: AdProviderType | string;
|
|
1139
|
+
tagUrl?: string;
|
|
1140
|
+
inlineXml?: string;
|
|
1141
|
+
request?: AdsRequestConfig;
|
|
1142
|
+
playback?: AdsPlaybackConfig;
|
|
1143
|
+
tracking?: AdsTrackingConfig;
|
|
1144
|
+
ui?: AdsUiConfig;
|
|
1145
|
+
/** Caller-supplied opaque per-provider options (e.g. IMA SDK settings) - no fixed shape across providers. */
|
|
1146
|
+
providerOptions?: Record<string, unknown>;
|
|
1147
|
+
/** Caller-supplied opaque metadata forwarded to the ad request - no fixed shape. */
|
|
1148
|
+
customMetadata?: Record<string, unknown>;
|
|
1149
|
+
/** Configuration for SIMID interactive-creative sessions (handshake timeouts, allowed origins, etc). */
|
|
1150
|
+
simid?: SimidConfig;
|
|
1151
|
+
/** Escape hatch for consumer/provider-defined ads configuration extensions. */
|
|
1152
|
+
[key: string]: unknown;
|
|
1153
|
+
}
|
|
1154
|
+
export interface Advertisement {
|
|
1155
|
+
readonly id: string;
|
|
1156
|
+
readonly title: string;
|
|
1157
|
+
readonly duration: number;
|
|
1158
|
+
readonly width?: number;
|
|
1159
|
+
readonly height?: number;
|
|
1160
|
+
readonly linear: boolean;
|
|
1161
|
+
readonly skippable: boolean;
|
|
1162
|
+
readonly skipOffset?: number;
|
|
1163
|
+
readonly clickThroughUrl?: string;
|
|
1164
|
+
readonly trackingUrls?: TrackingUrl[];
|
|
1165
|
+
readonly contentType?: string;
|
|
1166
|
+
readonly creativeId?: string;
|
|
1167
|
+
readonly adSystem?: string;
|
|
1168
|
+
readonly htmlContent?: string;
|
|
1169
|
+
readonly htmlUrl?: string;
|
|
1170
|
+
readonly htmlTemplateId?: string;
|
|
1171
|
+
readonly useIframe?: boolean;
|
|
1172
|
+
readonly imageUrl?: string;
|
|
1173
|
+
readonly errorUrls?: string[];
|
|
1174
|
+
readonly creativeParameters?: Record<string, unknown> | string;
|
|
1175
|
+
readonly position?: 'top' | 'bottom' | 'left' | 'right' | 'center' | string;
|
|
1176
|
+
readonly overlayStyle?: Record<string, string | number>;
|
|
1177
|
+
readonly margin?: string;
|
|
1178
|
+
readonly padding?: string;
|
|
1179
|
+
readonly opacity?: number;
|
|
1180
|
+
readonly pointerEvents?: string;
|
|
1181
|
+
readonly zIndex?: number;
|
|
1182
|
+
readonly closeDelay?: number;
|
|
1183
|
+
readonly iframeSandbox?: string;
|
|
1184
|
+
readonly trustedOrigins?: string[];
|
|
1185
|
+
readonly sanitizeHtml?: (html: string) => string;
|
|
1186
|
+
readonly externalSlot?: HTMLElement | string;
|
|
1187
|
+
readonly responsive?: boolean;
|
|
1188
|
+
readonly maxWidth?: number;
|
|
1189
|
+
readonly maxHeight?: number;
|
|
1190
|
+
readonly closeButton?: boolean | {
|
|
1191
|
+
enabled?: boolean;
|
|
1192
|
+
delaySeconds?: number;
|
|
1193
|
+
label?: string;
|
|
1194
|
+
styleOverrides?: Record<string, string>;
|
|
1195
|
+
className?: string;
|
|
1196
|
+
};
|
|
1197
|
+
/** Companion creatives associated with this ad (e.g. VAST Companion Ads) -
|
|
1198
|
+
* rendered separately from the ad itself via AdsManager.showCompanions(). */
|
|
1199
|
+
readonly companions?: Advertisement[];
|
|
1200
|
+
}
|
|
1201
|
+
export interface HtmlOverlayConfig {
|
|
1202
|
+
id?: string;
|
|
1203
|
+
title?: string;
|
|
1204
|
+
position?: 'top' | 'bottom' | 'left' | 'right' | 'center' | string;
|
|
1205
|
+
overlayStyle?: Record<string, string | number>;
|
|
1206
|
+
width?: number;
|
|
1207
|
+
height?: number;
|
|
1208
|
+
maxWidth?: number;
|
|
1209
|
+
maxHeight?: number;
|
|
1210
|
+
responsive?: boolean;
|
|
1211
|
+
duration?: number;
|
|
1212
|
+
closeButton?: boolean | {
|
|
1213
|
+
enabled?: boolean;
|
|
1214
|
+
delaySeconds?: number;
|
|
1215
|
+
label?: string;
|
|
1216
|
+
styleOverrides?: Record<string, string>;
|
|
1217
|
+
className?: string;
|
|
1218
|
+
};
|
|
1219
|
+
closeDelay?: number;
|
|
1220
|
+
clickThroughUrl?: string;
|
|
1221
|
+
trackingUrls?: TrackingUrl[];
|
|
1222
|
+
externalSlot?: HTMLElement | string;
|
|
1223
|
+
zIndex?: number;
|
|
1224
|
+
trustedOrigins?: string[];
|
|
1225
|
+
iframeSandbox?: string;
|
|
1226
|
+
sanitizeHtml?: (html: string) => string;
|
|
1227
|
+
htmlContent?: string;
|
|
1228
|
+
htmlUrl?: string;
|
|
1229
|
+
htmlTemplateId?: string;
|
|
1230
|
+
imageUrl?: string;
|
|
1231
|
+
useIframe?: boolean;
|
|
1232
|
+
opacity?: number;
|
|
1233
|
+
pointerEvents?: string;
|
|
1234
|
+
margin?: string;
|
|
1235
|
+
padding?: string;
|
|
1236
|
+
}
|
|
1237
|
+
export interface AdCreative {
|
|
1238
|
+
readonly id: string;
|
|
1239
|
+
readonly adId: string;
|
|
1240
|
+
readonly contentType: string;
|
|
1241
|
+
readonly width?: number;
|
|
1242
|
+
readonly height?: number;
|
|
1243
|
+
readonly mediaFiles: AdMedia[];
|
|
1244
|
+
readonly clickThrough?: ClickThrough;
|
|
1245
|
+
readonly trackingEvents: TrackingEvent[];
|
|
1246
|
+
}
|
|
1247
|
+
export interface AdMedia {
|
|
1248
|
+
readonly url: string;
|
|
1249
|
+
readonly bitrate?: number;
|
|
1250
|
+
readonly width?: number;
|
|
1251
|
+
readonly height?: number;
|
|
1252
|
+
readonly contentType: string;
|
|
1253
|
+
readonly delivery?: 'progressive' | 'streaming';
|
|
1254
|
+
}
|
|
1255
|
+
export interface CompanionAd {
|
|
1256
|
+
readonly id: string;
|
|
1257
|
+
readonly width: number;
|
|
1258
|
+
readonly height: number;
|
|
1259
|
+
readonly resourceType: 'static' | 'html' | 'iframe';
|
|
1260
|
+
readonly resourceUrl: string;
|
|
1261
|
+
readonly clickThroughUrl?: string;
|
|
1262
|
+
readonly trackingUrls?: TrackingUrl[];
|
|
1263
|
+
}
|
|
1264
|
+
export interface OverlayAd {
|
|
1265
|
+
readonly id: string;
|
|
1266
|
+
readonly width?: number;
|
|
1267
|
+
readonly height?: number;
|
|
1268
|
+
readonly resourceUrl: string;
|
|
1269
|
+
readonly clickThroughUrl?: string;
|
|
1270
|
+
readonly trackingUrls?: TrackingUrl[];
|
|
1271
|
+
}
|
|
1272
|
+
export interface NonLinearAd {
|
|
1273
|
+
readonly id: string;
|
|
1274
|
+
readonly width: number;
|
|
1275
|
+
readonly height: number;
|
|
1276
|
+
readonly resourceType: 'static' | 'html' | 'iframe';
|
|
1277
|
+
readonly resourceUrl: string;
|
|
1278
|
+
readonly clickThroughUrl?: string;
|
|
1279
|
+
readonly trackingUrls?: TrackingUrl[];
|
|
1280
|
+
}
|
|
1281
|
+
export interface AdBreak {
|
|
1282
|
+
readonly id: string;
|
|
1283
|
+
readonly timeOffset: number;
|
|
1284
|
+
readonly type: 'preroll' | 'midroll' | 'postroll';
|
|
1285
|
+
readonly ads: Advertisement[];
|
|
1286
|
+
readonly duration?: number;
|
|
1287
|
+
}
|
|
1288
|
+
export interface AdSchedule {
|
|
1289
|
+
readonly adBreaks: AdBreak[];
|
|
1290
|
+
}
|
|
1291
|
+
export type TrackingEventType = 'impression' | 'creativeView' | 'start' | 'firstQuartile' | 'midpoint' | 'thirdQuartile' | 'complete' | 'pause' | 'resume' | 'mute' | 'unmute' | 'click' | 'skip' | 'close' | 'error';
|
|
1292
|
+
export interface TrackingEvent {
|
|
1293
|
+
readonly type: TrackingEventType;
|
|
1294
|
+
readonly url: string;
|
|
1295
|
+
}
|
|
1296
|
+
export interface TrackingUrl {
|
|
1297
|
+
readonly url: string;
|
|
1298
|
+
readonly event?: string;
|
|
1299
|
+
}
|
|
1300
|
+
/** A VAST `<Verification>` (Open Measurement / OM SDK) entry: an ad-verification vendor + its JS resource. */
|
|
1301
|
+
export interface AdVerification {
|
|
1302
|
+
readonly vendor: string;
|
|
1303
|
+
readonly script: string;
|
|
1304
|
+
}
|
|
1305
|
+
export interface ClickThrough {
|
|
1306
|
+
readonly url: string;
|
|
1307
|
+
readonly trackingUrls?: string[];
|
|
1308
|
+
}
|
|
1309
|
+
export interface CompanionSlot {
|
|
1310
|
+
readonly id: string;
|
|
1311
|
+
readonly width: number;
|
|
1312
|
+
readonly height: number;
|
|
1313
|
+
readonly elementId: string;
|
|
1314
|
+
}
|
|
1315
|
+
export interface ProviderInfo {
|
|
1316
|
+
readonly name: string;
|
|
1317
|
+
readonly version: string;
|
|
1318
|
+
}
|
|
1319
|
+
export interface CapabilityInfo {
|
|
1320
|
+
readonly supportsLinear: boolean;
|
|
1321
|
+
readonly supportsNonLinear: boolean;
|
|
1322
|
+
readonly supportsCompanion: boolean;
|
|
1323
|
+
readonly supportsSkippable: boolean;
|
|
1324
|
+
readonly supportsVMAP: boolean;
|
|
1325
|
+
readonly supportsVAST: boolean;
|
|
1326
|
+
readonly supportsSSAI: boolean;
|
|
1327
|
+
readonly supportsIMA: boolean;
|
|
1328
|
+
}
|
|
1329
|
+
export interface ProviderCapabilities {
|
|
1330
|
+
readonly capabilities: CapabilityInfo;
|
|
1331
|
+
}
|
|
1332
|
+
export interface ProviderContext {
|
|
1333
|
+
readonly videoElement: HTMLVideoElement;
|
|
1334
|
+
readonly adContainer: HTMLElement;
|
|
1335
|
+
readonly controller: PlayerController;
|
|
1336
|
+
readonly config: AdsConfig;
|
|
1337
|
+
}
|
|
1338
|
+
export interface ProviderResult {
|
|
1339
|
+
readonly success: boolean;
|
|
1340
|
+
readonly error?: AdError;
|
|
1341
|
+
}
|
|
1342
|
+
export declare enum AdErrorType {
|
|
1343
|
+
CONFIGURATION = "configuration",
|
|
1344
|
+
PROVIDER = "provider",
|
|
1345
|
+
NETWORK = "network",
|
|
1346
|
+
TIMEOUT = "timeout",
|
|
1347
|
+
PARSING = "parsing",
|
|
1348
|
+
PLAYBACK = "playback",
|
|
1349
|
+
TRACKING = "tracking",
|
|
1350
|
+
/**
|
|
1351
|
+
* The ad request/resource most likely failed because a browser-level or
|
|
1352
|
+
* extension ad blocker intercepted it (e.g. Opera's built-in blocker,
|
|
1353
|
+
* uBlock Origin, AdGuard) - distinct from NETWORK so consumers can show a
|
|
1354
|
+
* more accurate diagnostic instead of treating it as a generic outage.
|
|
1355
|
+
*/
|
|
1356
|
+
BLOCKED = "blocked",
|
|
1357
|
+
UNKNOWN = "unknown"
|
|
1358
|
+
}
|
|
1359
|
+
export interface AdError {
|
|
1360
|
+
readonly type: AdErrorType | string;
|
|
1361
|
+
readonly code: number;
|
|
1362
|
+
readonly message: string;
|
|
1363
|
+
/** Native/underlying error caught while handling the ad failure - shape varies by provider/browser. */
|
|
1364
|
+
readonly originalError?: unknown;
|
|
1365
|
+
}
|
|
1366
|
+
export interface AdProvider {
|
|
1367
|
+
readonly name: string;
|
|
1368
|
+
readonly capabilities: CapabilityInfo;
|
|
1369
|
+
init(context: ProviderContext): Promise<ProviderResult> | ProviderResult;
|
|
1370
|
+
requestAds(adTagUrl: string, config?: Record<string, unknown>): Promise<ProviderResult> | ProviderResult;
|
|
1371
|
+
playAdBreak(breakType?: 'preroll' | 'midroll' | 'postroll'): Promise<void>;
|
|
1372
|
+
pauseAd(): void;
|
|
1373
|
+
resumeAd(): void;
|
|
1374
|
+
setVolume(volume: number): void;
|
|
1375
|
+
setMuted(muted: boolean): void;
|
|
1376
|
+
skipAd?(): void;
|
|
1377
|
+
onSourceLoaded?(source?: PlayerSource): void;
|
|
1378
|
+
destroy(): void;
|
|
1379
|
+
}
|
|
1380
|
+
export interface AdsDiagnostics {
|
|
1381
|
+
readonly providerName: string | null;
|
|
1382
|
+
readonly state: AdState | string;
|
|
1383
|
+
readonly configuration: AdsConfig | null;
|
|
1384
|
+
readonly lastError: AdError | null;
|
|
1385
|
+
readonly statistics: {
|
|
1386
|
+
readonly totalAdsRequested: number;
|
|
1387
|
+
readonly totalAdsPlayed: number;
|
|
1388
|
+
readonly totalAdsCompleted: number;
|
|
1389
|
+
readonly totalAdsSkipped: number;
|
|
1390
|
+
readonly totalAdErrors: number;
|
|
1391
|
+
};
|
|
1392
|
+
readonly htmlOverlay?: HtmlOverlayDiagnostics | null;
|
|
1393
|
+
}
|
|
1394
|
+
export interface AdsValidationReport {
|
|
1395
|
+
passed: boolean;
|
|
1396
|
+
providerConfigured: boolean;
|
|
1397
|
+
tagUrlValid: boolean;
|
|
1398
|
+
errors: string[];
|
|
1399
|
+
}
|
|
1400
|
+
export declare class AdsValidator {
|
|
1401
|
+
static validate(controller: PlayerController): AdsValidationReport;
|
|
1402
|
+
}
|
|
1403
|
+
//# sourceMappingURL=types.d.ts.map
|