Part 5 · Applications

ReactPlayer: one façade, several providers

Learn to: choose a provider path without assuming uniform provider capabilities.

Prerequisites: 01-layer-map

Provider routing

Source routing selects an owned-media path or external-provider path. The wrapper supplies a common entry point, not a uniform media backend.
Source routing selects an owned-media path or external-provider path. The wrapper supplies a common entry point, not a uniform media backend. [S11]

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]
Keep this: Normalize integration, but preserve provider-specific capabilities and failures.
Check yourself: Does canPlay(url) prove the video will start?

No. Source recognition cannot guarantee authorization, availability, browser codecs or provider policy compatibility.

Sources & further reading

  1. [S11] ReactPlayer README

    ReactPlayer maintainers · official documentation · accessed 2026-10-10 · v3

    Supports: v3 provider routing, src, native-like API, HLS/DASH/Mux/YouTube/Vimeo/Wistia support and migration warning.

    Read this page to inspect the API and assumptions behind the cited explanation.

  2. [S12] React YouTube README

    React YouTube maintainers · official documentation · accessed 2026-10-10

    Supports: Thin wrapper, videoId, opts, onReady and event bindings.

    Read this page to inspect the API and assumptions behind the cited explanation.