Headless JS Playback - destroying client, crashes the app?

I’m trying to call playerClient.destroy() when leaving the PlayerScreen component. But that results in the app crashing(I get kicked back to the device’s Home screen with no logs in the dev console). I was able to capture some of the logs from my USB stick.

I’m destroying the playerClient in the beforeRemove callback from react-navigation in my screen component.

If I comment the line, the app backs out fine and I can play other videos. But if I stay in the PlayerScreen(we have an “Up next" feature and try to load another stream, it seems that KeplerSurfaceView won’t work on the next video as it doesn’t render any video frames but I can hear audio.

This is a blocker for us.
I’m attaching the device logs.

player-client-destroy.log (126.4 KB)

App Name: Vimeo OTT
App Link on Amazon Appstore *Not available yet.*

Hi @adheus ,

Our team is checking on this.
Meanwhile, could you please help us with the below information which will help us investigate better.

Environment

Please fill out the fields related to your bug below:

  • SDK Version: Output of kepler --version
  • App State: [Foreground/Background]
  • OS Information
    Please ssh into the device via kepler exec vda shelland copy the output from cat /etc/os-releaseinto the answer section below. Note, if you don’t have a simulator running or device attached kepler exec vda shell will respond with vda: no devices/emulators found
<!-- Answer here if applicable --> 
  • Player SDK: [Bitmovin, Shaka, ...]
  • Player SDK Version: [e.g. 1.23]
    • Audio Codecs: [AAC, ...]
    • Video Codecs: [h.264, mp4]
    • Manifest Types: [m3u8, dash, etc ..]

Example Code Snippet

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

import { ExampleComponent } from 'custom-sdk';

<ExampleComponent config={{ key: 'value' }} />

Thanks,
Rohit

Environment

Please fill out the fields related to your bug below:

  • SDK Version: 0.20.3719
  • App State: Foreground
  • OS Information

  NAME=“OS”
  OE_VERSION=“4.0.0”
  OS_MAJOR_VERSION=“1”
  OS_MINOR_VERSION=“1”
  RELEASE_ID=“2”
  OS_VERSION=“1.1”
  BRANCH_CODE=“VegaMainlineTvIntegration”
  BUILD_DESC=“OS 1.1 (VegaMainlineTvIntegration/4418)”
  BUILD_FINGERPRINT=“4.0.155683.0(3072cab629675a74)/4418N:user-external/release-keys”
  BUILD_VARIANT=“user-external”
  BUILD_TAGS=“release-keys”
  BUILD_DATE=“Wed Sep 03 05:40:19 UTC 2025”
  BUILD_TIMESTAMP=“1756878019”
  VERSION_NUMBER=“201010441850”

.

I have the same issue and see in adheus logs one common line:
Process ‘my.app.name’ (PID=23618) crashed with signal 11

This bug can be reproduced in the demo app (HeadlessJSMediaPlayerReferenceApp-3.2.5), with a little update:

import { App as Player } from './src/PlayerUI';

const App = () => {
  const[visible, setVisible] = useState(true);
  const hidePlayer = () => {
    setVisible(!visible);
  };
  return (
    <>
      <TouchableOpacity style={styles.controlButton} onPress={hidePlayer}>
        <Text style={[styles.buttonText, { position: 'absolute', top: 10, left: 10, zIndex: 1000, width: 100 }]}>Unmount player</Text>
      </TouchableOpacity>
      {visible && <Player />}
    </>
  )
};
AppRegistry.registerComponent(appName, () => App);

To reproduce the issue, we should start a video and then click the “Unmount player“ button.
Application crashes with signal 11.

@Amz_Rsk Any suggestions?

1 Like