diff --git a/.changeset/calm-videos-play.md b/.changeset/calm-videos-play.md new file mode 100644 index 000000000..f0bd0a008 --- /dev/null +++ b/.changeset/calm-videos-play.md @@ -0,0 +1,11 @@ +--- +'@primer/react-brand': minor +--- + +Added the new `MinimalVideoPlayer` component for presenting muted, looping videos with a minimal play and pause control. + +```tsx + +``` + +🔗 [See `MinimalVideoPlayer` documentation for more usage examples](https://primer.style/brand/components/MinimalVideoPlayer) diff --git a/apps/next-docs/content/components/MinimalVideoPlayer/index.mdx b/apps/next-docs/content/components/MinimalVideoPlayer/index.mdx new file mode 100644 index 000000000..2f6e7a9bb --- /dev/null +++ b/apps/next-docs/content/components/MinimalVideoPlayer/index.mdx @@ -0,0 +1,120 @@ +--- +title: Minimal video player +description: Use MinimalVideoPlayer for muted, looping product demonstrations with a single play and pause control +keywords: ['playback', 'media', 'video', 'motion'] +show-tabs: false +ready: true +source: https://github.com/primer/brand/blob/main/packages/react/src/MinimalVideoPlayer/MinimalVideoPlayer.tsx +storybook: '/brand/storybook/?path=/story/components-minimalvideoplayer--playground' +thumbnail: '/images/thumbnails/minimal-video-player-thumbnail.png' +thumbnail_darkMode: '/images/thumbnails/minimal-video-player-thumbnail-dark.png' +--- + +```js +import {MinimalVideoPlayer} from '@primer/react-brand' +``` + +Use `MinimalVideoPlayer` for short, silent product demonstrations that need only a play and pause control. + +Use [VideoPlayer](/components/VideoPlayer) when viewers need audio, captions, seeking, volume, fullscreen controls, +branding, or a dedicated programmatic playback API. + +## Examples + +### Default + +Pass a native video URL with `src`. The required `title` provides a concise accessible name for the video. + +```jsx live + +``` + +### Native source element + +The component also accepts native `` children. + +```jsx live + + + +``` + +### Disable automatic playback + +`autoPlay` defaults to `true`, making the video eligible to play when it enters the viewport. Set it to `false` when playback should always begin with an explicit user action. + +```jsx live + +``` + +### Disable looping + +Videos loop by default. Set `loop` to `false` when the demonstration should stop after one playback. + +```jsx live + +``` + +### Customize control labels + +Provide localized play and pause labels with `internalAccessibleLabels`. Keep `title` focused on naming the video rather than the control. + +```jsx live + +``` + +## Playback behavior + +`MinimalVideoPlayer` is always muted, plays inline, and hides native controls. When `autoPlay` is enabled, it starts only while visible, pauses after leaving the viewport, and resumes after re-entering the viewport unless the viewer paused it manually. + +The forwarded ref provides access to the underlying `