Skip to main content

Live replay

Live replay lets your viewers go back in time during a live stream, return to the live edge with one click, and keep watching the recording after the event has ended. It all happens in one player frame: the Live + Replay player detects what is possible and switches on its own.

Use it when viewers join late or want to see a moment again: a goal, a contested bid, a key slide, or the whole event afterwards.

Live replay, recording or continuous recording?​

Live replayOn-Demand RecordingContinuous recording
What you getViewers rewind a running stream and keep watching after it endsOne file per start/stop pair, only the parts you chooseThe whole session, from start to end
Who controls itThe viewer, in the playerYour application (REST calls) or you in the Builder HubThe stream configuration, automatically
Typical useDVR-style rewind, catch-up, post-event viewingGame rounds, highlights, compliance clipsArchive, full-event VOD, backup
OutputHLS (.m3u8) replayOne MP4 file per recordingMP4 files of the whole session
Set up withThe replay job in Live Processing + the Live + Replay playernanoStream Real-Time API or the Builder HubThe rec job in Live Processing
PageThis pageOn-Demand RecordingLive Processing
info

Live replay is not On-Demand Recording. Live replay plays a recording of the whole stream that grows while you are live; On-Demand Recording creates separate files for moments you pick.

How it works​

The Live + Replay player combines two playback engines. Only one is on screen at a time.

ModeEngineWhat it plays
LivenanoStream PlayerThe live edge with ultra-low latency (MOQ or MSE), with ABR across the stream group's renditions
Replayhls.jsThe recording from nanocosmos VOD storage: the growing recording while the stream runs, the finished recording afterwards

Your nanoStream Player configuration (source, playback, style, events) is reused as it is. The player adds the recording and the switching.

At start-up the player checks the live stream and its recording, then picks what to show:

Live streamRecordingThe player showsStatus
runninggrowingLive, with seek bar and back 10 sLive
runningnone yetLive only. The seek bar unlocks once the recording appears.Live (no replay)
endedavailableThe recording, paused, with Watch replayReplay (past session)
endednoneOffline screenOffline

Before you start​

You needDetails
Replay switched onThe stream needs the replay job of Live Processing, with a duration up to the entire stream. Switch it on as shown in Set it up. See Live Processing.
A stream group or stream nameThe player takes a stream group ID or stream name, like the nanoStream Player.

Replay needs a recording of the stream, made by Live Processing. Without it, the player still plays live, just without the seek bar.

Set it up​

Replay is switched on per stream, before you go live. Changes apply the next time the stream goes live.

Who can use it: guests see the demo; free accounts get the demo and replay on their own streams; existing customers get replay on their own streams when it's on for their organisation.

You areWhat you get
GuestThe Live & Replay Player demo under Demos › Stream.
Free accountThe demo, and replay on your own streams.
Existing customerReplay on your own streams when it's on for your organisation. The account menu lists Replay as On or Off.

Watch the demo:

  1. Open builder.nanocosmos.net and choose Demos › Stream › Live & Replay Player. No stream, encoder or account needed.
  2. The player starts at the live edge.
  3. Drag the timeline back to rewind. The stream keeps running live in the background.
  4. Player Info shows whether you're watching live or replay. Click once to jump back to live.

Learn how it works in the toolbar sums up what to look for. As a guest, it ends with Start For Free →; signed in, with Record your own stream →, which opens Record on demand.

Use replay on your own streams. Two tools switch replay on for the stream they create:

ToolHow replay is setWhat you get
Go Live Workflow (free account or your login)The Live Replay step, on by default for a new stream. It only shows when your organisation has live replay.After you stop your encoder, Watch Replay and Copy Replay link appear about 1–2 minutes later.
Instant Live Stream (guests too)Live Processing: replay, on by defaultViewers can rewind while you're live; the Embed code is the player with rewind.
  1. Sign in, open Build › Stream › Go Live Workflow, and pick or create a stream.
  2. Leave Live Replay on.
  3. Go live from your encoder, watch the stream, and stop when you're done.
  4. Wait for Watch Replay, then share it with Copy Replay link.

What you get: a player that plays live and lets viewers rewind without leaving the page; after the stream ends, the same player keeps playing the recording. To put it on your own website, see Add the player to your page.

Add the player to your page​

Load the nanoStream Player, hls.js and the Live + Replay script, then create the player with your usual player configuration plus a replay block:

<script src="https://demo.nanocosmos.de/nanoplayer/api/release/nanoplayer.5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@1.7.3/dist/hls.min.js"></script>
<script src="https://demo.nanocosmos.de/nanoplayer/live-plus-replay/1/live-replay.min.js"></script>

<div id="player"></div>

