Basic explanation - Storm JavaScript Library

In order to feed the player library with settings and video data, a properly formatted config object must be provided to the player. Not all parameters are required. Below you can find a minimalistic approach in two versions depending how data is fed to the player.

Embedded configuration

                        
const config = {
    connectionType:"direct",
    stream: {
        serverList: [
            { host: "yourdomain.com", port: 443, ssl: true}
        ],
        sourceList: [
            { protocol: "storm", streamName:"test", application:"live"},
        ],
    },
    settings: {
        autoStart: true,
        video: {
            containerID: "videoContainer",
            width: 640,
            height: 360,
        },
    }
}

const storm = new StormLibrary(config);
                    

The embedded configuration allows you to specify all data within a JavaScript Object. It's easier, but less powerful approach. If you wish to learn more about this method, please check the section of our guide related to Embedded configuration.

Gateway configuration

                        
const config = {
    connectionType:"gateway",
    stream: {
        gatewayList: [
            { host: "sub1.yourdomain.com", application:"live", port: 443, ssl: true},
        ],
        groupName: "test"
    },
    settings: {
        autoStart: true,
        video: {
            containerID: "videoContainer",
            width: 640,
            height: 360,
        },
    }
}

const storm = new StormLibrary(config);
                    

The gateway configuration automatically provides data related to alternative (backup) servers, sources and their parameters. Thanks to this approach a self-balancing streaming cluster can be created. If wish to learn more about this method, please check the section of our guide related to Gateway configuration. You'll also need to check part related to Server-side Gateway configuration.