Open source library for VAST4/VMAP 1 ads on Vega (React Native)

Hi all. In Please support react-native-xml and react-native-xml2js libraries a developer asked for XML support on Vega, because VAST ads are XML. I post here for anyone who lands on the same problem. I built an open source library for client-side ads on Vega – react-native-vega-ads

  • It reads VAST 4 and VMAP 1 in pure JavaScript (Dailymotion’s vast-client with @xmldom/xmldom)
  • It also does what comes after parsing – wrappers, ad pods, Skip, IAB tracking pixels and VAST error codes.
  • It plays ads on the native w3cmedia player and switches between the movie player and the ad player as the CSAI guide describes. The remote and Alexa, pause work during ads
  • Tested on a Fire TV Stick 4K Select (Vega OS 2.0) with React Native 0.72 and 0.83

Hi @Yury_Kalenkou,

This is fantastic - thank you for building this and sharing it back with the community.

It’s also great to see that your design lines up with the platform’s recommended approach. Keeping the content stream untouched and letting the app own the switch between the movie player and the ad player on the native w3cmedia player is exactly the model described in the official CSAI guidance:

A couple of things that stood out:

  • Handling wrappers, ad pods, Skip, IAB tracking pixels, and VAST error codes (not just parsing) makes this genuinely usable end-to-end.
  • Confirming remote and Alexa pause work during ads is a nice detail - that’s an easy thing to miss when swapping players.

A couple of optional questions:

  1. Which @amazon-devices/react-native-w3cmedia version(s) did you validate against, alongside the RN 0.72 / 0.83 you mentioned?
  2. Any known limitations so far (e.g., DRM-protected ad creatives, specific VAST features not yet covered)?

Thanks again for giving back to the community - this is the kind of contribution that helps everyone building media apps on Vega.

Warm regards,
Aishwarya

Hi @amen, thank you!

Validated on a Fire TV Stick 4K Select (Vega OS 2.0, Vega SDK 0.24.12112):

  1. React Native 0.72 with @amazon-devices/react-native-w3cmedia 2.1.99 and react-native-kepler 2.1.0
  2. React Native 0.83 with @amazon-devices/react-native-w3cmedia 2.3.2 and react-native-kepler 4.0.1

The package needs w3cmedia 2.1.0 or later. I haven’t tried the 2.3.4-rn-83 alpha yet.
Full list known limitations – react-native-vega-ads/docs/limitations.md at main · kalenkou/react-native-vega-ads · GitHub

  1. DRM ads. The stick has one secure video decoder. If both the movie and the ads use DRM, the ad player cannot decode while the movie player holds it. So ad creatives should be clear.
  2. Memory. The stick has 1 GB RAM. The library uses two ad players to keep gaps in a pod short. If the second one cannot start, it continues with one.
  3. Not supported yet: VPAID, SIMID, Companion ads, Icons (AdChoices), Open Measurement (AdVerifications) and ViewableImpression. NonLinear is used for pause ads only.
  4. SSAI is tracking only and still in preview. The library does not stitch.
  5. No Amazon Publisher Services integration yet.
  6. HTTPS media only, unless the host is in the manifest’s cleartext list.

CSAI guide keeps the movie player paused during the ad and the media player requirements allow only one secure decoder instance. For DRM content with DRM ads is the recommended way to deinitialize the movie player before the ad and resume it after? Or is a second secure decoder planned for future Vega devices?

Hi @Yury_Kalenkou,

Thank you for the detailed version list and for publishing the limitations doc. That’s really useful for anyone evaluating the library.

On your questions:

  1. There’s no need to validate against the 2.3.4-rn-83 alpha.
  2. On DRM content with DRM ads: as noted in the media player requirements ( General requirements for media apps - Amazon Vega Docs , see “Limitation of Secure Video Decoder sessions”), Vega-based Fire TV devices today support only one secure video decoder instance. To play secure video back to back, you must deinitialize the first VideoPlayer instance before initializing the second one, otherwise the second playback will fail.

Thanks again for sharing this with the community and helping us improve the Vega platform.

Warm regards,
Aishwarya