@phont-ai/subtitles 0.1.64 → 0.1.69
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/dist/index.d.mts +262 -26
- package/dist/index.d.ts +262 -26
- package/dist/index.js +220 -67
- package/dist/index.mjs +220 -67
- package/dist/styles.css +24 -55
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnimationFetcher, PhontClient, LoginResponse, RegisterResponse, WordAnimationState } from '@phont-ai/subtitles-core';
|
|
2
|
-
export { AnimationFetcher, LoginResponse, PhontClient, PhontClientOptions, PublishedAnimationResolver, RegisterResponse, VodMetadata, calculateAnimationState, createPublishedAnimationResolver, decodeAnimationUrl, subtitleManager } from '@phont-ai/subtitles-core';
|
|
1
|
+
import { AnimationFetcher, PhontClient, LiveSegmentSource, LoginResponse, RegisterResponse, WordAnimationState } from '@phont-ai/subtitles-core';
|
|
2
|
+
export { AnimationFetcher, InitialPlaylist, LiveSegmentSource, LoginResponse, PhontClient, PhontClientOptions, PublishedAnimationResolver, RegisterResponse, SegmentInfo, VodMetadata, calculateAnimationState, createBitmovinLiveSegmentSource, createHlsLiveSegmentSource, createLiveSegmentSource, createPublishedAnimationResolver, createShakaLiveSegmentSource, decodeAnimationUrl, subtitleManager } from '@phont-ai/subtitles-core';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import React__default, { ReactNode, RefObject, CSSProperties } from 'react';
|
|
5
5
|
|
|
6
6
|
interface PhontClientConfig {
|
|
7
7
|
apiKey: string;
|
|
@@ -100,6 +100,10 @@ declare function configurePublishedAnimationFetcher(fetcher: AnimationFetcher):
|
|
|
100
100
|
* The URL origin (localhost vs. phont.ai vs. tenant subdomain) is
|
|
101
101
|
* irrelevant — animation URLs are parsed, not fetched.
|
|
102
102
|
*/
|
|
103
|
+
/**
|
|
104
|
+
* Bust the module-level resolver cache (call after publishing a new animation version).
|
|
105
|
+
*/
|
|
106
|
+
declare function invalidatePublishedAnimationResolverCache(): void;
|
|
103
107
|
declare function usePublishedAnimationResolver(): {
|
|
104
108
|
/**
|
|
105
109
|
* Resolve an animation URL.
|
|
@@ -130,6 +134,50 @@ declare function StylesheetProvider({ children, defaultStylesheet, }: {
|
|
|
130
134
|
}): React__default.JSX.Element;
|
|
131
135
|
declare function useStylesheet(): StylesheetContextValue;
|
|
132
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Centralized overlay positioning configuration (app/video parity).
|
|
139
|
+
*/
|
|
140
|
+
/** Fullscreen /video reference frame — embedded players scale from this. */
|
|
141
|
+
declare const SUBTITLE_LAYOUT_REFERENCE: {
|
|
142
|
+
readonly width: 1920;
|
|
143
|
+
readonly baseFontSize: number;
|
|
144
|
+
readonly bottomPercent: 10;
|
|
145
|
+
readonly mobileBottomPercent: 22;
|
|
146
|
+
};
|
|
147
|
+
type SubtitleLayoutMode = 'viewport' | 'player';
|
|
148
|
+
/**
|
|
149
|
+
* Shared offsets for Phont overlays above native player chrome (3Q control bar + progress).
|
|
150
|
+
* Pixel-based — avoids % growing with fullscreen viewport height.
|
|
151
|
+
*/
|
|
152
|
+
declare const PLAYER_CHROME_LAYOUT: {
|
|
153
|
+
/** Native control bar + progress strip height. */
|
|
154
|
+
readonly controlBarPx: 58;
|
|
155
|
+
/** Space between control bar top and subtitle baseline. */
|
|
156
|
+
readonly subtitleGapPx: 14;
|
|
157
|
+
/** Extra lift on narrow player embeds. */
|
|
158
|
+
readonly mobileSubtitleExtraPx: 6;
|
|
159
|
+
/** CC toggle shares the subtitle row baseline (not the player control bar). */
|
|
160
|
+
readonly controlsAlignWithSubtitles: true;
|
|
161
|
+
readonly rightPx: 12;
|
|
162
|
+
readonly subtitlePanelBackground: "#000000";
|
|
163
|
+
readonly subtitlePanelBorderRadius: 0;
|
|
164
|
+
/** @deprecated CC toggle uses subtitlePanelBackground */
|
|
165
|
+
readonly glassBackground: "#000000";
|
|
166
|
+
readonly glassBlur: "none";
|
|
167
|
+
};
|
|
168
|
+
declare function getPlayerSubtitleBottomPx(shouldUseMobile?: boolean): number;
|
|
169
|
+
interface PositionConfig {
|
|
170
|
+
bottomVh: number;
|
|
171
|
+
bottomVhNoSpeaker: number;
|
|
172
|
+
mobileBottomVh: number;
|
|
173
|
+
mobileBottomVhNoSpeaker: number;
|
|
174
|
+
zIndex: number;
|
|
175
|
+
width: number | string;
|
|
176
|
+
mobileWidth: string;
|
|
177
|
+
maxMobileWidth: number | string;
|
|
178
|
+
height: number | string;
|
|
179
|
+
}
|
|
180
|
+
|
|
133
181
|
/**
|
|
134
182
|
* PhontSubtitles Component
|
|
135
183
|
*
|
|
@@ -149,10 +197,27 @@ interface PhontSubtitlesProps {
|
|
|
149
197
|
className?: string;
|
|
150
198
|
style?: React__default.CSSProperties;
|
|
151
199
|
subtitleAvailable?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* `player` — absolute overlay inside `playerContainerRef` (default).
|
|
202
|
+
* `viewport` — legacy fullscreen fixed positioning.
|
|
203
|
+
*/
|
|
204
|
+
layoutMode?: SubtitleLayoutMode;
|
|
205
|
+
/** Measured for player-relative scale + position. Required for correct embedded layout. */
|
|
206
|
+
playerContainerRef?: React__default.RefObject<HTMLElement | null>;
|
|
152
207
|
}
|
|
153
|
-
declare function PhontSubtitles({ vodId, currentTime, isPlaying, mode, language, maxExpression, threshold, isRTL, phontClient, className, style, subtitleAvailable, }: PhontSubtitlesProps): React__default.JSX.Element | null;
|
|
208
|
+
declare function PhontSubtitles({ vodId, currentTime, isPlaying, mode, language, maxExpression, threshold, isRTL, phontClient, className, style, subtitleAvailable, layoutMode, playerContainerRef, }: PhontSubtitlesProps): React__default.JSX.Element | null;
|
|
154
209
|
|
|
155
|
-
|
|
210
|
+
/**
|
|
211
|
+
* 3Q SDN overlay helpers.
|
|
212
|
+
*
|
|
213
|
+
* 3Q fullscreens the container id passed to `js3q`. Phont overlays must live
|
|
214
|
+
* inside that same element (not a parent wrapper), or they disappear in fullscreen.
|
|
215
|
+
*/
|
|
216
|
+
declare const THREEQ_OVERLAY_MOUNT_CSS = "\n .phont-threeq-overlay-root {\n position: absolute;\n inset: 0;\n z-index: 2147483646;\n pointer-events: none;\n overflow: visible;\n }\n .phont-threeq-overlay-root [data-phont-panel],\n .phont-threeq-overlay-root .subtitle-container,\n .phont-threeq-overlay-root .pointer-events-none {\n pointer-events: none;\n }\n .phont-threeq-overlay-root [data-phont-panel] {\n pointer-events: auto;\n }\n .phont-threeq-overlay-root button[aria-label=\"Open Emotion & Voice\"] {\n pointer-events: auto;\n }\n .phont-threeq-overlay-root [data-phont-panel] .phont-emotion-slider,\n :fullscreen .phont-threeq-overlay-root [data-phont-panel] .phont-emotion-slider {\n -webkit-appearance: none !important;\n appearance: none !important;\n display: block !important;\n width: 100% !important;\n min-width: 100% !important;\n height: 2px !important;\n min-height: 0 !important;\n max-height: 2px !important;\n padding: 0 !important;\n border: none !important;\n background: transparent !important;\n box-sizing: border-box !important;\n }\n .phont-threeq-overlay-root [data-phont-panel] .phont-emotion-slider::-webkit-slider-runnable-track,\n :fullscreen .phont-threeq-overlay-root [data-phont-panel] .phont-emotion-slider::-webkit-slider-runnable-track {\n -webkit-appearance: none !important;\n width: 100% !important;\n height: 2px !important;\n background: #e5e7eb !important;\n border: none !important;\n }\n .phont-threeq-overlay-root [data-phont-panel] .phont-emotion-slider::-webkit-slider-thumb,\n :fullscreen .phont-threeq-overlay-root [data-phont-panel] .phont-emotion-slider::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n width: 12px !important;\n height: 12px !important;\n margin-top: -5px !important;\n border: none !important;\n background: #ffffff !important;\n }\n";
|
|
217
|
+
/** Persistent mount inside the 3Q container — same node 3Q fullscreens. */
|
|
218
|
+
declare function ensureThreeqOverlayHost(container: HTMLElement | null | undefined): HTMLElement | null;
|
|
219
|
+
|
|
220
|
+
declare function PhontSubtitlesWithUrlAnimations({ segment, currentTime, isPlaying, maxExpression, threshold, className, style, nextSegment, forceMobile, fontFallbackMode, disablePublishedAnimationFetch, layoutMode, playerContainerRef, }: {
|
|
156
221
|
segment: any;
|
|
157
222
|
currentTime: number;
|
|
158
223
|
isPlaying?: boolean;
|
|
@@ -164,9 +229,11 @@ declare function PhontSubtitlesWithUrlAnimations({ segment, currentTime, isPlayi
|
|
|
164
229
|
forceMobile?: boolean;
|
|
165
230
|
fontFallbackMode?: boolean;
|
|
166
231
|
disablePublishedAnimationFetch?: boolean;
|
|
232
|
+
layoutMode?: SubtitleLayoutMode;
|
|
233
|
+
playerContainerRef?: RefObject<HTMLElement | null>;
|
|
167
234
|
}): React__default.JSX.Element;
|
|
168
235
|
|
|
169
|
-
declare function useUrlAnimations({ segment, currentTime, maxExpression, threshold, nextSegmentStartTime, extendedEndTime, transparentUntilSpoken, disablePublishedAnimationFetch, stylesheetName: stylesheetNameProp, }: {
|
|
236
|
+
declare function useUrlAnimations({ segment, currentTime, maxExpression, threshold, nextSegmentStartTime, extendedEndTime, transparentUntilSpoken, disablePublishedAnimationFetch, stylesheetName: stylesheetNameProp, fontSizeScale, }: {
|
|
170
237
|
segment: any;
|
|
171
238
|
currentTime: number;
|
|
172
239
|
maxExpression?: number;
|
|
@@ -176,6 +243,8 @@ declare function useUrlAnimations({ segment, currentTime, maxExpression, thresho
|
|
|
176
243
|
transparentUntilSpoken?: boolean;
|
|
177
244
|
disablePublishedAnimationFetch?: boolean;
|
|
178
245
|
stylesheetName?: string | null;
|
|
246
|
+
/** Player-width scale (1920px reference). Default 1. */
|
|
247
|
+
fontSizeScale?: number;
|
|
179
248
|
}): {
|
|
180
249
|
text: string;
|
|
181
250
|
words: never[];
|
|
@@ -203,7 +272,7 @@ declare function useUrlAnimations({ segment, currentTime, maxExpression, thresho
|
|
|
203
272
|
end: any;
|
|
204
273
|
animationEnd: any;
|
|
205
274
|
isActive: boolean;
|
|
206
|
-
emotion:
|
|
275
|
+
emotion: any;
|
|
207
276
|
emotionIntensity: number;
|
|
208
277
|
fontFamily: string;
|
|
209
278
|
emphasisEffect: null;
|
|
@@ -215,8 +284,9 @@ declare function useUrlAnimations({ segment, currentTime, maxExpression, thresho
|
|
|
215
284
|
};
|
|
216
285
|
emotionCategory: string | null;
|
|
217
286
|
volume: any;
|
|
287
|
+
hasWordOverride: boolean;
|
|
218
288
|
}[];
|
|
219
|
-
emotion:
|
|
289
|
+
emotion: any;
|
|
220
290
|
emotionIntensity: number;
|
|
221
291
|
fontFamily: string;
|
|
222
292
|
currentWordIndex: number;
|
|
@@ -250,6 +320,144 @@ declare function WordRenderer({ text, words, fontFamily, className, style, debug
|
|
|
250
320
|
gts?: number;
|
|
251
321
|
}): React__default.JSX.Element | null;
|
|
252
322
|
|
|
323
|
+
/**
|
|
324
|
+
* useLiveSubtitles
|
|
325
|
+
*
|
|
326
|
+
* Event-driven, media-time-anchored live subtitle pipeline.
|
|
327
|
+
*
|
|
328
|
+
* - source.onInitialPlaylist → backfill cues for fragments already in
|
|
329
|
+
* the live window when we joined.
|
|
330
|
+
* - source.onSegmentLoaded → fetch sidecar JSON for each new segment
|
|
331
|
+
* the player downloads.
|
|
332
|
+
* - videoElement.currentTime → THE clock. Drives subtitle display via
|
|
333
|
+
* requestAnimationFrame. No wall-clock
|
|
334
|
+
* setInterval, no cumulative-duration
|
|
335
|
+
* math.
|
|
336
|
+
*
|
|
337
|
+
* Each cue is anchored to media time the moment it's ingested using
|
|
338
|
+
* `frag.start` from the adapter — so cue.start_time is always in the
|
|
339
|
+
* same space as `video.currentTime`, and subtitle display is
|
|
340
|
+
* automatically resilient to pause, buffer, and seek.
|
|
341
|
+
*
|
|
342
|
+
* See subtitle-sync.md §6 for the full design rationale.
|
|
343
|
+
*/
|
|
344
|
+
interface UseLiveSubtitlesArgs {
|
|
345
|
+
/** Master enable/disable. Hook is inert when false. */
|
|
346
|
+
enabled?: boolean;
|
|
347
|
+
/** A player adapter (e.g. createHlsLiveSegmentSource(hls, Hls)). */
|
|
348
|
+
source?: LiveSegmentSource | null;
|
|
349
|
+
/**
|
|
350
|
+
* The HTMLVideoElement the hook drives subtitle timing from. Must be
|
|
351
|
+
* the same element the player is rendering into.
|
|
352
|
+
*/
|
|
353
|
+
videoElement?: HTMLVideoElement | null;
|
|
354
|
+
/**
|
|
355
|
+
* The AMS master playlist URL the player is loading (e.g. the same URL
|
|
356
|
+
* passed to hls.loadSource). Used by the subtitle fetcher to derive the
|
|
357
|
+
* sidecar JSON path: `<base>/<streamId>_subtitle<sn>.json`. Required for
|
|
358
|
+
* SDK consumers; the in-repo app can omit this and fall back to
|
|
359
|
+
* NEXT_PUBLIC_API_LIVE_URL.
|
|
360
|
+
*/
|
|
361
|
+
masterUrl?: string | null;
|
|
362
|
+
}
|
|
363
|
+
declare function useLiveSubtitles({ enabled, source, videoElement, masterUrl, }: UseLiveSubtitlesArgs): void;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* useHlsLiveSource
|
|
367
|
+
*
|
|
368
|
+
* Layer 1 of the live-subtitle SDK ergonomics: hides hls.js setup behind a
|
|
369
|
+
* single hook. Given a master URL + a video element, dynamically imports
|
|
370
|
+
* hls.js, builds an instance with sensible live defaults, attaches it,
|
|
371
|
+
* calls loadSource, and wraps it as a LiveSegmentSource. Returns the source
|
|
372
|
+
* so it can be passed straight into useLiveSubtitles.
|
|
373
|
+
*
|
|
374
|
+
* Also suppresses the browser's native WebVTT captions, which AMS publishes
|
|
375
|
+
* on the manifest alongside the JSON sidecar track. Without this, the
|
|
376
|
+
* browser would double-render captions over the animated subtitle overlay.
|
|
377
|
+
*
|
|
378
|
+
* For customers who want their own video element + layout but don't want to
|
|
379
|
+
* wire hls.js themselves. Customers who want a full prebuilt component
|
|
380
|
+
* should use PhontLivePlayer instead.
|
|
381
|
+
*/
|
|
382
|
+
interface UseHlsLiveSourceArgs {
|
|
383
|
+
/** HLS master playlist URL (e.g. AMS `<streamId>_phont.m3u8`). */
|
|
384
|
+
masterUrl: string | null;
|
|
385
|
+
/** The <video> element hls.js should attach to. */
|
|
386
|
+
videoElement: HTMLVideoElement | null;
|
|
387
|
+
/** Master enable/disable. Hook is inert when false. */
|
|
388
|
+
enabled?: boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Extra hls.js config merged on top of the live defaults. Use to override
|
|
391
|
+
* buffering knobs, low-latency mode, etc.
|
|
392
|
+
*/
|
|
393
|
+
hlsConfig?: Record<string, any>;
|
|
394
|
+
/**
|
|
395
|
+
* Suppress native browser WebVTT captions on the <video>. Defaults to
|
|
396
|
+
* true — almost always what you want when rendering animated subtitles.
|
|
397
|
+
* Set false only if you genuinely want the browser to paint captions
|
|
398
|
+
* alongside the animated overlay (rare).
|
|
399
|
+
*/
|
|
400
|
+
suppressNativeCaptions?: boolean;
|
|
401
|
+
}
|
|
402
|
+
interface UseHlsLiveSourceResult {
|
|
403
|
+
/** LiveSegmentSource to hand to useLiveSubtitles. Null until ready. */
|
|
404
|
+
source: LiveSegmentSource | null;
|
|
405
|
+
/** Underlying hls.js instance. Exposed for advanced cases (event hooks). */
|
|
406
|
+
hls: any | null;
|
|
407
|
+
/** Set if hls.js failed to load or this browser can't play MSE HLS. */
|
|
408
|
+
error: string | null;
|
|
409
|
+
}
|
|
410
|
+
declare function useHlsLiveSource({ masterUrl, videoElement, enabled, hlsConfig, suppressNativeCaptions, }: UseHlsLiveSourceArgs): UseHlsLiveSourceResult;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* PhontLivePlayer
|
|
414
|
+
*
|
|
415
|
+
* Layer 2 of the live-subtitle SDK ergonomics: the one-liner. Drop in a
|
|
416
|
+
* master URL, get back a video element with animated Phont subtitles
|
|
417
|
+
* already wired up. No hls.js, no LiveSegmentSource, no text-track
|
|
418
|
+
* suppression to manage. Internally:
|
|
419
|
+
*
|
|
420
|
+
* - useHlsLiveSource builds the hls.js instance + adapter + WebVTT kill
|
|
421
|
+
* switch
|
|
422
|
+
* - useLiveSubtitles drives the cue pipeline + RAF display loop
|
|
423
|
+
* - PhontSubtitlesWithUrlAnimations renders the animated overlay
|
|
424
|
+
*
|
|
425
|
+
* Customers who need a custom video element, custom controls, or a
|
|
426
|
+
* different player should drop one layer down to useHlsLiveSource and wire
|
|
427
|
+
* the pieces themselves.
|
|
428
|
+
*
|
|
429
|
+
* Must be rendered inside <PhontRoot> so the animation resolver has its
|
|
430
|
+
* context.
|
|
431
|
+
*/
|
|
432
|
+
interface PhontLivePlayerProps {
|
|
433
|
+
/** HLS master playlist URL (e.g. AMS `<streamId>_phont.m3u8`). */
|
|
434
|
+
masterUrl: string;
|
|
435
|
+
/** Forwarded to the inner <video>. Defaults to filling its parent. */
|
|
436
|
+
videoStyle?: CSSProperties;
|
|
437
|
+
videoClassName?: string;
|
|
438
|
+
/** Whether the video should autoplay. Defaults to true. */
|
|
439
|
+
autoPlay?: boolean;
|
|
440
|
+
/** Whether the video starts muted. Defaults to true (autoplay needs it). */
|
|
441
|
+
muted?: boolean;
|
|
442
|
+
/** Whether to show native controls. Defaults to false (clean overlay). */
|
|
443
|
+
controls?: boolean;
|
|
444
|
+
/** Forwarded to PhontSubtitlesWithUrlAnimations. */
|
|
445
|
+
maxExpression?: number;
|
|
446
|
+
threshold?: number;
|
|
447
|
+
/**
|
|
448
|
+
* Suppress native WebVTT captions. Defaults to true. Pass false only if
|
|
449
|
+
* you genuinely want the browser to render captions over the animated
|
|
450
|
+
* overlay (essentially never).
|
|
451
|
+
*/
|
|
452
|
+
suppressNativeCaptions?: boolean;
|
|
453
|
+
/**
|
|
454
|
+
* Called once the inner <video> element is attached. Use to wire up
|
|
455
|
+
* external controls or fullscreen handling.
|
|
456
|
+
*/
|
|
457
|
+
onVideoElement?: (el: HTMLVideoElement | null) => void;
|
|
458
|
+
}
|
|
459
|
+
declare function PhontLivePlayer({ masterUrl, videoStyle, videoClassName, autoPlay, muted, controls, maxExpression, threshold, suppressNativeCaptions, onVideoElement, }: PhontLivePlayerProps): React__default.JSX.Element;
|
|
460
|
+
|
|
253
461
|
/**
|
|
254
462
|
* SDK Authentication Hook
|
|
255
463
|
*
|
|
@@ -671,18 +879,6 @@ interface PhontVideoPlayerProps extends Omit<PhontSubtitlesProps, 'currentTime'
|
|
|
671
879
|
*/
|
|
672
880
|
declare function PhontVideoPlayer(props: PhontVideoPlayerProps): React__default.JSX.Element;
|
|
673
881
|
|
|
674
|
-
interface PositionConfig {
|
|
675
|
-
bottomVh: number;
|
|
676
|
-
bottomVhNoSpeaker: number;
|
|
677
|
-
mobileBottomVh: number;
|
|
678
|
-
mobileBottomVhNoSpeaker: number;
|
|
679
|
-
zIndex: number;
|
|
680
|
-
width: number | string;
|
|
681
|
-
mobileWidth: string;
|
|
682
|
-
maxMobileWidth: number | string;
|
|
683
|
-
height: number | string;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
882
|
interface SoundbiteContainerProps {
|
|
687
883
|
isVodMode?: boolean;
|
|
688
884
|
boxSize?: number;
|
|
@@ -776,8 +972,34 @@ interface PhontControlsProps {
|
|
|
776
972
|
setAnimationMode?: (mode: AnimationMode) => void;
|
|
777
973
|
toggles: boolean[];
|
|
778
974
|
handleToggle: (index: number) => void;
|
|
975
|
+
/**
|
|
976
|
+
* `player` — scale + anchor inside `playerContainerRef` (embedded embeds).
|
|
977
|
+
* `viewport` — legacy fixed positioning (default).
|
|
978
|
+
*/
|
|
979
|
+
layoutMode?: SubtitleLayoutMode;
|
|
980
|
+
/** Measured for player-relative scale. Required when `layoutMode="player"`. */
|
|
981
|
+
playerContainerRef?: React__default.RefObject<HTMLElement | null>;
|
|
982
|
+
/** Width source for scale — defaults to `playerContainerRef`. Use the player stage, not the portal mount. */
|
|
983
|
+
scaleContainerRef?: React__default.RefObject<HTMLElement | null>;
|
|
984
|
+
/** Bumps portal target when the mount node appears (e.g. 3Q overlay host). */
|
|
985
|
+
portalSyncKey?: unknown;
|
|
986
|
+
/** When set, shows a close (✕) button in the panel header. */
|
|
987
|
+
onClose?: () => void;
|
|
988
|
+
}
|
|
989
|
+
declare function PhontControls({ isVisible, onPanelMouseEnter, onPanelMouseLeave, isLive, currentVideoId, gts, setGTS, threshold, maxExpression, subtitleLanguage, availableLanguages, currentSubtitleLanguage, handleLanguageChange, isTranslating, translatingToLanguage, translationProvider, translationModel, toggles, handleToggle, layoutMode, playerContainerRef, scaleContainerRef, portalSyncKey, onClose, }: PhontControlsProps): React__default.JSX.Element | null;
|
|
990
|
+
|
|
991
|
+
interface PhontControlsOpenButtonProps {
|
|
992
|
+
onOpen: () => void;
|
|
993
|
+
/** Hide when the panel is already open. */
|
|
994
|
+
visible?: boolean;
|
|
995
|
+
layoutMode?: SubtitleLayoutMode;
|
|
996
|
+
playerContainerRef?: React__default.RefObject<HTMLElement | null>;
|
|
997
|
+
/** Width source for scale — defaults to `playerContainerRef`. */
|
|
998
|
+
scaleContainerRef?: React__default.RefObject<HTMLElement | null>;
|
|
999
|
+
/** Bumps portal target when the mount node appears (e.g. 3Q overlay host). */
|
|
1000
|
+
portalSyncKey?: unknown;
|
|
779
1001
|
}
|
|
780
|
-
declare function
|
|
1002
|
+
declare function PhontControlsOpenButton({ onOpen, visible, layoutMode, playerContainerRef, scaleContainerRef, portalSyncKey, }: PhontControlsOpenButtonProps): React__default.JSX.Element | null;
|
|
781
1003
|
|
|
782
1004
|
/**
|
|
783
1005
|
* Dev-only Phont Controls — PlayerTestSuite / internal testing.
|
|
@@ -869,10 +1091,26 @@ declare function usePhontVodControls({ vodId, phontClient, initialGts, closedCap
|
|
|
869
1091
|
availableLanguages: Record<string, string>;
|
|
870
1092
|
};
|
|
871
1093
|
|
|
1094
|
+
/** Cmd/Ctrl+M — same chord as Stage metadata panel; safe on pages without MetaData. */
|
|
1095
|
+
declare const PHONT_CONTROLS_HOTKEY = "m";
|
|
1096
|
+
/**
|
|
1097
|
+
* Toggle PhontControls visibility with ⌘M / Ctrl+M.
|
|
1098
|
+
* On Stage /video, Cmd+M is used for the metadata panel — do not use this hook there.
|
|
1099
|
+
*/
|
|
1100
|
+
declare function usePhontControlsHotkey(initialVisible?: boolean): {
|
|
1101
|
+
controlsVisible: boolean;
|
|
1102
|
+
setControlsVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
1103
|
+
openControls: () => void;
|
|
1104
|
+
closeControls: () => void;
|
|
1105
|
+
toggleControls: () => void;
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
/** True when native fullscreen is active on this player's video or container subtree. */
|
|
1109
|
+
declare function usePlayerFullscreen(playerContainerRef: RefObject<HTMLElement | null>, videoRef: RefObject<HTMLVideoElement | null>): boolean;
|
|
1110
|
+
|
|
872
1111
|
/**
|
|
873
1112
|
* GTS (Global Tone & Style) Slider Component
|
|
874
1113
|
* SDK version - Controls emotion threshold and expressiveness (max expression)
|
|
875
|
-
* Matches app/components/phont-controls/GTSSlider.jsx
|
|
876
1114
|
*/
|
|
877
1115
|
|
|
878
1116
|
interface GTSSliderProps {
|
|
@@ -886,7 +1124,6 @@ declare function GTSSlider({ gts, setGTS, threshold, maxExpression }: GTSSliderP
|
|
|
886
1124
|
/**
|
|
887
1125
|
* Translation Dropdown Component
|
|
888
1126
|
* SDK version - Allows users to switch subtitle language (VOD only)
|
|
889
|
-
* Matches app/components/phont-controls/TranslationDropdown.jsx
|
|
890
1127
|
*/
|
|
891
1128
|
|
|
892
1129
|
interface TranslationDropdownProps {
|
|
@@ -899,12 +1136,11 @@ interface TranslationDropdownProps {
|
|
|
899
1136
|
translationProvider?: string;
|
|
900
1137
|
translationModel?: string;
|
|
901
1138
|
}
|
|
902
|
-
declare function TranslationDropdown({ subtitleLanguage, availableLanguages, currentSubtitleLanguage, onLanguageChange, isTranslating,
|
|
1139
|
+
declare function TranslationDropdown({ subtitleLanguage, availableLanguages, currentSubtitleLanguage, onLanguageChange, isTranslating, }: TranslationDropdownProps): React__default.JSX.Element;
|
|
903
1140
|
|
|
904
1141
|
/**
|
|
905
1142
|
* Reusable Toggle Switch Component
|
|
906
1143
|
* SDK version - Used for Speaker, Closed Captions, and other binary settings
|
|
907
|
-
* Matches app/components/phont-controls/ToggleSwitch.jsx
|
|
908
1144
|
*/
|
|
909
1145
|
|
|
910
1146
|
interface ToggleSwitchProps {
|
|
@@ -927,4 +1163,4 @@ interface AnimationUrlConfigProps {
|
|
|
927
1163
|
}
|
|
928
1164
|
declare function AnimationUrlConfig({ customAnimationUrl, setCustomAnimationUrl, emotionMappings, setEmotionMappings, }: AnimationUrlConfigProps): React__default.JSX.Element;
|
|
929
1165
|
|
|
930
|
-
export { AnimationConfigProvider, type AnimationConfigProviderProps, type AnimationMode, AnimationModeToggle, type AnimationModeToggleProps, AnimationUrlConfig, type AnimationUrlConfigProps, type BitmovinPlayer, BitmovinPlayerAdapter, type EmotionAnimationUrls, GTSSlider, type GTSSliderProps, HTML5VideoAdapter, PHONT_DEFAULT_LANGUAGES, type PhontClientConfig, PhontControls, PhontControlsDev, type PhontControlsDevProps, type PhontControlsProps, PhontRoot, type PhontRootProps, PhontSubtitles, type PhontSubtitlesProps, PhontSubtitlesWithUrlAnimations, PhontVideoPlayer, type PhontVideoPlayerProps, type PlayerAdapter, PlayerTestSuite, type PlayerTestSuiteProps, type PlayerType, SDKAuth, type SDKAuthProps, type SDKAuthState, type ShakaPlayer, ShakaPlayerAdapter, SoundbiteContainer, StylesheetProvider, type ThreeQPlayer, ThreeQPlayerAdapter, ToggleSwitch, type ToggleSwitchProps, TranslationDropdown, type TranslationDropdownProps, type UsePhontVodControlsOptions, type UsePlayerSyncOptions, type UsePlayerSyncResult, type UseSDKAnimationOptions, type UseVideoPlayerOptions, type VideoJSPlayer, VideoJSPlayerAdapter, WordRenderer, buildPhontAnimationRequestHeaders, calculateMaxExpression, calculateThreshold, configurePublishedAnimationFetcher, createPhontAnimationFetcher, useAnimationConfig, usePhontVodControls, usePlayerSync, usePublishedAnimationResolver, useSDKAnimation, useSDKAuth, useStylesheet, useUrlAnimations, useVideoPlayer };
|
|
1166
|
+
export { AnimationConfigProvider, type AnimationConfigProviderProps, type AnimationMode, AnimationModeToggle, type AnimationModeToggleProps, AnimationUrlConfig, type AnimationUrlConfigProps, type BitmovinPlayer, BitmovinPlayerAdapter, type EmotionAnimationUrls, GTSSlider, type GTSSliderProps, HTML5VideoAdapter, PHONT_CONTROLS_HOTKEY, PHONT_DEFAULT_LANGUAGES, PLAYER_CHROME_LAYOUT, type PhontClientConfig, PhontControls, PhontControlsDev, type PhontControlsDevProps, PhontControlsOpenButton, type PhontControlsOpenButtonProps, type PhontControlsProps, PhontLivePlayer, type PhontLivePlayerProps, PhontRoot, type PhontRootProps, PhontSubtitles, type PhontSubtitlesProps, PhontSubtitlesWithUrlAnimations, PhontVideoPlayer, type PhontVideoPlayerProps, type PlayerAdapter, PlayerTestSuite, type PlayerTestSuiteProps, type PlayerType, SDKAuth, type SDKAuthProps, type SDKAuthState, SUBTITLE_LAYOUT_REFERENCE, type ShakaPlayer, ShakaPlayerAdapter, SoundbiteContainer, StylesheetProvider, type SubtitleLayoutMode, THREEQ_OVERLAY_MOUNT_CSS, type ThreeQPlayer, ThreeQPlayerAdapter, ToggleSwitch, type ToggleSwitchProps, TranslationDropdown, type TranslationDropdownProps, type UseHlsLiveSourceArgs, type UseHlsLiveSourceResult, type UseLiveSubtitlesArgs, type UsePhontVodControlsOptions, type UsePlayerSyncOptions, type UsePlayerSyncResult, type UseSDKAnimationOptions, type UseVideoPlayerOptions, type VideoJSPlayer, VideoJSPlayerAdapter, WordRenderer, buildPhontAnimationRequestHeaders, calculateMaxExpression, calculateThreshold, configurePublishedAnimationFetcher, createPhontAnimationFetcher, ensureThreeqOverlayHost, getPlayerSubtitleBottomPx, invalidatePublishedAnimationResolverCache, useAnimationConfig, useHlsLiveSource, useLiveSubtitles, usePhontControlsHotkey, usePhontVodControls, usePlayerFullscreen, usePlayerSync, usePublishedAnimationResolver, useSDKAnimation, useSDKAuth, useStylesheet, useUrlAnimations, useVideoPlayer };
|