Hiyve Components - v1.0.0
    Preparing search index...

    Interface LocalMediaState

    Local media state for the current user's devices.

    Tracks the mute/unmute state of local audio, video, and output, as well as screen sharing status.

    Media control buttons:

    function MediaControls() {
    const {
    isAudioMuted,
    isVideoMuted,
    isScreenSharing,
    toggleAudio,
    toggleVideo,
    startScreenShare,
    stopScreenShare
    } = useLocalMedia();

    return (
    <div>
    <button onClick={toggleAudio}>
    {isAudioMuted ? 'Unmute' : 'Mute'}
    </button>
    <button onClick={toggleVideo}>
    {isVideoMuted ? 'Start Video' : 'Stop Video'}
    </button>
    <button onClick={isScreenSharing ? stopScreenShare : startScreenShare}>
    {isScreenSharing ? 'Stop Share' : 'Share Screen'}
    </button>
    </div>
    );
    }

    useLocalMedia for the hook to access and control local media

    interface LocalMediaState {
        isAudioMuted: boolean;
        isOutputMuted: boolean;
        isScreenSharing: boolean;
        isVideoMuted: boolean;
    }
    Index

    Properties

    isAudioMuted: boolean

    Whether local microphone is muted

    isOutputMuted: boolean

    Whether speaker/output is muted

    isScreenSharing: boolean

    Whether screen sharing is active

    isVideoMuted: boolean

    Whether local camera is muted/off