Skip to Content

React video player

Play Rixl videos in React with adaptive HLS, captions, built-in controls, and scoped custom controls.

Video loads a Rixl video by ID and renders its player in the browser. It works in React SPAs, Next.js, and TanStack Start.

import {Video} from "@rixl/media-react/video";

export function Player() {
  return <Video id="YOUR_VIDEO_ID" muted style={{display: "block", width: "100%", aspectRatio: "16 / 9"}} />;
}

Connect the SDK first; see Installation.

Player features

  • Adaptive HLS playback through native browser support or HLS.js.
  • Built-in play/pause, seeking, volume, fullscreen, and picture-in-picture controls.
  • Chapters, captions, audio tracks, and quality selection when available for the media.
  • Themes for a standard player, minimal UI, hover playback, feed use, and custom controls.
  • SDK analytics configuration and forwarded media events.

Published components load id through the SDK. Direct URLs and supplied media objects do not replace that loading path.

Custom controls

Use theme="hideUI" and player hooks. Controls nested inside Video inherit its player scope. Wrap a video and detached sibling controls in VideoPlayer to share one scope.

Use callbacks such as onPausedChange for state notifications and onRixlAnalytics for analytics events. Analytics callbacks are not a playback-control API.

Layout and server rendering

Give the host a height or aspect ratio. style and className affect the host, while internal player styles live in shadow DOM.

React can render the custom-element host and your children on the server. The internal video and controls render in the browser; server rendering is optional.