Basic Settings - Storm JS Player Core
In this guide, you will get to know all the basic configuration options and parameters that Storm JS Player Core can accept. More advanced options and parameters can be found under Advanced Settings tab.
Basic Sample Code
Sample Code
const streamConfig = {
/*
* Configuration for server connection and the stream key.
*/
stream: {
serverList: [{
host: "yourdomain.com",
application: "live",
port: 443,
ssl: true
}],
streamKey: "test",
},
/*
* Player settings (some are optional). All available parameters are explained below.
*/
settings: {
autoConnect: true,
autoStart: true,
restartOnFocus: true,
restartOnError: true,
reconnectTime: 1.0,
video: {
containerID: "videoContainer",
aspectRatio: "16:9",
width: "100%",
},
debug: {
playbackController: true,
qualityController: true,
stageController: true
}
}
};
/*
* Initialize the Player Core instance with the provided configuration
*/
const storm = stormPlayerCore(streamConfig);
Description of Fields and Parameters
| Parameter name | Parameter type | Required | Default | Description |
|---|---|---|---|---|
autoConnect | boolean | No | true | Defines whether the player should automatically connect to a server upon creation. This will allow for listening to changes in the status of a selected stream. If this option is set to false, a connection will be established when the play or subscribe methods are used. |
autoStart | boolean | No | false | Defines whether the stream playback should start immediately after the Storm JS Player Core object is created. If autoStart is set to true video element will be muted by default. |
restartOnError | boolean | No | false | If set to true, Storm JS Player Core will attempt to restart in case of a player error. |
reconnectTime | number | No | 1.0 | Specifies the delay that should occur when trying to connect to the next server instance (if a connection fails). |
enabledProtocols | Array (string) | No | Storm, HLS | A list of protocols that Storm JS Player Core should support (depending on the sources). Possible values are "Storm", "HLS". |
buffer | Object | No | See Buffer Configuration | A group of settings related to video buffering. The entire configuration is described in the Buffer Configuration. |
video | Object | Yes for Storm JS Player Core, No for Storm JS Player UI | See Video Configuration | A group of settings related to the video object. The entire configuration is described in the Video Configuration. |
audio | Object | No | See Audio Configuration | A group of settings related to audio volume. The entire configuration is described in the Audio Configuration. |
quality | Object | No | See Quality Configuration | A group of settings related to video quality and its management. The entire configuration is described in the Quality Configuration. |
storage | Object | No | See Storage Configuration | A group of settings related to storing viewer's preferences and capabilities. The entire configuration is described in the Storage Configuration. |
debug | Object | No | See Debug Configuration | A group of settings related to debugging. The entire configuration is described in the Debug Configuration. |
Next Step
For the next step please check our Storm JS Player Core Video Settings guide where you'll learn about controlling video element.