Real-time streaming

The Real-Time Streaming (RTS) plugin adds the ability to consume Wowza Video Real-Time Streaming at Scale (RTS@S) streams, Wowza Video WebRTC streams, and Wowza Streaming Engine WebRTC streams.

Installation

Include the rts plugin next to the core player:

<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/rts.min.js"></script>

Configuration

The RTS plugin is a Loader plugin which means it will add a special handler for the source types it handles. Configuration depends on your stream type. See the configuration examples in the following sections.

Wowza Video™ Real-Time Streaming at Scale

If you configure a src with type: "wowza/rts", the RTS plugin connects to Wowza's RTS@S backend and consumes the stream that you configure it to show.

In addition to type, you also need to configure streamName. You will use the Stream Name that you entered when you created the real-time stream in Wowza Video, either through the API or in the UI.

The subscriberToken is an optional parameter. If you set a Playback Token by enabling stream security in the RTS@S Wowza Video configuration, you would add it as the subscriberToken.

Example

flowplayer("#player", {
  src: {
    type: "wowza/rts",
    streamName: "<streamName>",
    subscriberToken: "<your playback token>"
   },
  token: "<your player token>"
})

Wowza Streaming Engine WebRTC

You can use WebRTC with Wowza Streaming Engine through the UI. If you configure a src with type: "wowza/webrtc", the RTS plugin will connect to the Wowza Streaming Engine instance of your choice. You need to tell the player where your WSE instance is hosted and which stream to choose.

The player supports two connection methods: classic WebSocket signaling, and WHEP (WebRTC-HTTP Egress Protocol), a standardized HTTP-based method supported by WSE 4.10 and later.

WHEP is the recommended connection method for WSE 4.10 and later. It uses standard HTTP rather than a WebSocket, which makes it easier to use through firewalls and proxies. Use WebSocket signaling if you are on WSE 4.9 or earlier.

Common properties

These properties apply to both WebSocket and WHEP connections.

Property Type Required Description
type "wowza/webrtc" Yes Identifies this as a Wowza WebRTC source.
sdpUrl string Yes For WebSocket signaling: the full WSS endpoint, e.g. wss://[your-streamlock-domain].streamlock.net/webrtc-session.json. For WHEP: the HTTP base URL, e.g. https://[your-streamlock-domain].streamlock.net/ — the player appends /{applicationName}/{streamName}/whep automatically.
applicationName string Yes The name of the application you set up in Wowza Streaming Engine for WebRTC streams.
streamName string Yes The stream name from the Incoming Streams page for the application in Wowza Streaming Engine.
useWhep boolean No Set to true to use WHEP instead of WebSocket signaling. Requires WSE 4.10 or later. Defaults to false.
stunServerURL string No Comma-separated list of STUN server URLs, e.g. "stun:stun.example.com:3478, stun:stun2.example.com:3478". Used to establish connectivity when the viewer is behind NAT.
turnServerURL string No Comma-separated list of TURN server URLs, e.g. "turn:turn.example.com:3478". Used as a relay fallback when STUN is not sufficient (e.g. strict firewalls).
turnUsername string No Username for TURN server authentication.
turnPassword string No Password for TURN server authentication.

If your viewers are on the same local network as your WSE server, STUN/TURN configuration is not required. For internet deployments where viewers may be behind strict NAT or corporate firewalls, configuring a STUN server (and optionally a TURN relay) is recommended.

WHEP-only properties

Only valid when useWhep: true.

Property Type Required Description
authToken string No Bearer token sent as Authorization: Bearer <token> on all WHEP requests. Use this if your WSE application has WHEP authorization enabled.

WebSocket-only properties

Only valid when useWhep is false or not set.

Property Type Required Description
secureToken object No Pre-computed WSE SecureToken for stream access control. The object must have the shape { hash: string, starttime: string, endtime: string }. See the notice below.
useV2Signaling boolean No Set to true to use the WSE v2 WebSocket signaling protocol (client creates the offer, trickle ICE both ways) instead of the classic protocol (server creates the offer, bundled ICE candidates). Requires WSE 4.10+, and the server must actually be configured to accept it — this is set per VHost in VHost.xml (legacy, v2, or dynamic). On a server upgraded in place without v2 enabled, setting this to true fails after a few seconds with a "Timed out waiting for stream" error rather than connecting. Defaults to false (classic protocol), which works everywhere. Only set to true for a specific, confirmed reason (e.g. the server's advertised ICE candidate isn't reachable by the browser) and after confirming with the server operator that v2 is enabled. This option applies to Wowza Streaming Engine only — see the warning in the Wowza Video WebRTC section below.

