How to use JW Player with adaptive bitrate streaming from Wowza Streaming Engine (MPEG-DASH, HLS, RTMP)

This article describes a technique for generating a client-side SMIL file in Wowza Streaming Engine media server software, which can be used by JW Player's RTMP Dynamic Streaming implementation. JW Player supports loading dynamic streams from a server-side SMIL (Synchronized Multimedia Integration Language) file.

Notes:

  • For use with Wowza Streaming Engine™ 4.7.1 or later and JW Player 6.
  • JW Player is a Works with Wowza™ partner.

Configuration

  1. The proper request filter is built-in with Wowza Streaming Engine software and no further configuration is required for the Wowza media server.
  2. Create a client-side URL for JW player in the following format:
    http://[wowza-ip-address]:1935/[application]/[prefix]:[stream-name]/jwplayer.smil

    For example, if the content folder has a file named sample.smil and video files named sample.mp4 and sample_250.mp4:
    <smil>
         <head>
         </head>
         <body>
              <switch>
                   <video src="mp4:sample_250.mp4" system-bitrate="250000"/>
                   <video src="mp4:sample.mp4" system-bitrate="450000"/>
              </switch>
         </body>
    </smil>
    You can use the following URL:
     
    http://[wowza-ip-address]:1935/vod/smil:sample.smil/jwplayer.smil
     
  3. In your webpage, insert the following embed code at the location where you want the player to appear:
    <script type='text/javascript' src='/jwplayer/jwplayer.js'></script>
    
    <div id='mediaplayer'></div>
    
    <script type="text/javascript">
      jwplayer('mediaplayer').setup({
        'flashplayer': 'player.swf',
        'id': 'playerID',
        'width': '720',
        'height': '306',
        'playlistfile': 'http://[wowza-ip-address]:1935/vod/smil:sample.smil/jwplayer.smil',
        'plugins': {
           'qualitymonitor-2': {}
        }
      });
    </script>
This URL:
 
http://[wowza-ip-address]:1935/vod/smil:sample.smil/jwplayer.smil

Generates this SMIL file:
<smil>
<head>
<meta base="rtmp://localhost:1935/vod/_definst_"/>
</head>
<body>
<switch>
<video src="mp4:sample_250.mp4" system-bitrate="250"/>
<video src="mp4:sample.mp4" system-bitrate="450"/>
</switch>
</body>
</smil>
 

Notes:

  • If you use a streaming port number other than 1935, you must specify the ?domain query parameter and port number at the end of the URL. For example:
     
    http://[wowza-ip-address]/live/smil:sample.smil/jwplayer.smil?domain=my.example.com:80
  • You can also use the technique described in this article if you have a Stream Name Group defined in a Wowza Transcoder template (ngrp: stream name prefix) or a MediaList (amlst: stream name prefix). For example:
     
    http://[wowza-ip-address]:1935/vod/ngrp:myStream_all/jwplayer.smil
     
    http://[wowza-ip-address]:1935/vod/amlst:sample/jwplayer.smil

    For more information about Transcoder Stream Name Groups (NGRP), see How to set up and run Wowza Transcoder for live streaming.

    For more information about how to generate a MediaList (AMLST), see How to use Java API calls to resolve SMIL file requests.

If you're having problems or want to discuss this article, post in our forum.