/** * Returns whether the player is currently **muted**. * * This hook provides a reactive way to observe and respond to changes in the player's * mute state — useful for updating UI elements (e.g., toggling a mute/unmute button) * or running logic based on whether sound is enabled. * * You can control this state using: * - `player.setMuted(true)` — mutes the player. * - `player.setMuted(false)` — unmutes the player. * * The `setMuted(newMuted)` method returns a `Promise` and updates the player’s * audio output state asynchronously. * * ⚠️ Must be used within a {@link PlayerProvider} or * [AVPlayerViewControllerProvider](../../ios-avplayerviewcontroller-plugin-api/variables/AVPlayerViewControllerProvider.md) component. * * @returns `boolean` **true** if the player is muted, otherwise **false**. * * @example * ```tsx * import React from 'react'; * import { View, Text, Button } from 'react-native'; * import { usePlayer, useMuted } from '@castlabs/react-native-prestoplay'; * * export default function MuteToggle() { * const player = usePlayer(); * const muted = useMuted(); * * const toggleMute = async () => { * await player.setMuted(!muted); * }; * * return ( * * {muted ? 'Muted 🔇' : 'Unmuted 🔊'} *