General settings - Storm JavaScript Library
This part describes all possible settings related to the player enclosed within the "settings" object.
Parameter name | Parameter type | Required | Default | Description |
---|
autoStart | string | no | false | Determines whether the player will start playback automatically. |
restartOnError | string | no | false | If set to "true", whenever a player encounters an error (related to video or stream etc.) it’ll try to restart. |
reconnectTime | number | no | 1.0 | Delay between reconnections with a Storm Server instance or a Storm Gateway instance. |
enabledProtocols | Array (string) | yes | Storm, HLS | The list of all enabled protocols for the player. The list includes "Storm", "HLS", "WebRTC" (coming soon). |
buffer | Object | No | { minValue: 0.5, startValue: 0.7, maxValue: 1.5, targetValue: 1.0 } | Contains all parameters related to video buffering. All values are in seconds. For more reference, please check buffer table. |
video | Object | No | Please check video table for more info | Contains all parameters related to video object and video scaling. |
audio | Object | No | Please check audio table for more info | Contains all parameters related to audio configuration. |
debug | Object | No | Please check debug table for more info | Contains all parameters related to player debugging. |
Table 1. General settings
Buffer object
Parameter name | Parameter type | Required | Default | Description |
---|
minValue | Number | yes | - | The length of a video (in seconds) that must be stored within the buffer in order to start a playback. If the buffer value drops below – the player will start buffering. |
startValue | number | yes | - | A number of seconds of a video that must be buffered before playback is allowed. This value should be higher than minValue. |
maxValue | number | yes | - | Max value for buffer (in seconds). If the buffer exceeds this value, frames will be dropped to ensure real-time operation. |
targetValue | number | yes | - | Buffer size (seconds) that player should try to keep. |
Table 2. Buffer table
Video object
Parameter name | Parameter type | Required | Default | Description |
---|
scalingMode | string | no | fill | Describes how the video should be scaled according to the player size. Possible options: "fill" (the video will cover the whole player screen), "letterbox" (the video will keep its proportions without cutting any part of the screen), "crop" (the video will be resized to match the player size, but it’ll keep right proportions). |
containerID | string | yes | - | Name of the player container (id) within page code where the player should be added. |
width | number | yes | - | Player width - can be later changed using resize or setWidth(). |
height | number | yes | - | Player height - can be later changed using resize or setHeight()). |
Table 3. Video table
Audio object
Parameter name | Parameter type | Required | Default | Description |
---|
startVolume | number | no | 100 | The initial volume for the player. |
maxVolume | number | no | 100 | Max volume for the player. All future values will be remapped to match this value as 100%. |
rememberValue | boolean | no | true | Decides whether the player will save users volume for future use (via cookies). |
Table 4. Audio table
Debug object
Parameter name | Parameter type | Required | Default | Description |
---|
console | Object | no | {enabled: false} | Defines tracing options for the player that will be output to the browser’s console. For more reference, please check debug console table. |
container | Object | no | {enabled: false} | Defines tracing options for the player that will be output to the provided HTML container. For more reference, please check debug container table. |
Table 5. Debug table
Debug console object
Parameter name | Parameter type | Required | Default | Description |
---|
enabled | boolean | no | false | Works as an ON/OFF switch for this option. |
logTypes | Array (string) | no | ["ERROR", "INFO", "TRACE", "WARNING", "SUCCESS"] | Decides which log types will be output using this channel. Log types are: ERROR, INFO, TRACE, WARNING, and SUCCESS. |
monoColor | boolean | no | false | By default, each log type has got its color. However, if you wish to keep logs a single color (for a specific player by given id), you can switch this option to true. |
Table 6. Debug console table
Debug container object
Parameter name | Parameter type | Required | Default | Description |
---|
enabled | boolean | no | false | Works as an ON/OFF switch for this option. |
logTypes | Array (string) | no | ["ERROR", "INFO", "TRACE", "WARNING", "SUCCESS"] | Decides which log types will be output using this channel. Log types are: ERROR, INFO, TRACE, WARNING, and SUCCESS. |
containerID | string | yes | - | HTML container for the logs (id). |
monoColor | boolean | no | false | By default, each log type has got its color. However, if you wish to keep logs a single color (for a specific player by given id), you can switch this option to true. |
Table 7. Debug container table