Stream & Server Configuration - Storm JavaScript Player

In this guide, you will learn how to properly configure the server and stream data in the Storm JavaScript Player.

Code Example

                        
/**
 * Standard stream configuration object
 */
const streamConfig = {
    stream: {
        serverList: [{
            host: "localhost",
            application: "live",
            port: 80,
            ssl: false
        }],
        streamKey: "test"
    },
};

/**
 * Standard player configuration object
 */
const playerConfig = {
    containerID: "container",
    width: "100%",
    height: "100%",
    aspectRatio: "16:9",
    title: "My first broadcast",
    subtitle: "Epic live streaming",
};

/**
 * Each player instance must be provided with both player (gui) and library configs
 */
const player = stormPlayer(playerConfig, streamConfig);
                    

Two Configuration Objects

The configuration of the Storm JavaScript Player is based on two objects. The first, called streamConfig, is identical to that from StormLibrary and contains server data we need to connect to, as well as the stream identifier (streamKey) that we want to play. Here, we can also define our video settings, autostart, or buffers. The only difference is that we do not provide the containerID parameter (this will be handled by the player itself). To learn all available options, we encourage you to check the Storm JavaScript Library documentation.

The second configuration object, namely playerConfig, specifically pertains to the player itself and allows for the definition of its size, title, or description. Settings related to the Waiting-Room, Styles, or Translations are also defined in this object.

Stream Configuration Object

                        
const streamConfig = {
    stream: {
        serverList: [{
            host: "localhost",
            application: "live",
            port: 80,
            ssl: false
        }],
        streamKey: "test"
    },
};
                    

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.
streamKeystringyes-A streamKey of your stream. Usually it represents a group of related streams (via transcoding).
Table 1. Server List & StreamKey Configuration Table.
Next Step

For the next step please check our Storm JavaScript Player - General Settings guide where you’ll learn about basic player settings.

Support Needed?

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