Embedded configuration - Storm Library

In this approach, all data related to the streaming server (or servers) and stream source (or sources) must be provided inside the configuration object. It is the simplest method, but it does not offer load-balancing functionality.

                                
connectionType:"direct",
stream: {
    serverList: [
        { host: "yourdomain.com", application:"live", port: 443, ssl: true}
    ],
    sourceList: [
        { protocol: "storm", streamName:"test", application:"live"},
    ],
},
                            

serverList parameter

Parameter nameParameter typeRequiredDefaultDescription
hoststringyes-A host name of a storm server. Since most browsers require SSL for WebSocket connection, you shouldn't provide an IP address.
applicationstringyes-A name of an application within the storm server. Applications are separate blocks of stream groups. A stream name must be unique within such a group, but you can create multiple groups.
portnumberno80 for non-ssl and 443 for sslTo avoid issues with network firewalls, please use 80 for non-ssl connections and 443 for ssl connections.
sslbooleanyes-Whenever SSL connection should be used or not.
Table 1. serverList

serverList parameter (multiple servers)

You can add multiple servers to the serverList array. If one of these fails – another one will be used instead. Each time the player fails to connect to a given server playerConnectionFailed event will be fired. If all servers fail (or the last one), onAllServersFailed will be called after that.

                                
connectionType:"direct",
stream: {
    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}
    ],
    sourceList: [
        { protocol: "storm", streamName:"test", application:"live"},
    ],
},
                            

sourceList parameter

Parameter nameParameter typeRequiredDefaultDescription
protocolstringyes-Available protocols: RTMP, STORM, WEBRTC
applicationstringyes-A name of an application within a server
streamNamestringyes-Name of a stream
streamInfoObjectno-An object containing stream data
Table 2. sourceList

streamInfo parameter

Parameter nameParameter typeRequiredDefaultDescription
labelstringyes-It can be called accordingly to its resolution or quality, e.g., "high", "720p"
widthnumberno-A width of a video source
heightnumberno-A height of a video source
fpsnumberno-Number of frames per second (fps)
bitratenumberno-A video bitrate (this information will be used for Adaptive-Bitrate functionality)
Table 3. streamInfo

Sample:

                                
connectionType:"direct",
stream: {
    serverList: [
        { host: "sub1.yourdomain.com", application:"live", port: 443, ssl: true},
    ],
    sourceList: [
        { protocol: "storm", streamName:"test", application:"live", streamInfo: {label:"720p", width: 1280, height: 720, fps:30, bitrate: 2500}}
    ],
},
                            

sourceList parameter (multiple sources)

More than a single source can be added to the player. If streamInfo (label, width, height, fps, bandwidth) data are the same on two or more sources player will use the remaining ones as a backup.

                                
connectionType:"direct",
stream: {
    serverList: [
        { host: "sub1.yourdomain.com", application:"live", port: 443, ssl: true},
    ],
    sourceList: [
        { protocol: "storm", streamName:"test_720p", application:"live", streamInfo: {label:"720p", width: 1280, height: 720, fps:30, bitrate: 2500}},
        { protocol: "storm", streamName:"test_1080p", application:"live", streamInfo: {label:"1080p", width: 1920, height: 1080, fps:30, bitrate: 3500}},
        { protocol: "storm", streamName:"test_4k", application:"live", streamInfo: {label:"4k", width: 3840, height: 2160, fps:30, bitrate: 14000}},
    ],
},
                            
                                
connectionType:"direct",
stream: {
    serverList: [
        { host: "sub1.yourdomain.com", application:"live", port: 443, ssl: true},
    ],
    sourceList: [
        { protocol: "storm", streamName:"test_720p", application:"live", streamInfo: {label:"720p", width: 1280, height: 720, fps:30, bitrate: 2500}},
        { protocol: "storm", streamName:"test_copy", application:"live", streamInfo: {label:"720p", width: 1280, height: 720, fps:30, bitrate: 2500}},
    ],
},