Stream & Server Configuration - Storm JavaScript Library

In this guide, you will learn how to properly configure streamKey and server parameters with Storm Library.

Sample Code

                        
const streamConfig = {
    stream: {
        serverList: [{
            host: "yourdomain.com",         // domain name or ip address
            application: "live",
            port: 443,
            ssl: true
        }],
        streamKey: "test",
    },
    settings: {
        video: {
            containerID: "videoHolder",     // name of the HTML container
            aspectRatio: "16:9",
            width: "100%",
        },
    }
}

const storm = stormLibrary(streamConfig);
                    

Explanation and Description of Individual Fields

Parameter nameParameter typeRequiredDefaultDescription
serverList[host]stringYes-A hostname (or IP address) of a Storm Streaming Server. For Storm Streaming Cloud hostname edge.stormstreaming.com must always be used.
serverList[application]stringYes-A name of an application within the Storm Streaming Server. For Storm Streaming Cloud it's always live.
serverList[port]numberNo80 for non-ssl and 443 for sslTo avoid issues with network firewalls, please use 80 for non-ssl connections and 443 for ssl connections.
serverList[isSSL]booleanNotrueIndicates whether SSL connection should be used or not.
streamKeystringNo-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.