import PrestoPlayError from '../errors/PrestoPlayError'; /** * Returns the current player **fatal error**, if any. * * This hook provides a reactive way to observe unrecoverable playback errors emitted by the player. * The error is automatically cleared when either {@link Player.stop} or {@link Player.open} is called. * * ⚠️ Must be used within a {@link PlayerProvider} or * [AVPlayerViewControllerProvider](../../ios-avplayerviewcontroller-plugin-api/variables/AVPlayerViewControllerProvider.md) component. * * @returns `{PrestoPlayError | null}` The current fatal {@link PrestoPlayError} object, or **null** if no fatal error is present. * * @example * ```tsx * function FatalErrorBanner() { * const fatalError = usePlayerFatalError(); * * if (!fatalError) return null; * * return ( *