这是无 UI 的播放核心库,需自行提供播放界面;HLS 与 MP4/WebM 仅在兼容浏览器的 directfile 模式下支持;大体积 DASH Manifest 可选用 WebAssembly 版 MPD 解析器。
npm install --save rx-playerREADME 未说明硬件要求;运行在支持 Media Source Extensions 与 Encrypted Media Extensions 的浏览器中。
基于 MSE/EME 的 DASH 与 Smooth Streaming 播放引擎,只做流媒体核心,界面由你实现
基于 TypeScript 的 HTML5 视频播放器,支持 DASH、Smooth Streaming 和直播流,通过 MSE/EME 处理自适应码率与 DRM 播放。
核心能力
- 支持 DASH、Smooth Streaming,兼容浏览器可播 HLS 与直连文件
- 核心逻辑可放入独立线程,避免阻塞主应用
- 处理多 DRM 密钥、无法解密或解码质量时的自动回退
- 支持 TTML、WebVTT、SAMI、SRT 字幕
- 提供最小构建,按需引入 DASH、EME 等特性减小体积
容易踩的坑
- v4.5.0最新正式版2026-07-06 · 2026-07-06 17:49 UTC
Release v4.5.0 (2026-07-06)
- :mag: Overview
- :bookmark_tabs: Changelog
- Application-defined worker logic
- More complete
MULTI_THREADtransport support - A more shared core path internally
- More explicit out-of-bounds errors
- The
reloadAPI is now easier to integrate - Thumbnail improvements
- Safari and native HLS improvements
- CMCD updates
:mag: Overview
This new release adds several fixes and features:
-
The biggest update here is on the
MULTI_THREADexperimental feature: applications can now rely onmanifestLoader,segmentLoaderandrepresentationFiltercallbacks in "multithreading mode".This is done by letting you build your own separate RxPlayer worker bundle, through a wrapper with a simple API exported from the
rx-player/experimental/workerpath. Once bundled you can then provide the resulting file/build to the RxPlayer's usualattachWorkerAPI. -
Moreover, it's now possible through the same worker bundle feature to add "
transport" features that were previously unavailable in multithreading mode:SMOOTH,LOCAL_MANIFESTandMETAPLAYLIST.This means that no feature should now be missing from the multithreading mode, aside from
directfilewhich would not really profit from it anyway. -
We also have done a big internal change now that we're planning to remove the "experimental" label from the
MULTI_THREADfeature: a large part of the monothreaded and multithreaded codebase has been merged into one shared path. This should simplify maintenance and make future behavior differences between both modes less likely. -
We added more information to
MEDIA_TIME_BEFORE_MANIFESTandMEDIA_TIME_AFTER_MANIFESTerrors -
We fixed multiple Safari / native-HLS edge cases
-
We improved DASH thumbnail handling
-
We fixed a small memory leak linked to quality changes
-
and we brought several smaller API and playback behavior improvements.
Changelog
Features
MULTI_THREAD: Allow applications to define their ownrepresentationFilter,segmentLoaderandmanifestLoadercallbacks worker-side [#1719]MULTI_THREAD: Enable adding most transport features worker-side (DASH,DASH_WASM,SMOOTH,LOCAL_MANIFESTandMETAPLAYLIST) to play them in"multithreading"mode [#1783]MediaErrorwith the codeMEDIA_TIME_BEFORE_MANIFESTandMEDIA_TIME_AFTER_MANIFESTnow have atimeInfoproperty to make explicit the exact boundaries and present position linked to the issue [#1838]
Bug fixes
- Fix memory leak linked to quality changes [#1781]
- DRM: When a license request times out, now send a
KEY_LOAD_TIMEOUTerror instead ofKEY_LOAD_ERROR - DRM: Fix `"close
- v4.4.12025-12-10 · 2025-12-10 17:21 UTC
查看更新说明
Release v4.4.1 (2025-12-10)
:mag: Overview
This is a very small patch release we're doing because of a
v4.4.0regression that seemed to impact some applications in various ways.We did not include new features to ensure this patch release is as stable as possible.
Changelog
Bug fixes
- Fix v4.4.0 regression where the RxPlayer might base itself on the previous content's position [#1758]
- Add resilience to DRM fallback when position is not yet known instead of triggering
MEDIA_TIME_NOT_FOUNDerror [#1755]
Issue when loading several contents without stopping
The
v4.4.0regression this release fixes, brought with the ability of seeking while the RxPlayer hasn't yet loaded the content, led to an internal RxPlayer issue where for a very brief chunk of time it relied on the position from a potential previous content while running its logic for a new content.Yet because we've built the RxPlayer to be resilient, that issue did not have any effect for most applications.
After a few weeks, one of canal+ application started seeing
MEDIA_TIME_NOT_FOUNDerrors only in multithreaded scenarios and only under a set of time-related conditions. We saw the issue, brought a fix, but thought that it was sufficiently rare, only under the "experimental"MULTI_THREADfeature and had many work-arounds (stopping a content between loads, disabling theMediaKeySessioncache etc.) so we thought the impact was limited.Yet last week, another application had an "infinite loading" issue, linked to the same root cause.
Note that in any case, calling
stopbefore callingloadVideoagain totally fixes the issue (as our internal position tracking is reset when a content is stopped). Anyway, we decided to release the fix in its own patch release on top ofv4.4.0so it can just work as expected under the more efficient strategy of callingloadVideowithout stopping first.We also added resilience to our handling of a position that seems not-right to avoid seeing
MEDIA_TIME_NOT_FOUNDerrors even in similar future scenarios, handling minor, recoverable, state discrepancies gracefully instead. - v4.4.02025-09-25 · 2025-09-25 19:16 UTC
查看更新说明
Release v4.4.0 (2025-09-25)
- :mag: Overview
- :bookmark_tabs: Changelog
onVideoTracksNotPlayable/onAudioTracksNotPlayable- new
disableAudioTrackAPI - new method:
getWallClockOffset seekTonow callable whileLOADING/RELOADING- Key system information on most
EncryptedMediaError - Firefox and Chrome now handling PlayReady SL3000 on Windows
- More structured logs
- New hidden experimental API: Dummy Media Element
- Improved MediaCapabilitiesProber Experimental API
- Auditable RxPlayer releases
:mag: Overview
The v4.4.0 is here, with many new features and improvements:
-
new
onAudioTracksNotPlayableandonVideoTracksNotPlayableloadVideooptions to allow playback even if no audio or video tracks are supported on the current content. -
A new
disableAudioTrackAPI, to complement the existingdisableVideoTrackanddisableTextTrackAPIs and give you control over all media track types -
seekTocan now be relied on even when stillLOADING/RELOADING, to correct a future playback position. -
A new
getWallClockOffsetAPI to facilitate conversions between the RxPlayer'spositionand the "wallClockTime"that is generally more useful for live contents. -
EncryptedMediaErrorerrors, which are those linked to content decryption, now will also communicate context when possible, such as the corresponding key system name and configuration. -
Add
MediaErrorwith the"NO_AUDIO_VIDEO_TRACKS"code for when neither audio nor video is available or when both are disabled -
"local"Manifests (experimental feature to load contents that are downloaded locally) can now announce forced narrative subtitles tracks, through the newforcedSubtitlesproperty -
The experimental
MediaCapabilitiesProbertool had its API updated to be more flexible (see below) -
WebVTT embedded in an mp4 segment are now properly handled.
-
Firefox and Chrome recently added PlayReady SL3000 support under most Windows 11 devices. It is now properly handled.
-
Thumbnails (from our new thumbnails API brought in v4.3.0) now have a better caching mechanism.
-
RxPlayer logs have been rewritten to be more easily read and exploited by people relying on the RxPlayer logs for debugging
-
many bug fixes and other improvements
Changelog
Features
- Add
onAudioTracksNotPlayableandonVideoTracksNotPlayableloadVideooptions to control whether to continue playback is one of those components is not compatible to the current device [#1624]
- v3.33.62025-09-25 · 2025-09-25 19:15 UTC
查看更新说明
Release v3.33.6 (2025-09-25)
:mag: Overview
The
v3.33.5is a "legacy" release (now that the v4 is the current major version) mostly containing some of the bug fixes and improvements initially made for the upcoming v4.4.0 release that should be done just after this one.Note that, after a year and a half of support while our v4 was our main focus, it may be our last legacy v3 release, unless a sensible issue is found on it.
Though we encourage all applications to switch to our v4, we understand that some applications don't have the time for this change. Our v3 will still be available and you can also report issues specifically seen with it, in which case we may still fix the issue depending on the effort for doing so.
:bookmark_tabs: Changelog
Bug fixes
- Subtitles: Fix some subtitle missing on multiple period assets [#1726]
- DRM: renew the mediaKeySystemAccess on Edge and Firefox when using a Playready keySystem to work-around frequent DRM issues. [#1728]
- DRM: On Firefox check extensively Playready DRMs support before using them to work-around recent firefox issue with PlayReady integration [#1730]
- DRM: Fix persistent session loading when Manifest has no key id [#1724]
- Directfile: set autoplay attribute on directfile contents, to work-around safari-specific issues [#1729]
- Remove unnecessary duration logs when reaching the end of some VoD contents [1750]
- v4.3.02025-04-01 · 2025-04-01 16:06 UTC
查看更新说明
Release v4.3.0 (2025-04-01)
- :mag: Overview
- :bookmark_tabs: Changelog
- DASH Thumbnail tracks
- ManagedMediaSource API support
- Representation avoidance mechanism
- Codec checking in the same environment where MSE is running
keySystems[].wantedSessionTypes
:mag: Overview
The v4.3.0 is finally here.
We took some time to release it compared with previous releases due to a lot of other subjects coming our way late last year. We do have worked on a larger amount of features since the last release, yet many of them are thus still in a review phase for now, and we focused on stability and what we thought were the most awaited features for a (normal-sized!)
v4.3.0, especially:-
Handling of DASH thumbnail tracks.
To minimize the complexity on your side, our thumbnail-related API takes care of every details about thumbnail fetching, caching and rendering, all you'll have to do is providing a timestamp for the wanted thumbnail and the DOM element on which you want to display the corresponding thumbnail.
-
We now automatically handle the
ManagedMediaSourceAPI (the MSE variant found on iOS devices), along with itsstartstreaming/endstreamingevents, minimizing battery usage on those devices. -
We added a new "Representation avoidance" algorithm. The idea is to automatically detect audio and video contents that lead to unexpected decoding issues on the current device and, if detected, to avoid playing them. This follows real issues we had seen on some WebOS and TitanOS devices (respectively mostly LG Smart TVs and mostly Philips Smart TVs).
For now this new behavior is behind an option - though it might become a default feature in the future as explained below.
-
We added a
keySystems[].wantedSessionTypesloadVideooption for very specific DRM-related optimizations. The reasons why applications could need this are somewhat complex and are explained below. -
We realized that multiple newer devices (at least the Meta Quest 2 and some other embedded devices) had issues decoding Dolby Digital+ only when it was encrypted.
We had a small issue in our logic detecting codec support in an encrypted context (added in
v4.2.0) that made this specific case not handled. Now we should properly avoid any audio or video codec that is unsupported when encrypted. -
We fixed an issue preventing playback of some contents with h265 video, for now only seen on the Edge browser if specific updates for H265 support were manually installed and if the RxPlayer was running in
"multithreading"mode (which seems rare, but it does happen, especially for some techy customers!).The root issue may be an Edge Browser bug, but it did reveal an area where we could improve our resilience. We found the components of that issue to be interesting so we added more information on it in this release not!
-
We brought several improvements for Tizen devices, includin
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
The RxPlayer is a library implementing a DASH and Microsoft Smooth Streaming media player on a browser, by relying on the HTML5 Media Source Extensions and Encrypted Media extensions browser APIs.
This library only implements the core, non-UI part of a media player - you provide the interface while it handles the streaming. See our demo page for an example implementation.
Initially built for Canal+'s complex requirements across diverse devices, it prioritizes configurability and integration flexibility.
The RxPlayer can be seen as the "engine" providing adaptive streaming capabilities to an application:
-
Beyond DASH and Smooth Streaming support (and HLS on devices with native support like Safari), it handles complex scenarios like multiple DRM keys, fallback mechanisms for undecipherable or undecodable qualities, most subtitle formats and advanced heuristics to keep the playback going.
-
Multi-threaded architecture: core logic can be offloaded to a separate thread, keeping the player from blocking your application and vice-versa.
-
Production-tested across a wide device range: from low-end set-top boxes to high-end computers, with optimizations for constrained environments.
-
Highly configurable with a well-documented API: player behavior can be controlled at a granular level.
How to use it?
The fastest way to use the player directly in your code is to add this repository as a dependency.
You can do it via npm or yarn:
# when using npm:
npm install --save rx-player
# or, when using yarn instead:
yarn add rx-player
You can then directly import and use the RxPlayer in your code:
import RxPlayer from "rx-player";
const player = new RxPlayer({
videoElement: document.querySelector("video"),
});
// play a video
player.loadVideo({
url: "http://vm2.dashif.org/livesim-dev/segtimeline_1/testpic_6s/Manifest.mpd",
transport: "dash",
autoPlay: true,
});
We've also written short tutorials to help you familiarize with the RxPlayer API:
- Quick start into the API.
- Playing contents with DRMs.
- Selecting a track
- Listening to events contained in the content
To be able to play with the player without needing to perform any setup we also created multiple live-editable demos:
- Playing a clear DASH content
- Playing an encrypted DASH content
- Playing an RxPlayer-specific MetaPlaylist content
Minimal Builds
To reduce the size of the final code, you might also want to import a minimal version of the player and only import the features you need. This is documented here :
For example, to play encrypted DASH contents, you could just write:
import RxPlayer from "rx-player/minimal";
import { DASH, EME } from "rx-player/features";
// Allow to play encrypted DASH contents
RxPlayer.addFeatures([DASH, EME]);
API
We documented the API in every little detail in the API documentation.
You can also refer to the documentation of our previous versions here
These documentation pages are automatically generated from the content of the doc/api directory in this repository.
Demo
You can view our online Demo, built from our last version, here.
This demo is a small application written in React demonstrating a simple usage of the player.
Demo pages for our previous versions are also available here.
Contribute
After cloning our repo, you should first install our dependencies via npm:
npm install
You can then run the list script to see the different scripts provided to test your
modifications, run a demo locally etc.:
npm run list
Details on how to contribute is written in the CONTRIBUTING.md file at the root of this repository.
Features
Key features:
-
live and VoD DASH (including low-latency) / Smooth / HLS* / Downloaded contents / MP4* / WebM* contents and more.
-
advanced encryption configuration: multiple keys in a single or separate licenses for a given content, automatic fallbacks on undecipherable contents, persistent licenses, complex
MediaKeySystemConfiguration. -
TTML, WebVTT, SAMI and SRT subtitles.
-
multi-threading support.
-
extensive APIs: audio-only, video track selection, manual garbage collection of segments, Peer-To-Peer integration, quality filtering...
-
adaptive streaming algorithms: both a network-based for quick start-up and buffer-based to provide the best quality possible.
-
complex segment scheduling logic: prioritizing closer media segments while making sure that the bandwidth usage is always optimal and the rebuffering risks always low.
-
heuristics to ensure playback stays smooth, the RxPlayer monitors playback and take actions if the current device has issues while decoding the stream.
-
optional WebAssembly-based MPD parser for DASH contents (for very large Manifests).
* In "directfile" mode, on compatible browsers