/** * Returns whether **adaptive video playback (ABR)** is currently enabled. * * This hook provides a reactive way to observe and respond to changes in the player’s * adaptive video mode — i.e., whether the player automatically selects the optimal * video rendition based on current network and performance conditions. * * **Disabling ABR:** There is no `disableAdaptiveVideo()`. To turn off adaptive playback, * select a specific rendition with `player.getTrackManager().setVideoRendition(rendition)`, * which **automatically disables** ABR. To re-enable ABR, call * `player.getTrackManager().enableAdaptiveVideo()`. * * ⚠️ Must be used within a {@link PlayerProvider} or * [AVPlayerViewControllerProvider](../../ios-avplayerviewcontroller-plugin-api/variables/AVPlayerViewControllerProvider.md) component. * * @returns `boolean` **true** if adaptive (ABR) mode is enabled, otherwise **false**. * * @example * ```tsx * import React from 'react'; * import { View, Text, Button } from 'react-native'; * import { * usePlayer, * useAdaptiveVideoEnabled, * useVideoRenditions, * } from '@castlabs/react-native-prestoplay'; * * export default function AdaptivePlaybackControl() { * const player = usePlayer(); * const adaptiveEnabled = useAdaptiveVideoEnabled(); * const renditions = useVideoRenditions(); * * // Re-enable adaptive playback (ABR) * const enableAdaptive = async () => { * await player.getTrackManager().enableAdaptiveVideo(); * }; * * // Disable ABR by locking to the currently active rendition * const lockToCurrentQuality = async () => { * const current = renditions.find(r => r.active) ?? renditions[0]; * if (current) { * await player.getTrackManager().setVideoRendition(current); * } * }; * * return ( * * Adaptive Playback: {adaptiveEnabled ? 'Enabled' : 'Disabled'} * {adaptiveEnabled ? ( *