JWPlayer Integration with Storm Streaming Server
JWPlayer is one of the oldest and most popular video players for websites. The vast number of plugins and configuration options makes it a great choice To properly configure JWPlayer for work, it is necessary to select the HLS mode and define the link to the m3u8 file.
Embed Code
Make sure you to include JWPlayer library in your code (self-hosted or some CDN-based):
<script src="//{YOUR_CDN_URL_FOR_JWPLAYER_JS_FILE_GOES_HERE}/jwplayer.js"></script>
The basic JWPlayer configuration looks as follows:
<div id="myElement"></div>
<script>
jwplayer("myElement").setup({
"playlist": [
{
"sources": [
{
"default": false,
"type": "hls",
"file": "https://${SERVER_HOST}/${APP_NAME}/${STREAM_KEY}.m3u8",
"label": "0",
"preload": "metadata"
}
]
}
],
"primary": "html5",
"hlshtml": true
});
</script>
Main Parameters Explanation
sources: type | This value must be set to “hls”. |
---|
sources: file | Path to m3u8 file related to the stream. URL will always match the following pattern:
https://${SERVER_HOST}/${APP_NAME}/${STREAM_KEY}.m3u8
where:
${SERVER_HOST} | Hostname or IP Address for the Storm Streaming Server (vHost with HTTP protocol enabled). |
---|
${APP_NAME} | Application name for the Storm Streaming Server. By default, it's called "live". |
---|
${STREAM_KEY} | Stream key for the video. |
---|
|
---|
Table 1. Main parameters table
Adaptive Bitrate Streaming (ABR)
To use the Adaptive Bitrate Streaming (ABR) feature, it is necessary to activate and configure the transcoding option. For Storm Streaming Server, it is necessary to have a commercial license and set up Transcoding in a given application. Detailed information can be found in our Transcoding guide.
Differences Between JWPlayer & Storm Library/Player
JWPlayer and our dedicated Storm Library/Player work in different ways. JWPlayer will not react to stream state changes (published, unpublished). It also will not update its data on the fly. It's on a developer to add this functionality.