/** * Returns the **media duration** in milliseconds. * * This hook provides a reactive way to observe and respond to changes in the total * playback duration — applicable **only for Video on Demand (VOD)** content. * * ### Behavior * - **VOD:** Returns the full duration of the asset in milliseconds, from `0` to `duration`. * - **LIVE:** Not applicable. Live content does not have a fixed duration; use * {@link useSeekableRange} instead to determine the playable time window. * * ⚠️ Must be used within a {@link PlayerProvider} or * [AVPlayerViewControllerProvider](../../ios-avplayerviewcontroller-plugin-api/variables/AVPlayerViewControllerProvider.md) component. * * @returns `number` The total duration of the media in milliseconds. * * @example * ```tsx * import React from 'react'; * import { View, Text } from 'react-native'; * import { useDuration, useLive } from '@castlabs/react-native-prestoplay'; * * export default function DurationInfo() { * const duration = useDuration(); * const isLive = useLive(); * * if (isLive) { * return Duration not available for live streams; * } * * return ( * * Total Duration: {Math.round(duration / 1000)} seconds * * ); * } * ``` * * @group Hooks */ export default function useDuration(): number;