// Messages between the recorder page (which owns the media streams) and the pop-out teleprompter. export type RecPhase = 'setup' | 'countdown' | 'recording' | 'paused' | 'processing'; export interface RecState { phase: RecPhase; elapsed: number; countdown: number; canStart: boolean; message?: string; } export type RecCommand = 'start' | 'pause' | 'resume' | 'stop' | 'hello'; export type RecMessage = { type: 'state'; state: RecState } | { type: 'command'; cmd: RecCommand } | { type: 'closed' }; export const channelName = (videoId: string) => `takes-recorder-${videoId}`;