ReactPlayer: one façade, several providers
Learn to: choose a provider path without assuming uniform provider capabilities.
Prerequisites: 01-layer-map
Provider routing
On a narrow screen, swipe the diagram horizontally to keep its labels readable.
Architecture verified
ReactPlayer parses a source and selects markup or a provider SDK. Current documentation lists native files, HLS via hls.js, DASH via dash.js, Mux, YouTube, Vimeo and Wistia. v3 is not backward compatible with v2; some older providers are not updated. The repository description’s longer historical provider list is not a v3 support guarantee.
[S11]Minimal v3 example synthesis
// Illustrative v3 snippet; verify the chosen provider in your release.
import ReactPlayer from "react-player";
export function Lesson({ src }) {
return <ReactPlayer src={src} controls playsInline
width="100%" height="100%"
onError={(error) => console.error("playback", error)} />;
}[S11]Case and decision synthesis
A React lesson catalog with approved YouTube/Vimeo URLs and owned files benefits from a common rendering entry point. Keep a capability map for captions, seeking and rate changes. If the catalog is exclusively YouTube, the focused wrapper may reduce abstraction; if you need advanced owned-stream diagnostics, a dedicated engine is easier to inspect.
[S11] [S12]Pitfall → improvement synthesis
Avoid assuming Facebook or SoundCloud from the screenshot work in v3. Record the supported provider subset in product validation, defer full player loading with a preview where appropriate, and surface provider-specific blocked-content errors.
[S11]Check yourself: Does canPlay(url) prove the video will start?
No. Source recognition cannot guarantee authorization, availability, browser codecs or provider policy compatibility.