@vocalstack/player 0.1.0-alpha.2 → 0.1.0-alpha.20

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.
@@ -1,8 +1,33 @@
1
- import { type Started } from '../data/connect';
1
+ import { type PopupStatus, type Started } from '../data/connect';
2
+ import { type IdlePrefs } from './IdleSettings';
3
+ export interface IdleState {
4
+ prefs: IdlePrefs;
5
+ set: (p: Partial<IdlePrefs>) => void;
6
+ shareUrl?: string;
7
+ }
2
8
  export declare function hostOf(src: string): string;
3
- export declare function SourceGate({ src, appUrl, title, onReady }: {
9
+ export interface Connect {
10
+ busy: boolean;
11
+ status: PopupStatus | null;
12
+ err: string | null;
13
+ connected: boolean;
14
+ connect: () => void;
15
+ start: (url: string, ask: boolean) => void;
16
+ }
17
+ export declare function useConnect(appUrl: string | undefined, onReady: (s: Started) => void): Connect;
18
+ export declare function SourceGate({ idle, src, ask, connect, page, poster, onClear }: {
19
+ idle: IdleState;
4
20
  src: string;
5
- appUrl?: string;
6
- title?: string;
7
- onReady: (s: Started) => void;
21
+ ask: boolean;
22
+ connect: Connect;
23
+ page: boolean;
24
+ poster?: string | null;
25
+ onClear?: () => void;
26
+ }): import("react").JSX.Element;
27
+ export declare function StartCard({ idle, connect, page, poster, onPick }: {
28
+ idle: IdleState;
29
+ connect: Connect;
30
+ page: boolean;
31
+ poster?: string | null;
32
+ onPick: (url: string) => void;
8
33
  }): import("react").JSX.Element;
@@ -20,6 +20,22 @@ export interface PlayerControls {
20
20
  fullscreen?: boolean;
21
21
  settings?: boolean;
22
22
  }
23
+ export interface PlaybackState {
24
+ t: number;
25
+ dur: number;
26
+ playing: boolean;
27
+ idx: number;
28
+ seekN: number;
29
+ lang: string | null;
30
+ muted: boolean;
31
+ }
32
+ export interface PlayerHandle {
33
+ seek: (t: number) => void;
34
+ play: () => void;
35
+ pause: () => void;
36
+ toggle: () => void;
37
+ toggleMute: () => void;
38
+ }
23
39
  export interface VocalStackPlayerProps {
24
40
  id?: string;
25
41
  src?: string;
@@ -38,11 +54,16 @@ export interface VocalStackPlayerProps {
38
54
  syncUrl?: boolean;
39
55
  endCard?: EndCardOptions | false;
40
56
  appUrl?: string;
57
+ poster?: string | null;
58
+ voice?: string | null;
41
59
  settingsExtra?: ReactNode;
42
60
  shareUrl?: (t: number | null) => string;
61
+ onShare?: () => void;
43
62
  onSource?: (s: LoadedSource) => void;
44
63
  onProgress?: (pct: number | null) => void;
45
64
  onError?: (e: ErrorLike) => void;
65
+ onPlayback?: (s: PlaybackState) => void;
66
+ compact?: boolean;
46
67
  className?: string;
47
68
  }
48
- export declare function VocalStackPlayer(props: VocalStackPlayerProps): import("react").JSX.Element;
69
+ export declare const VocalStackPlayer: import("react").ForwardRefExoticComponent<VocalStackPlayerProps & import("react").RefAttributes<PlayerHandle>>;
package/dist/ui/core.d.ts CHANGED
@@ -116,9 +116,11 @@ export interface VoiceSheetHooks {
116
116
  castNoClone?: (sp: CastMember, ctx: VoiceSheetCtx) => boolean;
117
117
  castShort?: (sp: CastMember, ctx: VoiceSheetCtx) => boolean;
118
118
  castBuilding?: (sp: CastMember, ctx: VoiceSheetCtx) => boolean;
119
+ castWarn?: (sp: CastMember, ctx: VoiceSheetCtx) => string | null;
119
120
  }
120
- export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred, langs, srcLang, canTranslate, pickedLang, setPickedLang, side, hearOriginal, timed, stockVoices, stickyPicker, pickerBusy, voiceSheet }: {
121
+ export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred, langs, srcLang, canTranslate, pickedLang, setPickedLang, side, hearOriginal, timed, stockVoices, stickyPicker, pickerBusy, voiceSheet, forcedVoice }: {
121
122
  voiceSheet?: VoiceSheetHooks;
123
+ forcedVoice?: string | null;
122
124
  hearOriginal?: boolean;
123
125
  stockVoices?: boolean;
124
126
  stickyPicker?: boolean;
@@ -183,6 +185,7 @@ export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred
183
185
  resetCast: () => void;
184
186
  readLang: string | null;
185
187
  readVoiceKey: string;
188
+ pickedVoiceKey: string | null;
186
189
  readVoiceName: string;
187
190
  canSpeak: boolean;
188
191
  requestTrack: () => Promise<void>;
package/dist/ui/full.d.ts CHANGED
@@ -41,7 +41,8 @@ export declare function MiniPlayer({ pos, transport, chip, voices, onShare, onFu
41
41
  onFull: () => void;
42
42
  copied: React.ReactNode;
43
43
  }): import("react").JSX.Element;
44
- export declare function FullVideo({ noFull, page, picture, title, desk, pos, sub, wait, pct, mute, cc, ad, chip, transport, picker, sheet, voices, voicesBtn, sheetOpen, onShare, onSettings, paused, copied, onTouch, onClose }: {
44
+ export declare function FullVideo({ compact, noFull, page, picture, title, desk, pos, sub, wait, pct, mute, cc, ad, chip, transport, picker, sheet, voices, voicesBtn, sheetOpen, onShare, onSettings, paused, copied, onTouch, onClose }: {
45
+ compact?: boolean;
45
46
  noFull?: boolean;
46
47
  page?: boolean;
47
48
  onTouch: () => void;
@@ -137,13 +137,14 @@ export declare function speakerRoster(rows: {
137
137
  export declare function castKey(map: Map<number, string>): string;
138
138
  export declare function parseCast(key: string | null | undefined): Map<number, string> | null;
139
139
  export declare function autoCast(roster: CastMember[], voices: AvailableVoice[], clones?: boolean): Map<number, string>;
140
- export declare function SpeakerCast({ roster, selected, onSelect, noClone, building, short, sexOf, t }: {
140
+ export declare function SpeakerCast({ roster, selected, onSelect, noClone, building, short, warn, sexOf, t }: {
141
141
  roster: CastMember[];
142
142
  selected: number | null;
143
143
  onSelect: (key: number) => void;
144
144
  noClone: (p: CastMember) => boolean;
145
145
  building?: (p: CastMember) => boolean;
146
146
  short?: (p: CastMember) => boolean;
147
+ warn?: (p: CastMember) => string | null;
147
148
  sexOf: (p: CastMember) => 'male' | 'female' | null;
148
149
  t: Strings;
149
150
  }): import("react").JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocalstack/player",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.20",
4
4
  "description": "VocalStack video and transcript player for React: synced transcript, subtitles, spoken translations and background sound, over the public VocalStack API.",
5
5
  "license": "MIT",
6
6
  "type": "module",