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: "localhost", port: 80, ssl: false}
        ],
        sourceList: [
            { protocol: "storm", streamName:"test", application:"live"},
        ],
    },
    settings: {
        autoStart: true,
        video: {
            containerID: "videoContainer",
            width: 640,
            height: 360,
        },
    }
}

//This sample uses IIFE embed method. Creating library instance will look slightly different for AMD, UMD or ESM
const storm = stormLibrary(config);
                    

The embedded configuration allows you to specify all data within a JavaScript Object. It's much easier 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: "localhost", application:"live", port: 80, ssl: false},
        ],
        groupName: "test"
    },
    settings: {
        autoStart: true,
        video: {
            containerID: "videoContainer",
            width: 640,
            height: 360,
        },
    }
}

//This sample uses IIFE embed method. Creating library instance will look slightly different for AMD, UMD or ESM
const storm = 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.