<script>
new LiveReplay.LiveReplayPlayer('player').setup({
source : { group: { id: '<STREAM_GROUP_ID_OR_STREAM_NAME>' } }, // your player config
style : { seekBarLiveColor: '#e5883c', seekBarReplayColor: '#408bc3' },
events : { onPlay (e) { console.log('playing', e.data.mode); } },
replay : { baseUrl: 'https://bintu-vod.nanocosmos.de/vod/replay/' } // adds replay
});
</script>

For a secure stream, add the playback token as in any player config: source.group.security.jwtoken. See Playback tokens.

The player has the usual methods: play(), pause(), goLive(), goReplay(fraction), skipBack(seconds), setVolume(v), toggleMute(), destroy().

tip

Set layout: 'fill' to make the player fill its container, for example inside an iframe.

What viewers can do​

  • Rewind: drag back on the seek bar, or press back 10 s. The player switches from live to the recording at that point.
  • Return to live: click the Live badge, or drag the seek bar to its end. Playback resumes at the live edge in the quality the viewer was watching.
  • Stream ends during live viewing: the player moves to the recording, paused, with Watch replay. Without a recording it shows the offline screen.
  • Stream starts again during replay: a Live badge (or Back to Live on the offline screen) appears. The player never pulls a viewer out of a recording on its own.

Controls​

The control bar is the nanoStream Player's, with additions for replay:

nanoStream Player control bar with play/pause, volume, seek bar, a back-10-seconds button and the Live badge
The seek bar, the back-10-seconds button and the Live badge are what live replay adds to the player.
ControlBehaviour
Seek barShown once a recording exists. Releasing in the last 1 % goes back to live. Arrow keys move 2 %, Home and End jump to start and live.
Back 10 sLeft of the Live badge. On the recording it goes back 10 s (or to the start). From live it switches to the recording 10 s before its end.
Live badgeHighlighted while live. On the recording of a running stream it is dimmed and takes you back to live. Hidden after the stream ends.
TimePosition in the recording. Hidden at the live edge.
Centre buttonPlay when paused, Watch replay at the end of a recording or after an automatic switch to it.

Recording timing​

The recording is written in segments, so its newest part trails the live edge by about one segment.

  • From live, back 10 s lands about 15–20 seconds behind live.
  • On the seek bar the smallest step is 1 % of the recording: 6 s on 10 minutes, 36 s on an hour. Use back 10 s for precise steps on long recordings.
  • A new stream has no recording for its first 10–16 seconds. The player checks again after 12, 36 and 84 seconds and unlocks the seek bar once the recording is there.

Styling​

The player reads the nanoStream Player's colour options, so one style block colours both modes. Any CSS colour works.

OptionDefaultColours
symbolColorrgba(244,233,233,1)Icons, time, Live badge
controlBarColorrgba(0,0,0,0.5)The control bar
backgroundColorblackFrame and offline screen
fullScreenBackgroundColoras backgroundColorThe frame in fullscreen
seekBarLiveColor#e5883cSeek bar and handle at the live edge
seekBarReplayColor#408bc3Seek bar and handle on the recording

The older seekBarColor still works and colours both modes.

Events​

Events have the nanoStream Player's shape, { name, player, data }, from two blocks:

  • events: your nanoStream Player events, in both modes. On the recording, onPlay, onPause, onStartBuffering, onStopBuffering, onVolumeChange, onMute, onUnmute and onError come from the replay video. Every data carries mode: 'live' | 'replay'.
  • liveReplayEvents: events only this player knows: onModeChange, onAvailabilityChange, onLiveAvailable, onReplayAvailable, onCurrencyChange, onTransition, onOffline, onReplayPrompt, onFault, onStreamName, onQualityChange. Each fires only when its value changes.

Good to know​

  • Autoplay: when the browser blocks playback with sound, the player starts muted and the mute icon shows it. Automatic switches (stream ended, access denied) land paused with Watch replay.
  • Back to live is faster on MOQ: with MOQ the live player only pauses while the viewer watches the recording, so it resumes at once. With MSE it restarts.
  • Errors: a panel names the kind of error (player, network, security, switch) with a short hint.
  • Captions: with AI Live Captions turned on, the same recording has caption files for every language.

What can go wrong​

ProblemWhat to do
No seek bar on your own streamReplay isn't on for the stream or organisation. In the Builder Hub, check Replay in the account menu; on Off, contact support. A new stream also has no recording for its first 10–16 seconds.
No Live Replay step in the Go Live WorkflowLive replay isn't on for your organisation. Contact support.
No replay after the streamReplay was off for that run, or the replay is still being prepared. Wait 1–2 minutes.
You only see the demo in the Builder HubYou're a guest. Create a free account to use replay on your own streams.
You wanted separate clips of key momentsThat's On-Demand Recording. In the Builder Hub, open Record on demand.

Next steps​

tip

Try it in the Builder Hub: open Demos › Stream › Live & Replay Player to rewind a live sample stream, no account needed. Start for Free