Quality Settings - Storm JavaScript Library

In this guide, you will get to know all the configuration options for controlling quality in the library.

Sample Code

                        
const streamConfig = {
    stream: {
      ... // stream configuration
    },
    settings: {
        ... // basic configuration
        quality: {
            controlMode: "RESOLUTION_AWARE",
            initialUpgradeTimeout: 30,
            maxUpgradeTimeout: 3600
        }
    }
};
                    

Description of Fields and Parameters

Parameter name Parameter type Required Default Description
controlMode string No "RESOLUTION_AWARE" This is a quality control mode. Each mode selects the stream quality differently based on the available parameters. A full list of available modes along with their descriptions can be found below.
initialUpgradeTimeout number No 30 This parameter defines the time interval (in seconds) between successive attempts to change the quality.
maxUpgradeTimeout number No 3600 This parameter defines the maximum time interval (in seconds) allowed between quality change attempts.
Table 1. Quality Configuration Table.

Quality Control Modes

Mode name Description
RESOLUTION_AWARE The quality will be selected based on the dimensions of the library window and the available video qualities. The substream offering the resolution closest to those dimensions will be selected as the primary one.
PASSIVE The quality will be selected based on previously saved preferences determined by the RESOLUTION_AWARE mode. If the library was previously initialized in RESOLUTION_AWARE mode, the quality preferences will be stored and this mode will restore them without re-running the analysis. This mode is well-suited for use with a thumbnail that can later be replaced by a fully-featured player.
HIGHEST_QUALITY The substream offering the highest quality (resolution) will always be selected as the primary one.
LOWEST_QUALITY The substream offering the lowest quality (resolution) will always be selected as the primary one.
Table 2. Quality Control Modes Table.
Next Step

For the next step please check our Storm JavaScript Library Storage Settings guide where you’ll learn about how to configure storage options.

Support Needed?

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