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

    Function useMediaControls

    • Hook for managing media controls (audio, video, screen share).

      Parameters

      Returns UseMediaControlsResult

      This hook extracts media control logic from ControlBar, providing:

      • Audio mute/unmute with event synchronization
      • Video mute/unmute with event synchronization
      • Screen sharing start/stop
      • Remote mute event handling

      The hook automatically syncs with client events to handle:

      • Local mute/unmute actions
      • Remote mute from room owner
      • Screen share stopped events
      const {
      isAudioMuted,
      isVideoMuted,
      isScreenSharing,
      toggleAudio,
      toggleVideo,
      toggleScreenShare,
      } = useMediaControls({
      client,
      localUserId,
      contextAudioMuted,
      contextVideoMuted,
      });