Tech

Playback

Let's say your stream has already reached the Media Server. Whether it was ingested via WebRTC, RTMP, RTSP, or another supported protocol doesn't really matter.

Now comes the interesting part: how do you play it?

We've brought together all the available playback methods in one place.

Some of them, like HLS and WebRTC, may already be familiar to you. Others deserve a closer look.

Ellis leaning on a video player.

WebRTC

WebRTC is the fastest way to watch a stream: sub-second latency in any modern browser and in mobile apps. The player opens its own WebRTC connection with the Media Server and starts playback with a stream.play() call in the Web SDK, Android SDK or iOS SDK.

Video comes as H.264 or VP8, audio as Opus or G.711. RTCP feedback keeps delivery tuned to each viewer's network, and the viewer can ask the server for another resolution, bitrate or quality, turn video off, and choose the codecs and the transport.

How playback works, and every control a viewer has, is covered on the WebRTC live streaming page.

Explore WebRTC live streaming page

HLS

HLS needs no SDK at all. The player requests the M3U8 playlist by its URL and downloads the segments over plain HTTP, so any HLS player on any device can watch the stream, and any CDN can cache it.

The price is latency: 10–30 seconds with whole segments, 2–3 seconds with Low Latency HLS. Add ABR, and the player switches between several qualities as its network changes.

The four ways to combine them, and the players to use, are covered on the HTTP live streaming page.

Explore HTTP live streaming page

MSE

Media Source Extensions (MSE) is a browser API that lets a page feed audio and video into an ordinary video element. Unlike WebRTC, which both publishes and plays in real time, MSE only plays. It fits when a stream just needs to be shown on a page and latency is not critical.

A developer holding up a screen with a play button.

The Web SDK does the work: the browser connects to the Media Server over WebSocket, calls the same stream.play() and receives the stream as H.264 video and AAC audio over that WebSocket connection, then hands it to MSE. All you change is the media provider: MSE instead of WebRTC.

MSE plays in Chrome, Firefox and Edge on Windows, macOS and Android, and in Safari on macOS, but not on the iPhone, where WebRTC or HLS takes its place. With many viewers, the server sends frames in packets of several at once to keep its CPU load down; larger packets mean less load and a little more latency.

MSE live streaming demo

No setup, no installation. Press Play and watch a live stream delivered from the Media Server over MSE: the browser receives H.264 video and AAC audio over a WebSocket connection and plays them in an ordinary video element.

Try Live Demo↗

Explore documentation↗

RTSP

Any stream on the Media Server can also be played over RTSP: in a third-party player such as VLC, or by any software that understands RTSP. In this case the Media Server itself acts as an RTSP source, just like an IP camera.

The URL is simply the server address and the stream name, for example rtsp://media.example.com:554/stream1. By default the server listens for RTSP on TCP port 554. Video goes out as H.264, VP8 or H.265, audio as AAC, G.711 or Speex.

rtsp://media.example.com/stream1

Playback can be protected. With RTSP authentication turned on, the server asks your backend through a REST hook before every RTSP request and lets the player in only if the backend answers 200 OK, so you can check the URL, a token in it, the player or its address.

Explore documentation↗

RTMP

RTMP works the same way. Any stream on the Media Server can be played in a third-party player that speaks RTMP, such as VLC, and the Media Server itself acts as an RTMP source.

The URL contains the application name and the stream name, for example rtmp://media.example.com:1935/live/stream1. Video goes out as H.264, audio as AAC, G.711 or Speex.

rtmp://media.example.com/live/stream1

Parameters added to the URL are passed to your backend in REST hooks, which is a simple way to authenticate a viewer before playback starts.

Explore documentation↗

Launch your streaming server

LLcast will deploy a dedicated Media Server just for you. Publish a stream once over WebRTC, RTMP, SRT or RTSP, and play it any way you need: WebRTC with full control over video and audio, HLS with or without low latency and ABR, MSE right in the browser, RTSP and RTMP in third-party players.