How to change request timeout in the Bitmovin Web Player
Overview
By default, the Bitmovin Web Player waits 20 seconds before canceling an unfulfilled network request. In some cases, especially Live use-cases, it can be helpful to reduce the default timeout delay in order to allow the player to retry the request faster or to switch to a backup stream. Since v8.245.0, timeouts can be configured through the NetworkConfig - either as a global default or per request type.
Setting a Default Timeout
Use NetworkConfig.defaultRequestTimeout to override the default timeout (in seconds) for all network requests:
const config = {
key: 'YOUR_PLAYER_KEY_HERE',
network: {
defaultRequestTimeout: 10, // 10 seconds for all requests
},
};Setting Timeouts Per Request Type
Use NetworkConfig.requestTimeout to configure different timeouts for specific request types. This overrides the defaultRequestTimeout for the given types:
const config = {
key: 'YOUR_PLAYER_KEY_HERE',
network: {
defaultRequestTimeout: 15,
requestTimeout: {
[HttpRequestType.MANIFEST_DASH]: 10,
[HttpRequestType.MEDIA_VIDEO]: 5,
[HttpRequestType.MEDIA_AUDIO]: 5,
[HttpRequestType.DRM_LICENSE_WIDEVINE]: 30,
},
},
};In this example:
- DASH manifest requests time out after 10 seconds
- Video and audio segment requests time out after 5 seconds
- Widevine DRM license requests time out after 30 seconds
- All other request types use the default of 15 seconds
Available Request Types
Timeouts can be configured for any HttpRequestType, including:
| Category | Request Types |
|---|---|
| Manifests | MANIFEST_DASH, MANIFEST_HLS_MASTER, MANIFEST_HLS_VARIANT, MANIFEST_SMOOTH |
| Media segments | MEDIA_VIDEO, MEDIA_AUDIO, MEDIA_SUBTITLES, MEDIA_THUMBNAILS |
| DRM licenses | DRM_LICENSE_WIDEVINE, DRM_LICENSE_PLAYREADY, DRM_LICENSE_CLEARKEY, DRM_LICENSE_FAIRPLAY, DRM_CERTIFICATE_FAIRPLAY |
| Other | KEY_HLS_AES, TIME_SYNC |
See the HttpRequestType API reference for the full list.
Updated 13 days ago