App crashes when using a non supported video codec on src

:backhand_index_pointing_right: Bug Description


1. Summary

On a Vega React Native app using Video or VideoPlayer with KeplerVideoSurfaceView (@amazon-devices/react-native-w3cmedia*), the app closes when putting a video source stream with a non-supported codec. There is no error message; the app simply crashes and closes without even giving a warning message.*

App Name: com.freecastvega

Bug Severity
Select one that applies

  • Impacts operation of app
  • Blocks current development
  • Improvement suggestion
  • Issue with documentation (If selected, please share the doc link and describe the issue)
  • Other

2. Steps to Reproduce

  1. Following the Video react native component example ( @amazon-devices/react-native-w3cmedia | Vega API ), put a video src with MPEG2 video codec.
  2. At the moment the src is set the app breaks and close;

3. Observed Behavior

I tried with many video types and noticed that always when I use a src url with the MPEG2 video codec, it breaks:

On the Vega TV:

MP4 file (.mp4) -> works
MPEGTS: HEVC video + EAC3 audio (.ts) -> works
MPEGTS: MPEG2 video + AC3 audio (.ts / video/mp2t; codecs="mp2v, ac-3) -> breaks

On the Simulator:

MP4 file (.mp4) -> works
MPEGTS: HEVC video + EAC3 audio (.ts) -> breaks
MPEGTS: MPEG2 video + AC3 audio (.ts / video/mp2t; codecs="mp2v, ac-3) -> breaks

4. Expected Behavior

It should throw some error message on the onError EventListener instead of closing the app. Normally, when it happens on the browser with HTML5 video, we get the error message with code 4:

<MediaError {code: 4, message: ''} → MEDIA_ERR_SRC_NOT_SUPPORTED  

4.a Possible Root Cause & Temporary Workaround

For now, some ideas come like checking the video extension or getting the packets of the response before setting the video src. But none seem like good ideas, just simple workarounds

5. Environment

  • SDK Version: 0.21.4726

  • App State: [Foreground]

  • OS Information

    NAME="OS"
    OE_VERSION="4.0.0"
    OS_MAJOR_VERSION="1"
    OS_MINOR_VERSION="1"
    RELEASE_ID="10"
    OS_VERSION="1.1"
    BRANCH_CODE="TV Ship"
    BUILD_DESC="OS 1.1 (TV Ship/10240300)"
    BUILD_FINGERPRINT="1.0.24030.0(9a1d8dfa7da5d600)/10240300N:user/dev-keys"
    BUILD_VARIANT="user"
    BUILD_TAGS="dev-keys"
    BUILD_DATE="Thu Sep 25 10:32:58 UTC 2025"
    BUILD_TIMESTAMP="1758796378"
    VERSION_NUMBER="1002034030030"
    

6. Example Code Snippet / Screenshots / Screengrabs

Include any relevant code or component setup in React Native that can help reproduce the bug.

import React, { useRef } from 'react';
import { View, useWindowDimensions } from 'react-native';
import { Video } from '@amazon-devices/react-native-w3cmedia';

export const VegaPlayer: React.FC<VegaPlayerProps> = ({url}: {url: string}) => {
  const video = useRef<Video | null>(null);
  const { width: deviceWidth, height: deviceHeight } = useWindowDimensions();

return (
<View
<Video
        src={url}
        width={deviceWidth}
        height={deviceHeight}
        ref={(ref) => {
          video.current = ref;
        }}
        onError={(err) => {
          setStatus('Error');
          setErrorMsg(JSON.stringify(err));
        }}
      />
    </View>
  );
};

Player SDK: [W3C Video]

  • Player SDK Version: [@amazon-devices/react-native-w3cmedia": "^2.1.87]
    • Audio Codecs: [AC3]
    • Video Codecs: [mp2t]
    • Manifest Types: [N/A]

Q: If applicable, please provide your media/content url
If this is created dynamically, tokenized, etc please provide a way for us to access it

[N/A]

Q: Are there any special headers required to reproduce the issue you are facing?

[N/A]

:backhand_index_pointing_right: Additional Context


I created this report some weeks ago when trying to play an MPEG2 video in WebView, but it has not responded yet.

https://developer.amazon.com/support/cases/18841209981

I also have some questions:

  • Does the Vega device have a codec for MPEG-2 video?

  • Does the Vega OS have the ability to deal with MPEG-2 video?

  • Is there some way for the WebView app (The Webview inside the React Native app) to access the GStream (like a bypass) to deal with this kind of codec?

  • Is there some way for the React Native app to access the GStream (like a bypass) to deal with this kind of codec?

Hi @PatrickJanuario,

Thank you for the detailed bug report on the video codec crash issue.

Our team is investigating this issue and will provide an update as soon as we have more information.

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

1 Like