/ proof-of-concept / takes
Sign in
proof-of-concept / takes
takes / src / lib / channel.ts
17 lines · 592 BBlameHistoryRaw
1// Messages between the recorder page (which owns the media streams) and the pop-out teleprompter.
3export type RecPhase = 'setup' | 'countdown' | 'recording' | 'paused' | 'processing';
5export interface RecState {
6 phase: RecPhase;
7 elapsed: number;
8 countdown: number;
9 canStart: boolean;
10 message?: string;
13export type RecCommand = 'start' | 'pause' | 'resume' | 'stop' | 'hello';
15export type RecMessage = { type: 'state'; state: RecState } | { type: 'command'; cmd: RecCommand } | { type: 'closed' };
17export const channelName = (videoId: string) => `takes-recorder-${videoId}`;
↑↓ move↵openescclose