Migration & legacy versions (v4 → v5)
nanoStream Player version 5 adds MOQ (Media over QUIC) playback and changes several defaults. Most v4 configs keep working, but some behave differently without throwing an error. This page lists every change and gives you a checklist for the upgrade.
Upgrade in four steps
-
Change the script URL from
nanoplayer.4.min.jstonanoplayer.5.min.js:<script src="https://demo.nanocosmos.de/nanoplayer/api/release/nanoplayer.5.min.js"></script> -
Go through Changed defaults and set any value you relied on explicitly.
-
Remove features that no longer exist (see Removed in v5).
-
Test on real devices, with MOQ on and off, and check your error handling and analytics.
Changed defaults
A v4 config that doesn't set these keys behaves differently under v5:
| Key | v4 default | v5 default | Effect |
|---|---|---|---|
playback.latencyControlMode | "classic" | "balancedadaptive" | The player adapts latency to stream and network conditions |
playback.automute | false | true | Blocked unmuted autoplay now falls back to muted playback |
playback.faststart | false | true | Shorter time to first frame |
source.startIndex | 0 (highest quality) | entries.length - 1 (lowest quality) | Multi-entry sources start on the lowest rendition |
source.options.adaption.rule | "none" | "deviationOfMean2" for groups and for 3 or more entries; "none" for 2 entries | ABR is on for groups and for 3 or more entries |
source.options.adaption.downStep | 1 | 2 for 3 or more entries; 1 for 1 or 2 | ABR down-switches skip at least two steps |
source.group.startQuality | — | "low" | Groups start on the lowest rendition |
source.options.switch.timeout | — | 20 seconds (5–30) | Also applies to updateSource() |
To keep v4 behaviour, set the old values explicitly:
var config = {
source: {
entries: [ /* ... */ ],
startIndex: 0,
options: { adaption: { rule: "none" } }
},
playback: {
latencyControlMode: "classic",
automute: false,
faststart: false
}
};
The v5 ABR default depends on the source. Groups and lists of three or more entries use deviationOfMean2. A list of exactly two entries uses none and doesn't switch automatically unless you set the rule. If you depend on a specific behaviour, set options.adaption.rule explicitly.
New in v5
| Key | Default | Description |
|---|---|---|
playback.enableMediaOverQuic | true | MOQ playback, with automatic fallback to WebSocket/MSE |
playback.enableQuicConnectionProbe | true | Tests QUIC connectivity at setup to pick the best technology |
playback.volume | 1.0 | Initial volume, 0.0–1.0 |
playback.manageAudioSessionType | true | Since 5.0.11. iOS audio plays with the silent switch on. |
source.general.baseDomain | — | Since 5.1.0. One root domain for player, API and metrics hosts. |
With source.group, bintu.streamid or defaults.service: "bintu", MOQ works without changes. With custom server URLs, add h5live.server.webtransport to each entry, or MOQ isn't available for that entry:
server: {
websocket: "wss://bintu-h5live.nanocosmos.de:443/h5live/stream/stream.mp4",
hls: "https://bintu-h5live.nanocosmos.de:443/h5live/http/playlist.m3u8",
progressive: "https://bintu-h5live.nanocosmos.de:443/h5live/http/stream.mp4",
webtransport: "https://bintu-h5live.nanocosmos.de:443/h5live/stream/stream.mp4"
}
Canvas instead of video element (MOQ)
MOQ playback renders to a <canvas>, not an HTML5 <video> element. This matters if your code:
- binds the player to an existing video element with
playback.videoId, - reads frames from the video element (snapshots, overlays, effects),
- styles or measures the
<video>element directly.
Your options:
- Disable MOQ with
playback.enableMediaOverQuic: falseto keep MSE playback with a<video>element. - Style the player container (
#playerDiv) instead of the media element. - Stay on v4 if you can't remove the video element dependency.
Since 5.0.7, a MOQ canvas with style.view: false displays the same way as a video element in MSE/HLS playback.
Removed in v5
| Removed | Replacement |
|---|---|
| Flash Player fallback | None. Stay on v4 if you need it. |
| Native HLS on iOS below 10 | None. Stay on v4 if you need it. |
| Internet Explorer 11 | Use a current browser, or stay on v4 |
style.scaling: "resize" and "original" | Use "letterbox", "fill" or "crop" |
Analytics after the upgrade
Since Analytics API version 2.36.0, MOQ playback is reported under /v2/moq/* and /v2/h5live/* covers WebSocket/MSE playback only. After upgrading, part of your audience moves to MOQ, so H5Live figures alone drop. Add both route groups for a total. See Analytics API.
Migration checklist
- Script URL points to
nanoplayer.5.min.js -
latencyControlMode,automute,faststart,startIndexandadaption.ruleset explicitly where you depend on them - Two-entry
source.entrieslists have an explicitadaption.ruleif they should switch automatically - Custom
h5live.serverobjects includewebtransport - No
style.scaling: "resize"or"original" - Code that uses
videoIdor reads the<video>element tested with MOQ, or MOQ disabled - Embed URLs use embed v2.0.0 (see below)
- Dashboards and reports read both
/v2/h5live/*and/v2/moq/*
Embed player v2.0.0
The hosted iframe embed moved to version 2.0.0 together with player v5. It loads nanoplayer.5.min.js and checks types strictly: only the strings true and false count as booleans. A v1.x URL with playback.metadata=1 or playback.autoplay=0 silently loses those settings. Replace 1/0 with true/false. See Embed the player.
Legacy v4
Player v4 is the legacy version. The latest v4 release is 4.31.2 (stability fixes for iOS playback and group.startQuality selection). Use it only if you depend on something v5 removed.
<script src="https://demo.nanocosmos.de/nanoplayer/api/release/nanoplayer.4.min.js"></script>
Older v4 features you may still meet in existing code:
| Legacy pattern | Current approach |
|---|---|
Single stream in source.h5live (pre-4.3) | Use source.entries with one entry, or source.group |
STS security tokens (security.token, expires, options, tag) | Deprecated. Use JWT playback tokens in security.jwtoken. See Playback tokens. |
options.switch.fastStart | Deprecated. Use playback.faststart. |
latencyControlMode: "classic" with custom tweaks.buffer | Prefer balancedadaptive with default buffers |
More retired products and pages: Legacy & retired docs.
Next steps
- Player configuration reference: all v5 keys and defaults
- Player features: MOQ, fast start and ABR in practice
- Release notes: what changed in each player version