Basic Settings - Storm JavaScript Library

In this guide, you will get to know all the basic configuration options and parameters that stormLibrary can accept. More advanced options and parameters can be found under Advanced Settings tab.

Basic 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 instance with the provided configuration
*/
const storm = stormLibrary(streamConfig);
                    

Description of Fields and Parameters

Parameter name Parameter type Required Default Description
autoConnect boolean No true Defines whether the library 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 stormLibrary object is created. If autoStart is set to true video element will be muted by default.
restartOnError boolean No false If set to true, stormLibrary 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 stormLibrary should support (depending on the sources). Possible values are "Storm", "HLS".
buffer Object No Please check Buffer Configuration table for more info. A group of settings related to video buffering. The entire configuration is described in the Buffer Configuration.
video Object Yes for StormLibrary, No for StormPlayer Please check Video Configuration table for more info. A group of settings related to the video object. The entire configuration is described in the Video Configuration.
audio Object No Please check Audio Configuration table for more info. A group of settings related to audio volume. The entire configuration is described in the Audio Configuration.
quality Object No Please check Quality Configuration table for more info. A group of settings related to video quality and its management. The entire configuration is described in the Quality Configuration.
storage Object No Please check Storage Configuration table for more info. A group of settings related to storing viewer's preferences and capabilities. The entire configuration is described in the Storage Configuration.
debug Object No Please check Debug Configuration table for more info. A group of settings related to debugging. The entire configuration is described in the Debug Configuration.
Table 1. General Configuration Table.
Next Step

For the next step please check our Storm JavaScript Video Settings guide where you’ll learn about controlling video element.

Support Needed?

Create a free ticket and our support team will provide you necessary assistance.