Getting the player has been destroyed error frequently

bitmovinplayer.js:11 Uncaught

  1. t {code: 1001, name: ‘API_NOT_AVAILABLE’, sourceIdentifier: undefined, message: ‘Cannot use the player.getAvailableAudio API: the player has already been destroyed.’, data: undefined, …}

  2. code: 1001

  3. data: undefined

  4. message: “Cannot use the player.getAvailableAudio API: the player has already been destroyed.”

  5. name: “API_NOT_AVAILABLE”

  6. sourceIdentifier: undefined

  7. stack: "API_NOT_AVAILABLE: Cannot use the player.getAvailableAudio API: the player has already been destroyed.\n at r

Hi Nihar,

The error you report occurs when trying to access any method from the player API (eg: getAvailableAudio) after the player instance has been destroyed already (either intentionally or as a consequence of a playback error). Further information and potential root causes can be found here: API_NOT_AVAILABLE | Bitmovin Player API 8.120.0

As you can read in the link above, another common cause is if the UI tries to access the player after it has crashed or has been destroyed. In this case, recommendation would be:

In general, please ensure you listen to the PlayerEvent.Destroy event/callback and don’t access the player API after such event has been thrown in order to avoid this error.

1 Like