Media Player Set up
This topic specifies the core project settings and updates needed to incorporate the W3C Media Player into a React Native for Vega app.
Create a Vega App. For more details about creating an app, see Create a Vega App.
-
Open the package.json in your app folder. In the
dependencies
section, include the react-native-w3cmedia package."@amazon-devices/react-native-w3cmedia": "~2.1.80"
-
Open a terminal window and navigate to your app folder. Run npm to install the package in your app,
npm install
-
Update your babel.config.js file, otherwise the app throws a "ReferenceError: Property 'React' doesn't exist" exception during runtime.
module.exports = { presets: [ ['module:metro-react-native-babel-preset', { useTransformReactJSXExperimental: true }] ], plugins: [ [ '@babel/plugin-transform-react-jsx', { runtime: 'automatic', }, ], ] };
-
Add the following permissions to the app manifest in the mainfest.toml file.
[wants] [[wants.service]] id = "com.amazon.mediametrics.service" # Required for metrics service [[wants.service]] id = "com.amazon.media.server" [[wants.service]] id = "com.amazon.gipc.uuid.*" [[wants.service]] id = "com.amazon.media.playersession.service" [[wants.privilege]] id = "com.amazon.devconf.privilege.accessibility" # Required for captions [[wants.service]] id = "com.amazon.mediabuffer.service" [[wants.service]] id = "com.amazon.mediatransform.service" [[wants.service]] id = "com.amazon.audio.stream" [[wants.service]] id = "com.amazon.audio.control" [offers] [[offers.service]] id = "com.amazon.gipc.uuid.*"
To play systemd sounds, you must add the following audio management service name:
- com.amazon.audio.system - for all AudioManager API clients
Add the following entries to the mainfest.toml file:
[[wants.service]]
id = "com.amazon.audio.system"
Related topics
Last updated: Sep 30, 2025