Video Component

Player Controls

Guide to the Rixl video player controls, UI themes, and analytics events

The React Video component is a @lit/react wrapper around the Lit <rixl-video> element. It is a custom player, not a raw HTML <video>. You configure the built-in UI with props such as theme, controls, progressBar, allowFullscreen, and allowPictureInPicture, or build your own controls with theme="hideUI" and onRixlAnalytics.

Built-in UI

The <rixl-video> player ships with a built-in control bar and several themes.

PropTypeDefaultDescription
controlsbooleantrueShow the built-in control bar.
themestringdefaultdefault, minimal, feed, hover, hideUI.
progressBarbooleantrueShow the progress/seek bar.
showChaptersbooleantrueRender chapter markers on the progress bar.
heatmapbooleantrueShow an engagement heatmap overlay when data is available.
hotSegmentsbooleanfalseHighlight hot (high-engagement) segments.
allowPlayPausebooleantrueAllow play/pause toggles.
allowFullscreenbooleantrueAllow fullscreen toggles.
allowPictureInPicturebooleantrueAllow picture-in-picture toggles.
autoHideMsnumber3000Time before the UI hides after inactivity.
hideUIbooleanfalseHide the entire built-in UI.
import {Video} from "@rixl/media-react";

<Video id="your-video-id" controls theme="default" progressBar allowFullscreen />

Standard Media Attributes

The player also accepts standard media attributes, which it forwards to the underlying media element:

AttributeTypeDescription
autoPlaybooleanStart playback as soon as the video can play.
mutedbooleanMute audio by default.
loopbooleanLoop playback when the video ends.
playsInlinebooleanPrefer inline playback on mobile browsers.
posterstringURL of an image to show before the video loads.
volumenumberInitial volume level from 0 to 1.

Themes

Full control bar with progress, volume, fullscreen, PiP, settings, and chapters.

<Video id="video-id" theme="default" />

Analytics Events

The video component emits rixl-analytics events through onRixlAnalytics. These events describe how users interact with the player:

EventTypeDescription
content_view startcontent_viewsThe video entered the viewport and started being tracked.
content_view watchcontent_viewsPeriodic view heartbeat while the video is visible.
content_view endcontent_viewsThe video left the viewport or was unmounted.
playinteractionThe user started playback.
pauseinteractionThe user paused playback.
seekinteractionThe user seeked to a new position.
mute / unmuteinteractionAudio was muted or unmuted.
volume_changeinteractionThe volume level changed.
fullscreeninteractionFullscreen mode was entered or exited.
picture_in_pictureinteractionPicture-in-Picture mode was entered or exited.
quality_changeinteractionThe HLS quality level changed.
settings_openinteractionThe player settings menu was opened.
errorerrorA media load or playback error occurred.
<Video
  id="your-video-id"
  controls
  analytics
  analyticsPage="standalone"
  onRixlAnalytics={(e) => {
    console.log("Rixl analytics event:", e.detail.event);
  }}
/>

Custom Control Bars

If you need a fully custom control bar, use theme="hideUI" and place your own controls as siblings of <Video>. You can drive them from onRixlAnalytics or from your own React state.

Do not render custom controls as children of the Video component. The Video wrapper is a self-contained Lit web component and does not provide an internal slot for child controls.

Keyboard Shortcuts

When the player has focus, the following shortcuts are supported:

ActionShortcut
Play / PauseSpace or K
Seek forward 5 s
Seek backward 5 s
Volume up
Volume down
Mute / UnmuteM
Toggle fullscreenF
Toggle Picture-in-PictureI (browser dependent)

Picture-in-Picture and Fullscreen

Picture-in-Picture and fullscreen can be triggered from the built-in control bar or through the allowPictureInPicture and allowFullscreen props.

Not all browsers support Picture-in-Picture. The Video component emits a picture_in_picture analytics interaction event when the browser fires the corresponding enterpictureinpicture / leavepictureinpicture events.