/** * Returns the list of available **text tracks** (subtitles or captions) for the current media. * * This hook provides a reactive way to observe and respond to changes in the player’s * text track model. Each track typically represents a subtitle, caption, or timed text stream * — for example, different languages or accessibility captions. * * ⚠️ Must be used within a {@link PlayerProvider} or * [AVPlayerViewControllerProvider](../../ios-avplayerviewcontroller-plugin-api/variables/AVPlayerViewControllerProvider.md) component. * * @returns `{TextTrack[]}` An array of available {@link TextTrack} for the current media. * * @example * ```tsx * import React from 'react'; * import { View, Text, Button } from 'react-native'; * import { usePlayer, useTextTracks } from '@castlabs/react-native-prestoplay'; * * export default function SubtitleSelector() { * const player = usePlayer(); * const tracks = useTextTracks(); * const activeTrack = tracks.find(t => t.active); * * const selectTrack = async (track: TextTrack | null) => { * // If track is null, subtitles are hidden. * await player.getTrackManager().setTextTrack(track); * }; * * return ( * * Subtitles *