Stream & Server Configuration - Storm JavaScript Library

In this guide, you will learn how to properly configure the streamKey and server parameters with the Storm Library. Please also check our guide on Subscribing to a Stream, which explains how the subscription process works and how to use it.

Sample Code

                        
const streamConfig = {
    /*
    * This section contains data related to the connection with the streaming server
    * and the stream key we want to subscribe to. Each field is explained below.
    */
    stream: {
        serverList: [{
            host: "yourdomain.com",
            application: "live",
            port: 443,
            ssl: true
        }],
        streamKey: "test"
    },
    /*
    * This section includes the basic configuration options required for the player to function.
    * You can learn more about these in the Basic & Advanced Settings documentation.
    */
    settings: {
        autoStart: true,
        video: {
            containerID: "videoContainer",
            aspectRatio: "16:9",
            width: "100%"
        },
    }
}

// Initialize the library instance using the provided configuration
const storm = stormLibrary(streamConfig);
                    

Explanation and Description of Individual Fields

Parameter name Parameter type Required Default Description
serverList[host] string Yes - A hostname (or IP address) of a Storm Streaming Server. For Storm Streaming Cloud hostname edge.stormstreaming.com must always be used.
serverList[application] string Yes - A name of an application within the Storm Streaming Server. For Storm Streaming Cloud it's always live.
serverList[port] number No 80 for non-ssl and 443 for ssl To avoid issues with network firewalls, please use 80 for non-ssl connections and 443 for ssl connections.
serverList[isSSL] boolean No true Indicates whether SSL connection should be used or not.
streamKey string No - A stream key for your stream to which the library will automatically try to subscribe. If no stream key is provided, the subscribe method from the API can be used later. You can learn about available APIs from Storm JavaScript Library API page.
Table 1. Server List & StreamKey Configuration Table.

Multiple Server Configuration

It is possible to define several servers in the configuration object as backup.

Example:

                        
serverList: [{
        host: "sub1.yourdomain.com",
        application: "live",
        port: 443,
        ssl: true
    },
    {
        host: "sub2.yourdomain.com",
        application: "live",
        port: 443,
        ssl: true
    },
    {
        host: "sub3.yourdomain.com",
        application: "live",
        port: 443,
        ssl: true
    }
]
                    
Next Step

For the next step please check our Storm JavaScript General Settings guide where you’ll learn about basic library parameters and settings.

Support Needed?

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