Stream & Server Configuration - Storm JS Player Core
In this guide, you will learn how to properly configure the streamKey and server parameters with the Storm JS Player Core. Please also check our guide on Subscribing to a Stream, which explains how the subscription process works and how to use it.
Sample Code
Sample Code
const streamConfig = {
/*
* This section contains data related to the connection with the streaming server
* and the stream key we want to subscribe to. Each field is explained below.
*/
stream: {
serverList: [{
host: "yourdomain.com",
application: "live",
port: 443,
ssl: true
}],
streamKey: "test"
},
/*
* This section includes the basic configuration options required for the player to function.
* You can learn more about these in the Basic & Advanced Settings documentation.
*/
settings: {
autoStart: true,
video: {
containerID: "videoContainer",
aspectRatio: "16:9",
width: "100%"
},
}
}
// Initialize the Player Core instance using the provided configuration
const storm = stormPlayerCore(streamConfig);
Explanation and Description of Individual Fields
| 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 | No | - | A stream key for your stream to which the player 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 JS Player Core API page. |
Multiple Server Configuration
It is possible to define several servers in the configuration object as backup.
Multiple servers
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 JS Player Core Basic Settings guide where you'll learn about basic library parameters and settings.