@vocalstack/player 0.1.0-alpha.7 → 0.1.0-alpha.8
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/index.d.ts +1 -1
- package/dist/index.js +2475 -2409
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/ui/SourceGate.d.ts +4 -2
- package/dist/ui/VocalStackPlayer.d.ts +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,10 @@ export function Video() {
|
|
|
35
35
|
| `endCard` | on | At the end of a video, offers to transcribe another link in the visitor's own VocalStack account. Pass `false` to turn it off. |
|
|
36
36
|
| `baseUrl` | `https://api.vocalstack.com` | |
|
|
37
37
|
| `onSource`, `onProgress`, `onError` | | Called with the loaded transcription, the transcription progress (0-100, `null` when done), and errors. |
|
|
38
|
+
| `onPlayback` | | Called about ten times a second while anything changes, with `{ t, dur, playing, idx, seekN, lang }`: the time in seconds, the length, whether it plays, the index of the current line, a counter that grows on every seek, and the language shown. |
|
|
39
|
+
| `ref` | | A `PlayerHandle`: `seek(t)`, `play()`, `pause()`, `toggle()`. |
|
|
40
|
+
| `compact` | `false` | Small controls at any width, and no title, summary or share card when paused. For a player inside a side column or card. |
|
|
41
|
+
| `poster` | | An image shown behind the player before a video is chosen or before the visitor connects. |
|
|
38
42
|
|
|
39
43
|
### Settings
|
|
40
44
|
|
|
@@ -61,6 +65,14 @@ export function Video() {
|
|
|
61
65
|
<VocalStackPlayer src="https://www.youtube.com/watch?v=QWCLiPOgeuw" />
|
|
62
66
|
```
|
|
63
67
|
|
|
68
|
+
Follow and drive it from your page:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const player = useRef<PlayerHandle>(null);
|
|
72
|
+
<VocalStackPlayer ref={player} id="r4m4srrrhi24" onPlayback={(s) => setAt(s.t)} />
|
|
73
|
+
<button onClick={() => player.current?.seek(42)}>Jump to 0:42</button>
|
|
74
|
+
```
|
|
75
|
+
|
|
64
76
|
Theme it by overriding the CSS variables on `.vsp`, for example `--vsp-radius`, `--brand` and `--vs-font-sans`.
|
|
65
77
|
|
|
66
78
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './styles.css';
|
|
2
|
-
export { VocalStackPlayer, type VocalStackPlayerProps, type PlayerSettings, type PlayerControls } from './ui/VocalStackPlayer';
|
|
2
|
+
export { VocalStackPlayer, type VocalStackPlayerProps, type PlayerSettings, type PlayerControls, type PlayerHandle, type PlaybackState } from './ui/VocalStackPlayer';
|
|
3
3
|
export type { EndCardOptions } from './ui/EndCard';
|
|
4
4
|
export { PlayerApiProvider, usePlayerApi, useApi, type PlayerApi, type PlayerApiProviderProps, type ApiOptions, type PlayerSource, type TokenSource, type Listen } from './data/context';
|
|
5
5
|
export type { ErrorLike } from './data/errors';
|