Error Handling
Listening for the "Player Not Ready" Event:
window.addEventListener('geniussportsmessagebus', async function (event) {
// Error handling
if (event.detail.type === 'player_not_ready') {
const errorsArray = event.detail.body.error
// Add your custom handling here
}
})
The player_not_ready event is triggered when an error is detected, it signifies the player's unreadiness for playback. The subsequent errors, complete with their respective error codes, messages, and particulars, are enumerated below.
Error Code | Message | Details |
---|---|---|
1001 | Region or device not allowed | The region or device provided is not allowed to stream the given fixture Id, please consult the permissions of the fixture |
1002 | Dma zone not allowed | The requested fixture cannot be streamed due to restrictions on the user's DMA zone. |
1003 | No deliveries found | There are no allowed deliveries found in the fixture - Please reach out to Genius support for assistance. |
1004 | Video cannot be played | We are unable to stream the requested fixture at the moment. Please try again later or contact support for assistance. |
It is important to effectively manage these errors. The event becomes active when an error is captured and identified with a respective error code. Consequently, an array of error listings is produced.
In certain situations involving streams and constraints, your streaming playback request might confront multiple errors simultaneously. Each error corresponds to a distinct constraint that obstructs seamless streaming. Adequate readiness to adeptly handle multiple errors is essential. Below is an elucidation of receiving multiple error codes.
error: [
{
"code": 1001,
"message": "Region or device not allowed",
"details": "The region or device provided is not allowed to stream the given fixture Id, please consult the permissions of the fixture"
},
{
"code": 1002,
"message": "Dma zone not allowed",
"details": "The requested fixture cannot be streamed due to restrictions on the user's Dma zone."
}
]