/** * Returns the current **volume level** of the player. * * This hook provides a reactive way to observe and respond to changes in the player's * volume. The returned value is a floating-point number between `0.0` (muted) * and `1.0` (maximum volume). * * You can update the player’s volume with: * - `player.setVolume(value)` — where `value` is a float between `0.0` and `1.0`. * * The change is applied immediately and persists until modified again or playback resets. * * ⚠️ Must be used within a {@link PlayerProvider} or * [AVPlayerViewControllerProvider](../../ios-avplayerviewcontroller-plugin-api/variables/AVPlayerViewControllerProvider.md) component. * * @returns `number` The current volume level as a float between `0.0` (muted) and `1.0` (max). * * @example * ```tsx * import React from 'react'; * import { View, Text, Button } from 'react-native'; * import { usePlayer, useVolume } from '@castlabs/react-native-prestoplay'; * * export default function VolumeControl() { * const player = usePlayer(); * const volume = useVolume(); * * const increaseVolume = async () => { * const newVolume = Math.min(1.0, volume + 0.1); * await player.setVolume(newVolume); * }; * * const decreaseVolume = async () => { * const newVolume = Math.max(0.0, volume - 0.1); * await player.setVolume(newVolume); * }; * * return ( * * Volume: {(volume * 100).toFixed(0)}% *