Configure Flowplayer for secure RTMP playback

When using SSL/TLS certificates, RTMP-based players must be configured to connect to Wowza Streaming Engine over an SSL/TLS connection. If a player encounters a URL with an RTMPS URL prefix (rtmps://) and it's not configured correctly, the connection may fail and the player may fall back to use the RTMPT protocol (RTMP tunneling via HTTP) over SSL/TLS (RTMPTS). RTMPTS is much less efficient than RTMPS and can cause Wowza Streaming Engine to consume a lot of the computer's CPU resources. For this reason, it's important to properly configure client applications to connect to Wowza Streaming Engine using RTMPS.

The following example shows how to configure RTMP streaming over SSL/TLS (RTMPS) with Flowplayer. Flowplayer is an open source Flash-based player. To configure Flowplayer applications to connect to Wowza Streaming Engine using RTMPS, do the following:

  1. Download Flowplayer Flash and extract the contents from the downloaded compressed (zipped) file.
     
  2. Download the RTMP Streaming Plugin (.swf) and copy it to the unzipped Flowplayer folder. (Be sure to copy it to the inner flowplayer folder that contains the flowplayer-3.x.x.swf file.)
     
  3. Edit the flowplayer/example/index.html file in the root directory of the unzipped archive, and make the following changes to the <script> section to enable RTMPS playback for either video on-demand or live streaming:
    • Live streaming

      Change:

      <script>
          flowplayer("player", "../flowplayer-3.2.15.swf",
      </script>

      To:

      <script type="text/javascript">
        flowplayer("player", "../flowplayer-3.x.x.swf",
          {
            clip: {
            url: 'myStream',
            live: true,
            provider: 'rtmp'
          },
          plugins: {
            rtmp: {
            url: '../flowplayer.rtmp-3.2.11.swf',
            proxyType: 'best',
            netConnectionUrl: 'rtmps://[ssl-certificate-domain-name]/[application]'
            }
          }
        }
      );
      </script>
    • Video-on-demand streaming

      Change:

      <script>
      flowplayer("player", "../flowplayer-3.2.15.swf");
      </script>

      To:

      <script type="text/javascript">
        flowplayer("player", "../flowplayer-3.2.15.swf",
          {
            clip: {
              url: 'mp4:sample.mp4',
              provider: 'rtmp'
            },
            plugins: {
              rtmp: {
              url: '../flowplayer.rtmp-3.2.11.swf',
                proxyType: 'best',
                netConnectionUrl: 'rtmps://[ssl-certificate-domain-name]/[application]'
              }
            }
          }
        );
      </script>

Where:

  • flowplayer() includes the relative path to the Flowplayer .swf file in the flowplayer/example folder (flowplayer-3.2.15.swf). Make sure this file name matches the version in your example folder.
     
  • clip: url is the stream name of the live stream (myStream) or name of the sample video that ships with Wowza Streaming Engine (mp4:sample.mp4).
  • clip: live is set to true (only for live streaming). This property setting enables Flowplayer to stream live video data from an RTMP streaming server.
     
  • plugins: url is the relative path to the RTMP Streaming Plugin (.swf) file that you copied to the flowplayer/example folder (flowplayer.rtmp-3.2.11.swf). Make sure this file name matches the version in your example folder.
     
  • plugins: proxyType is set to 'best'. This property setting enables Flowplayer to connect to Wowza Streaming Engine over a native SSL/TLS connection.
     
  • plugins: netConnectionUrl is the RTMPS URI to an application ([application]) on your Wowza Streaming Engine, where [ssl-certificate-domain-name] is the SSL/TLS certificate domain or hostname, for example 5ab4321c0d123.streamlock.net.
  • flowplayer() includes the relative path to the Flowplayer .swf file in the flowplayer/example folder (flowplayer-3.2.15.swf). Make sure this file name matches the version in your example folder.
     
Notes:
  • For StreamLock SSL/TLS certificates, you can get the [ssl-certificate-domain-name] from the StreamLock tab on the Account Management page of your Wowza account. You can also get the [ssl-certificate-domain-name] from the default file name for the downloaded SSL/TLS certificate (.jks) file, which is in the format [ssl-certificate-domain-name].jks.
     
  • If you configure any port other than 443 as secure (for example, port 1935), you must include the port value in the netConnectionUrl property value. For example:
    netConnectionUrl: 'rtmps://[ssl-certificate-domain-name]:1935/[application]'

Playback

To test RTMPS playback using Flowplayer, copy the flowplayer folder to a web server and then open the following URL in a web browser:
 
http://[web-server-address]/flowplayer/example/index.html

More resources