For the next step please check our Storm JavaScript Player - General Settings guide where you’ll learn about basic player settings.
In this guide, you will learn how to properly configure the server and stream data in the Storm JavaScript Player.
/**
* 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);
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.
const streamConfig = {
stream: {
serverList: [{
host: "localhost",
application: "live",
port: 80,
ssl: false
}],
streamKey: "test"
},
};
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 | yes | - | A streamKey of your stream. Usually it represents a group of related streams (via transcoding). |
Create a free ticket and our support team will provide you necessary assistance.