For the next step please check our Storm JavaScript Library - Stream & Server guide where you’ll learn how to connect library with Storm Streaming Cloud or Server instance.
Storm JavaScript Library can be easily installed using popular package managers like npm and yarn. You can also attach js file from our CDN. Below you'll find more detailed instructions.
Feel free to pick our Storm Library (in IIFE format) from our CDN:
<script src="https://cdn-scripts.stormstreaming.com/stormlibrary/5-latest.min.js"></script>
Optionally you can link to the latest major.minor, for example 5.0-latest.min.js, or pick specific release: 5.0.0.min.js
To integrate Storm Library into your project using NPM, execute the following command:
npm install @stormstreaming/stormlibrary
To incorporate Storm Library into your project using Yarn, execute the following command:
yarn add @stormstreaming/stormlibrary
You can manually grab index.js from /dist/iife folder on our Git-Hub page. You will find the latest release here: https://github.com/StormStreaming/stormlibrary-js/releases.
Storm Library comes in IIFE, ESM, AMD, UMD and CJS formats. If you are unfamiliar with these, please grab IIFE version, as it's easiest to embed in a modern browser. All packages are located in /dist folder under their respective names.
Once the library is properly linked to your page, an instance can be finally created. Please keep in mind that you can create and manage multiple instances of Storm Library at a time. Each instance requires a valid configuration object in order to work properly. Initialization will look different depending on picked JavaScript format.
const streamConfig = {
stream: {
serverList: [{
host: "localhost", // Host or IP address of the Storm Streaming Server/Cloud
application: "live", // Application name on the Storm Streaming Server/Cloud
port: 80, // Port used by the Storm Streaming Server/Cloud
ssl: false // Whether to use an SSL or non-SSL connection
}],
streamKey: "test" // StreamKey we want to connect to
},
settings: {
autoStart: true, // Whether the stream should start automatically
video: {
containerID: "videoContainer", // Element ID of the parent container
width: "100%", // Initial width of the player
aspectRatio: "16:9" // Enforced aspect ratio
},
},
};
Initialization will look different depending on picked JavaScript format.
const storm = stormLibrary(streamConfig);
import {StormLibrary} from "../../dist/esm/index.js";
const storm = new StormLibrary(streamConfig);
const storm = stormLibrary.create(streamConfig);
requirejs(['../../dist/amd/index'], function (storm) {
const stormInstance = new storm.create(streamConfig);
});
Create a free ticket and our support team will provide you necessary assistance.