Prerequisites
- A Vega app created from a template. For instructions, see Build Your App.
- The W3C Media Player dependency, Babel configuration, and manifest permissions in place. For instructions, see Media Player Setup.
- A Fire TV device or emulator that you can deploy to.
Build the app
1
Confirm your dependency
Your package.json file must include the W3C Media package:Then install it:
2
Create the player screen
Create a file named src/HelloWorldPlayer.tsx with the following content. This is the whole app: a
VideoPlayer instance that owns playback state, and a KeplerVideoView that renders the video surface.3
Render the screen from your app entry point
Point your app root at the new screen.
4
Replace the video URL
Set
VIDEO_URL to a media file your device can reach. URL mode supports MP4, MP3, MKV, FLV, OGG, and FLAC. If you point it at an HLS (.m3u8) or DASH (.mpd) manifest, playback fails — those require MSE mode and a JavaScript player. See Selecting Playback Mode.5
Build, install, and run
Build your app and deploy it to your device or emulator. For the full command set, see Build Your App.The video plays full screen, and the status text under it updates as the player moves from
Loaded to Playing.Add play and pause
TheVideoPlayer object exposes the standard HTMLMediaElement surface, so simple controls are a few lines. Wire this to a focusable button or a D-pad key handler:
currentTime, duration, and volume, and listen for timeupdate to drive a progress bar.
Troubleshooting
Next steps
- Selecting Playback Mode — choose between URL mode and MSE mode
- Shaka Player Integration — add adaptive streaming
- W3C Media integration with Vega Media Controls — connect to system playback controls

