Prerequisites
- Vega development environment set up
- Vega Video Sample App installed and configured
- Basic knowledge of React Native and TypeScript
Install the required dependency
Add the toast message library to your project.Create the custom toast component
Create a new file for the TV-optimized toast component that displays a progress bar during user interaction. Create src/components/ProgressToast.tsx with the following implementation.Create the long press hook
Create a custom hook that manages the complete lifecycle of play/pause button interactions and toast visibility. Create src/hooks/useLongPressToast.tsx with the following implementation.TVEventHandler.
Register the toast component
Update your main App component to register the custom toast configuration. Add the following imports to src/App.tsx.Integrate the toast in your screen
To add the long press toast hook to your HomeScreen component with screen focus tracking, add the following imports to src/screens/HomeScreen.tsx.HomeScreen component.
isScreenFocused parameter makes sure the toast only appears when the HomeScreen is visible, preventing it from showing on other screens.
Test the implementation
Build and run your app on a Fire TV device or emulator:- Navigate to the Home Screen.
- Wait five seconds for the toast to appear automatically.
- Press and hold the play/pause button on your remote.
- Observe the progress bar filling over two seconds.
- Release early to cancel, or hold for the full duration to trigger navigation.