The Signaling URL (SDP URL) contains your streamlock domain, which can be found as part of your SSL certificate name. The Application Name is the name of the application you set up in Wowza Streaming Engine for WebRTC streams. The Stream Name can be found in the Incoming Streams subsection under the application you created for the stream. secureToken refers to the optional SecureToken available in Wowza Streaming Engine. Always generate SecureToken values on your server — never include the shared secret in client-side JavaScript, as it would be visible to anyone who opens browser DevTools.

The token: string field that appeared in previous versions of this documentation has been removed. It was never functional and should not be used. For WSE SecureToken authentication, use the secureToken object described above.

Example: WebSocket (default, WSE 4.9 and earlier compatible)

flowplayer("#player", {
  src: {
    type: "wowza/webrtc",
    sdpUrl: "wss://[your-streamlock-domain].streamlock.net/webrtc-session.json",
    applicationName: "webrtc",
    streamName: "myStream"
  },
  token: "<your player token>"
})

Example: WHEP (WSE 4.10+)

flowplayer("#player", {
  src: {
    type: "wowza/webrtc",
    sdpUrl: "https://[your-streamlock-domain].streamlock.net",
    applicationName: "webrtc",
    streamName: "myStream",
    useWhep: true,
    authToken: "[your-whep-auth-token]" // optional
  },
  token: "<your player token>"
})

Example: with ICE servers (any connection method)

flowplayer("#player", {
  src: {
    type: "wowza/webrtc",
    sdpUrl: "wss://[your-streamlock-domain].streamlock.net/webrtc-session.json",
    applicationName: "webrtc",
    streamName: "myStream",
    stunServerURL: "stun:stun.example.com:3478",
    turnServerURL: "turn:turn.example.com:3478",
    turnUsername: "myuser",
    turnPassword: "mypassword"
  },
  token: "<your player token>"
})

Wowza Video WebRTC

WebRTC is also available in Wowza Video. If you configure a src with type: "wowza/webrtc", the RTS plugin connects to the Wowza Video instance backing your livestream. The same ICE server and WHEP properties described above for Wowza Streaming Engine apply here.

Common properties

Property Type Required Description
type "wowza/webrtc" Yes Identifies this as a Wowza WebRTC source.
sdpUrl string Yes For WebSocket: the SDP URL listed on the Overview tab for your WebRTC stream in Wowza Video. For WHEP: the HTTP base URL for your stream.
applicationName string Yes The value from the Application field on the Overview tab for your WebRTC stream in Wowza Video.
streamName string Yes The value from the Stream Name field on the Overview tab for your WebRTC stream in Wowza Video.
useWhep boolean No Set to true to use WHEP instead of WebSocket signaling.
stunServerURL string No Comma-separated list of STUN server URLs.
turnServerURL string No Comma-separated list of TURN server URLs.
turnUsername string No Username for TURN server authentication.
turnPassword string No Password for TURN server authentication.

WHEP-only properties

Property Type Required Description
authToken string No Bearer token sent as Authorization: Bearer <token> on all WHEP requests.

WebSocket-only properties

Property Type Required Description
secureToken object No Pre-computed SecureToken for stream access control. Generate this on your server — never include the shared secret in client-side code. The object must have the shape { hash: string, starttime: string, endtime: string }. See Wowza Video security settings for details.

Wowza Video's WebSocket signaling only ever speaks the classic protocol. Setting useV2Signaling: true against a Wowza Video source does not work — the connection will time out and fail after a few seconds. This property is only meaningful for self-hosted Wowza Streaming Engine 4.10+; leave it unset for Wowza Video.

The token: string field that appeared in previous versions of this documentation has been removed. It was never functional in the player code. There is no replacement — Wowza Video WebRTC token authentication was never implemented.

Wowza RTS@Scale events

Please refer to the RTS events documentation for API event details.

Results