Part 12 · Applications

Worked case: mixed-provider learning portal

Learn to: design a catalog and player contract for mixed lesson sources.

Prerequisites: 05-reactplayer, 06-react-youtube

Mixed-provider reference architecture

Proposed application architecture. The backend model and progress policy are original design choices; player support must match the installed release.
Proposed application architecture. The backend model and progress policy are original design choices; player support must match the installed release. [S11] [S12] [S13] [S34]

On a narrow screen, swipe the diagram horizontally to keep its labels readable.

Scenario and proposed stack synthesis

Worked design, not a published customer result. A React portal mixes public YouTube/Vimeo lessons and owned HLS media. Use a NestJS catalog API with PostgreSQL records; ReactPlayer v3 handles the verified provider subset, while a dedicated owned-media player remains an option for richer diagnostics.

[S11] [S13]

Catalog shape synthesis

// Proposed application model, not a library API.
type LessonMedia = {
  id: string;
  provider: "youtube" | "vimeo" | "owned-hls";
  source: string;
  status: "processing" | "ready" | "failed";
  capabilities: { seek: boolean; captions: boolean; rate: boolean };
};
[S11]

Flow and decision synthesis

Render lesson metadata and a poster first. After loading the browser-side adapter, wait for readiness before restoring permitted progress. Save debounced progress hints through the application API, with provider details retained for diagnosis. Prefer a focused YouTube wrapper when only that provider is required; the multi-provider façade pays off when sources really vary.

[S11] [S12] [S34]

Failure → improvement synthesis

A provider can recognize the URL while content is unavailable. Offer an explicit retry/error panel and let the user navigate away. Keep catalog state separate from player loading state. Measure per-provider start success; do not infer secure attendance from a client completion event.

[S11] [S13]
Keep this: A shared catalog model is more durable than pretending every provider has the same features.
Check yourself: Why store capabilities instead of only a URL?

Because seeking, captions and rate control differ by source/provider. The UI needs that contract before offering controls it cannot fulfill.

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.

  3. [S13] YouTube IFrame Player API

    Google / YouTube · official documentation · accessed 2026-10-10

    Supports: Iframe readiness, state events, seek and playback APIs, origin and minimum player dimensions.

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

  4. [S34] React useEffect

    React team · official documentation · accessed 2026-10-10

    Supports: Effect setup/cleanup and Strict Mode extra development setup/cleanup cycle.

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