Headless player: Client timeout when connecting to service

:backhand_index_pointing_right: Bug Description


1. Summary

App Name: Reference App for Headless JS Media Player

In the example implementation of the headless player (specification in PlayerUI):
we first implement call through the factory getOrMake client which in its turn creates the service
then we register the different listeners: message, error, status etc.

The problem is when the Player Service “on start” takes more time, the connection of the client times out, causing the registration of listeners to fail.

Please see the logs for clearer sequence of the time out.

Is this expected? Is there a way to wait for the service initialisation before registering the listeners?

Bug Severity

  • 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

One sure way to reproduce it is to artificially increase the start up time of the Player Service

await new Promise((resolve) => setTimeout(resolve, 3000));
await playerService.start();
console.log(‘[PlayerService] Service started’);

5. Logs or crash report

Player service filtered logs

issue-logs-filtered.log (11.7 KB)

All device logs

sample-app-forced.log (1.0 MB)

6. Environment

  • SDK Version: 0.20.3351

  • 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 did some more investigation on this issue, and I noticed it happens only in a special case:

In a setup where

  • the app is running in debug mode
  • connected to the dev server through port forwarding
playerClientFactory.current = new PlayerClientFactory();
// this line triggers the creation of the service and in dev mode the build of the service bundle 
//  BUNDLE  ./service.js
playerClient.current = playerClientFactory.current.getOrMakeClient(
  playerServiceComponentId,
);
const registerMessageListener = async () => {
      messageListenerSubscription.current =
        await playerClient.current?.registerMessageListener(
          { ....

So the fact that the build of the service takes more than 2 seconds, makes the client timeout.

Closing topic as issue is fixed/resolved.