Provides start/stop controls for live transcription, typically used by room owners. This is the base component that requires the client and state to be passed as props.
Use TranscriptionControls (this component) when:
Use ConnectedTranscriptionControls when:
isOwner is falseonError callback on failuresThe component calls client.startTranscribing() and client.stopTranscribing()
from the Hiyve client. These methods:
Transcription is typically a room-owner-only feature because:
Full button in a control panel:
function ControlPanel() {
const [isTranscribing, setIsTranscribing] = useState(false);
const [transcriptionId, setTranscriptionId] = useState<string | null>(null);
return (
<TranscriptionControls
client={client}
isOwner={isOwner}
isTranscribing={isTranscribing}
onTranscriptionStart={(id) => {
setTranscriptionId(id);
setIsTranscribing(true);
toast.success('Transcription started');
}}
onTranscriptionStop={() => {
setTranscriptionId(null);
setIsTranscribing(false);
toast.info('Transcription stopped');
}}
onError={(error) => toast.error(error.message)}
/>
);
}
Icon-only button in a toolbar:
<TranscriptionControls
client={client}
isOwner={isOwner}
isTranscribing={isTranscribing}
iconOnly
size="small"
onTranscriptionStart={handleStart}
onTranscriptionStop={handleStop}
/>
With confirmation dialog before starting:
function TranscriptionButton() {
const [showConfirm, setShowConfirm] = useState(false);
const handleStartClick = async () => {
// Show custom confirmation
setShowConfirm(true);
};
return (
<>
<TranscriptionControls
client={client}
isOwner={isOwner}
isTranscribing={isTranscribing}
disabled={showConfirm}
onTranscriptionStart={handleStartClick}
labels={{
startTranscription: 'Enable Captions',
stopTranscription: 'Disable Captions',
tooltip: 'Live captions for all participants',
}}
colors={{
active: '#22c55e', // Green when active
idle: '#6366f1', // Indigo when idle
}}
/>
<ConfirmDialog
open={showConfirm}
onConfirm={() => {
client.startTranscribing();
setShowConfirm(false);
}}
onCancel={() => setShowConfirm(false)}
/>
</>
);
}
ConnectedTranscriptionControls from @hiyve/transcription/connected - Auto-connected version for HiyveProvider users
TranscriptionControls component - start/stop controls for live transcription.