@vocalstack/player 0.1.0-alpha.7 → 0.1.0-alpha.71
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/README.md +12 -0
- package/dist/core/archive.d.ts +19 -0
- package/dist/core/dailymotion.d.ts +38 -0
- package/dist/core/embeds.d.ts +30 -0
- package/dist/core/facebook.d.ts +26 -0
- package/dist/core/find.d.ts +9 -0
- package/dist/core/loomStream.d.ts +5 -0
- package/dist/core/share.d.ts +2 -0
- package/dist/core/sites.d.ts +13 -0
- package/dist/core/streamTime.d.ts +12 -0
- package/dist/core/vimeo.d.ts +38 -0
- package/dist/core/voiceFollow.d.ts +11 -1
- package/dist/core/voiceWait.d.ts +10 -0
- package/dist/data/connect.d.ts +8 -0
- package/dist/data/context.d.ts +8 -2
- package/dist/data/errors.d.ts +1 -0
- package/dist/data/title.d.ts +8 -0
- package/dist/ds/Controls.d.ts +2 -1
- package/dist/ds/Icons.d.ts +1 -0
- package/dist/ds/LanguagePicker.d.ts +2 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5378 -3212
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/ui/DailymotionFollow.d.ts +8 -0
- package/dist/ui/EmbedFollow.d.ts +8 -0
- package/dist/ui/FacebookFollow.d.ts +7 -0
- package/dist/ui/FileFollow.d.ts +10 -0
- package/dist/ui/IdleSettings.d.ts +34 -0
- package/dist/ui/Providers.d.ts +1 -0
- package/dist/ui/SiteIcon.d.ts +9 -0
- package/dist/ui/SourceGate.d.ts +27 -3
- package/dist/ui/VidyardFollow.d.ts +7 -0
- package/dist/ui/VimeoFollow.d.ts +9 -0
- package/dist/ui/VocalStackPlayer.d.ts +30 -1
- package/dist/ui/WistiaFollow.d.ts +7 -0
- package/dist/ui/core.d.ts +27 -20
- package/dist/ui/full.d.ts +5 -1
- package/dist/ui/shared.d.ts +2 -1
- package/package.json +3 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type FollowSetup = (v: HTMLVideoElement, fail: () => void) => (() => void) | void;
|
|
2
|
+
export declare function FileFollow({ src, setup, t, playing, seekN, onToggle, seekOver }: {
|
|
3
|
+
src?: string;
|
|
4
|
+
setup?: FollowSetup;
|
|
5
|
+
t: number;
|
|
6
|
+
playing: boolean;
|
|
7
|
+
seekN: number;
|
|
8
|
+
onToggle?: () => void;
|
|
9
|
+
seekOver?: number;
|
|
10
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface IdlePrefs {
|
|
2
|
+
lang: string | null;
|
|
3
|
+
subtitles: boolean;
|
|
4
|
+
speakerLabels: boolean;
|
|
5
|
+
wordHighlight: boolean;
|
|
6
|
+
translateAudio: boolean;
|
|
7
|
+
voices: 'cloned' | 'synthetic';
|
|
8
|
+
removeBackground: boolean;
|
|
9
|
+
muted: boolean;
|
|
10
|
+
spoken: string | null;
|
|
11
|
+
speakers: 'auto' | 'on' | 'off';
|
|
12
|
+
}
|
|
13
|
+
export declare const CLONE_CONSENT_KEY = "vsp.cloneConsent";
|
|
14
|
+
export declare const hasCloneConsent: () => boolean;
|
|
15
|
+
export declare const grantCloneConsent: () => void;
|
|
16
|
+
export declare function CloneConsent({ onYes, onNo }: {
|
|
17
|
+
onYes: () => void;
|
|
18
|
+
onNo: () => void;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
export declare function CloneToggle({ on, onChange }: {
|
|
21
|
+
on: boolean;
|
|
22
|
+
onChange: (on: boolean) => void;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export declare const IDLE_DEFAULTS: IdlePrefs;
|
|
25
|
+
export declare function useIdleControls(prefs: IdlePrefs, set: (p: Partial<IdlePrefs>) => void, pre?: boolean): {
|
|
26
|
+
chip: import("react").JSX.Element;
|
|
27
|
+
sheets: import("react").JSX.Element;
|
|
28
|
+
sheetOpen: boolean;
|
|
29
|
+
openSettings: () => void;
|
|
30
|
+
openTx: () => void;
|
|
31
|
+
txSummary: string;
|
|
32
|
+
cloneToggle: import("react").JSX.Element | null;
|
|
33
|
+
modal: import("react").JSX.Element | null;
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ProviderGrid(): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { Site } from '../core/sites';
|
|
3
|
+
export declare function SiteIcon({ site, size, tinted, style, className }: {
|
|
4
|
+
site: Site;
|
|
5
|
+
size?: number;
|
|
6
|
+
tinted?: boolean;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
package/dist/ui/SourceGate.d.ts
CHANGED
|
@@ -1,23 +1,47 @@
|
|
|
1
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;
|
|
9
|
+
export interface TxChoice {
|
|
10
|
+
voices: 'cloned' | 'synthetic';
|
|
11
|
+
spoken: string | null;
|
|
12
|
+
speakers: 'auto' | 'on' | 'off';
|
|
13
|
+
}
|
|
14
|
+
export declare function txChoiceOf(p: IdlePrefs): TxChoice;
|
|
3
15
|
export interface Connect {
|
|
4
16
|
busy: boolean;
|
|
5
17
|
status: PopupStatus | null;
|
|
6
18
|
err: string | null;
|
|
7
19
|
connected: boolean;
|
|
8
20
|
connect: () => void;
|
|
9
|
-
start: (url: string, ask: boolean) => void;
|
|
21
|
+
start: (url: string, ask: boolean, opts?: TxChoice) => void;
|
|
22
|
+
clear: () => void;
|
|
10
23
|
}
|
|
11
24
|
export declare function useConnect(appUrl: string | undefined, onReady: (s: Started) => void): Connect;
|
|
12
|
-
export declare function SourceGate({ src, ask, connect, page, onClear }: {
|
|
25
|
+
export declare function SourceGate({ idle, src, ask, connect, page, poster, onClear }: {
|
|
26
|
+
idle: IdleState;
|
|
13
27
|
src: string;
|
|
14
28
|
ask: boolean;
|
|
15
29
|
connect: Connect;
|
|
16
30
|
page: boolean;
|
|
31
|
+
poster?: string | null;
|
|
17
32
|
onClear?: () => void;
|
|
18
33
|
}): import("react").JSX.Element;
|
|
19
|
-
export declare function StartCard({ connect, page, onPick }: {
|
|
34
|
+
export declare function StartCard({ idle, connect, page, poster, onPick, onShare }: {
|
|
35
|
+
idle: IdleState;
|
|
20
36
|
connect: Connect;
|
|
21
37
|
page: boolean;
|
|
38
|
+
poster?: string | null;
|
|
22
39
|
onPick: (url: string) => void;
|
|
40
|
+
onShare?: (code: string) => Promise<boolean>;
|
|
41
|
+
}): import("react").JSX.Element;
|
|
42
|
+
export declare function ErrorGate({ idle, message, onRetry, page }: {
|
|
43
|
+
idle: IdleState;
|
|
44
|
+
message: string;
|
|
45
|
+
onRetry: () => void;
|
|
46
|
+
page: boolean;
|
|
23
47
|
}): import("react").JSX.Element;
|
|
@@ -20,8 +20,29 @@ 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
|
+
load: (link: string, opts?: {
|
|
39
|
+
poster?: string | null;
|
|
40
|
+
}) => void;
|
|
41
|
+
clear: () => void;
|
|
42
|
+
}
|
|
23
43
|
export interface VocalStackPlayerProps {
|
|
24
44
|
id?: string;
|
|
45
|
+
recording?: string | null;
|
|
25
46
|
src?: string;
|
|
26
47
|
token?: TokenSource | null;
|
|
27
48
|
baseUrl?: string | null;
|
|
@@ -32,17 +53,25 @@ export interface VocalStackPlayerProps {
|
|
|
32
53
|
settings?: PlayerSettings;
|
|
33
54
|
initial?: PlayerSettings;
|
|
34
55
|
onSettingsChange?: (s: Required<PlayerSettings>) => void;
|
|
56
|
+
find?: string;
|
|
57
|
+
onFindChange?: (q: string) => void;
|
|
35
58
|
controls?: PlayerControls;
|
|
36
59
|
autoplay?: boolean;
|
|
37
60
|
startAt?: number | null;
|
|
38
61
|
syncUrl?: boolean;
|
|
39
62
|
endCard?: EndCardOptions | false;
|
|
40
63
|
appUrl?: string;
|
|
64
|
+
poster?: string | null;
|
|
65
|
+
dailymotionPlayer?: string;
|
|
66
|
+
voice?: string | null;
|
|
41
67
|
settingsExtra?: ReactNode;
|
|
42
68
|
shareUrl?: (t: number | null) => string;
|
|
69
|
+
onShare?: () => void;
|
|
43
70
|
onSource?: (s: LoadedSource) => void;
|
|
44
71
|
onProgress?: (pct: number | null) => void;
|
|
45
72
|
onError?: (e: ErrorLike) => void;
|
|
73
|
+
onPlayback?: (s: PlaybackState) => void;
|
|
74
|
+
compact?: boolean;
|
|
46
75
|
className?: string;
|
|
47
76
|
}
|
|
48
|
-
export declare
|
|
77
|
+
export declare const VocalStackPlayer: import("react").ForwardRefExoticComponent<VocalStackPlayerProps & import("react").RefAttributes<PlayerHandle>>;
|
package/dist/ui/core.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { type ErrorLike } from '../data/transcript';
|
|
|
4
4
|
import { type Model, type Row, type Word } from '../core/transcript';
|
|
5
5
|
import { type ReadPos, type VoiceClip } from '../core/voiceplayer';
|
|
6
6
|
import { type PlayPos } from '../core/playPosition';
|
|
7
|
+
import { type Gap } from '../core/streamTime';
|
|
7
8
|
import { type AvailableVoice, type CastMember } from './shared';
|
|
8
9
|
export declare function lineWords(rows: Row[], i: number, lang?: string | null): Word[];
|
|
9
10
|
export declare function spokenWordOf(player: Pick<TxPlayer, 't' | 'idx' | 'engaged' | 'wordSync' | 'clipPos'>, i: number, words: Word[]): number | null;
|
|
@@ -16,10 +17,16 @@ export interface YtLead {
|
|
|
16
17
|
state?: number;
|
|
17
18
|
ready?: boolean;
|
|
18
19
|
muted?: boolean;
|
|
20
|
+
liveEnd?: number;
|
|
21
|
+
liveAt?: {
|
|
22
|
+
t: number;
|
|
23
|
+
wall: number;
|
|
24
|
+
};
|
|
19
25
|
}) => void;
|
|
20
26
|
bind: (cmd: ((func: string, args?: unknown[]) => void) | null) => void;
|
|
21
27
|
}
|
|
22
|
-
export declare function YtFollow({ ytId, title, t, playing: wantPlay, seekN, onToggle, onAd, endT, onGone, onKnown, lead, onTime, waiting }: {
|
|
28
|
+
export declare function YtFollow({ busy, ytId, title, t, playing: wantPlay, seekN, onToggle, onAd, endT, onGone, onKnown, lead, onTime, waiting }: {
|
|
29
|
+
busy?: boolean;
|
|
23
30
|
waiting?: boolean;
|
|
24
31
|
onTime?: (t: number) => void;
|
|
25
32
|
lead?: YtLead;
|
|
@@ -55,6 +62,7 @@ export interface TxPlayer {
|
|
|
55
62
|
clipPos?: ReadPos | null;
|
|
56
63
|
has: boolean;
|
|
57
64
|
preparing?: boolean;
|
|
65
|
+
settling?: boolean;
|
|
58
66
|
starting?: number | null;
|
|
59
67
|
autoplay?: () => Promise<boolean | null>;
|
|
60
68
|
edgeWait?: boolean;
|
|
@@ -80,10 +88,11 @@ export interface TxPlayer {
|
|
|
80
88
|
silence?: (on: boolean) => void;
|
|
81
89
|
}
|
|
82
90
|
export declare function useDuck(players: TxPlayer[], ducked: boolean): void;
|
|
83
|
-
export declare function useYtLead(rows: Row[], lenS: number | null, offsetS: number, edgeS: number | null): {
|
|
91
|
+
export declare function useYtLead(rows: Row[], lenS: number | null, offsetS: number, edgeS: number | null, gaps?: readonly Gap[], liveStartMs?: number | null, liveMediaAtMs?: number | null, liveRec?: boolean): {
|
|
84
92
|
player: TxPlayer;
|
|
85
93
|
lead: YtLead;
|
|
86
94
|
setVideoSound: (on: boolean) => void;
|
|
95
|
+
offset: number;
|
|
87
96
|
};
|
|
88
97
|
export declare function useTxPlayer(url: string | null, available: boolean, rows: Row[], lenS: number | null, offsetS?: number, edgeS?: number | null): TxPlayer;
|
|
89
98
|
export declare const NO_SEEK: () => void;
|
|
@@ -118,8 +127,10 @@ export interface VoiceSheetHooks {
|
|
|
118
127
|
castBuilding?: (sp: CastMember, ctx: VoiceSheetCtx) => boolean;
|
|
119
128
|
castWarn?: (sp: CastMember, ctx: VoiceSheetCtx) => string | null;
|
|
120
129
|
}
|
|
121
|
-
export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred, langs, srcLang, canTranslate, pickedLang, setPickedLang, side, hearOriginal, timed, stockVoices, stickyPicker, pickerBusy, voiceSheet }: {
|
|
130
|
+
export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred, langs, srcLang, canTranslate, pickedLang, setPickedLang, side, hearOriginal, timed, stockVoices, stickyPicker, pickerBusy, voiceSheet, forcedVoice, consent }: {
|
|
131
|
+
consent?: boolean;
|
|
122
132
|
voiceSheet?: VoiceSheetHooks;
|
|
133
|
+
forcedVoice?: string | null;
|
|
123
134
|
hearOriginal?: boolean;
|
|
124
135
|
stockVoices?: boolean;
|
|
125
136
|
stickyPicker?: boolean;
|
|
@@ -154,6 +165,10 @@ export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred
|
|
|
154
165
|
player: TxPlayer;
|
|
155
166
|
chip: import("react").JSX.Element | null;
|
|
156
167
|
voiceBtn: import("react").JSX.Element;
|
|
168
|
+
nearRow: import("react").Dispatch<import("react").SetStateAction<number | null>>;
|
|
169
|
+
clipsReady: boolean;
|
|
170
|
+
clipFor: (id: number | null | undefined) => boolean;
|
|
171
|
+
voiceWaiting: boolean;
|
|
157
172
|
sheets: import("react").JSX.Element | null;
|
|
158
173
|
sidePanel: import("react").JSX.Element | null;
|
|
159
174
|
voicesMine: boolean;
|
|
@@ -184,28 +199,15 @@ export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred
|
|
|
184
199
|
resetCast: () => void;
|
|
185
200
|
readLang: string | null;
|
|
186
201
|
readVoiceKey: string;
|
|
202
|
+
pickedVoiceKey: string | null;
|
|
187
203
|
readVoiceName: string;
|
|
188
204
|
canSpeak: boolean;
|
|
189
205
|
requestTrack: () => Promise<void>;
|
|
190
206
|
hasClone: boolean;
|
|
191
207
|
clips: VoiceClip[];
|
|
208
|
+
wordTimes: Record<string, [number, number][]> | undefined;
|
|
192
209
|
setNear: import("react").Dispatch<import("react").SetStateAction<number | null>>;
|
|
193
210
|
closePicker: () => void;
|
|
194
|
-
langList: {
|
|
195
|
-
value: string | null;
|
|
196
|
-
onSelect: (c: string | null) => void;
|
|
197
|
-
languages: {
|
|
198
|
-
code: string;
|
|
199
|
-
label: string;
|
|
200
|
-
native: string;
|
|
201
|
-
flag: string;
|
|
202
|
-
voice: boolean;
|
|
203
|
-
}[];
|
|
204
|
-
searchPlaceholder: string;
|
|
205
|
-
none: string;
|
|
206
|
-
pinned: string[];
|
|
207
|
-
recent: string[];
|
|
208
|
-
};
|
|
209
211
|
};
|
|
210
212
|
export declare function TxLines({ model, rows, player, fixed, applied, onFixOpen, onWord, onFix, fixMode, fixingId, marks, fixBadges, tail, tailFg, running, desk, feedRef, listener, showLabels, find, findOpen, lang, warm, onVisible, wordHl }: {
|
|
211
213
|
model: Model;
|
|
@@ -234,14 +236,19 @@ export declare function TxLines({ model, rows, player, fixed, applied, onFixOpen
|
|
|
234
236
|
onVisible?: (ids: number[]) => void;
|
|
235
237
|
wordHl?: boolean;
|
|
236
238
|
}): import("react").JSX.Element;
|
|
239
|
+
export interface FindState {
|
|
240
|
+
hits: number;
|
|
241
|
+
at: number;
|
|
242
|
+
step: (dir: 1 | -1) => void;
|
|
243
|
+
}
|
|
237
244
|
export declare function TxFind({ open, q, onQ, onClose, hits, desk, inline, flash }: {
|
|
238
245
|
open: boolean;
|
|
239
246
|
q: string;
|
|
240
247
|
onQ: (q: string) => void;
|
|
241
248
|
onClose: () => void;
|
|
242
|
-
hits: number;
|
|
249
|
+
hits: number | FindState;
|
|
243
250
|
desk: boolean;
|
|
244
251
|
inline?: boolean;
|
|
245
252
|
flash?: string | null;
|
|
246
253
|
}): import("react").JSX.Element;
|
|
247
|
-
export declare function useFindPull(feedRef: React.RefObject<HTMLDivElement>, rows: Row[], open: boolean, q: string, setOpen: (v: boolean) => void):
|
|
254
|
+
export declare function useFindPull(feedRef: React.RefObject<HTMLDivElement>, rows: Row[], open: boolean, q: string, setOpen: (v: boolean) => void, lang?: string | null): FindState;
|
package/dist/ui/full.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type VoicesBtn = {
|
|
|
17
17
|
on: boolean;
|
|
18
18
|
title: string;
|
|
19
19
|
onClick: () => void;
|
|
20
|
+
busy?: boolean;
|
|
20
21
|
};
|
|
21
22
|
export type PlayerTransport = {
|
|
22
23
|
prevOn: boolean;
|
|
@@ -41,7 +42,10 @@ export declare function MiniPlayer({ pos, transport, chip, voices, onShare, onFu
|
|
|
41
42
|
onFull: () => void;
|
|
42
43
|
copied: React.ReactNode;
|
|
43
44
|
}): 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 }: {
|
|
45
|
+
export declare function FullVideo({ topLeft, modal, 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 }: {
|
|
46
|
+
topLeft?: React.ReactNode;
|
|
47
|
+
modal?: React.ReactNode;
|
|
48
|
+
compact?: boolean;
|
|
45
49
|
noFull?: boolean;
|
|
46
50
|
page?: boolean;
|
|
47
51
|
onTouch: () => void;
|
package/dist/ui/shared.d.ts
CHANGED
|
@@ -191,7 +191,8 @@ export declare function useVoiceCatalogue(lang: string | null, active: boolean,
|
|
|
191
191
|
voices: AvailableVoice[];
|
|
192
192
|
} | null;
|
|
193
193
|
export declare function namedCount(model: Model): number;
|
|
194
|
-
export declare function useArchiveVoice({ recordingId, lang, ended, cred, pickedVoice, sentenceIds }: {
|
|
194
|
+
export declare function useArchiveVoice({ recordingId, lang, ended, cred, pickedVoice, sentenceIds, consent }: {
|
|
195
|
+
consent?: boolean;
|
|
195
196
|
recordingId: string | null;
|
|
196
197
|
lang: string | null;
|
|
197
198
|
ended: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vocalstack/player",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.71",
|
|
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",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"react-dom": ">=18"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@vocalstack/js-sdk": "^2.0.0-alpha.1"
|
|
39
|
+
"@vocalstack/js-sdk": "^2.0.0-alpha.1",
|
|
40
|
+
"hls.js": "^1.5.20"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@types/node": "^24.0.0",
|