Video
Video player with a glowing play button on the poster and a small set of custom controls over the native video element.
<arc-video>Overview
Video wraps the native <video> element in ARC UI's own controls. Before the first play it shows the poster with a large, glowing play button. Once playback starts, a floating control bar takes over with play/pause, a monospace time readout, a scrub bar that seeks where you click, a mute toggle and a fullscreen button. After two seconds without input the bar dims, but it stays visible and clickable. It returns to full strength when the pointer is over the player or a control has focus. Under reduced motion the fade is instant, but the bar still dims.
When the player has focus, Space or K plays and pauses, the arrow keys seek five seconds back or forward, M mutes and F toggles fullscreen. arc-play, arc-pause and arc-ended fire on each change, with the current time in seconds on detail.value.
It takes a single src, with no <source> list for multiple formats. Serve one format your target browsers all play, such as H.264/MP4, or use the native element when you need format negotiation or adaptive streaming. For ambient or presentation video, set controls="false" and pair autoplay with muted. Browsers only honor autoplay for muted video, and when autoplay is blocked the play button stays up.
Guidelines
Do
- Set a `label`. It names the player region and the play button for screen readers
- Set a `poster` so the frame before playback shows content, not an empty box
- Use `controls="false"` with `autoplay`, `muted` and `loop` for an ambient background video
Don't
- Don't use it for a still frame. Use arc-image for anything that doesn't play
- Don't use it to page through a set of clips or mixed media. Use arc-carousel
- Don't leave ambient video unmuted. With `controls="false"` the reader has no way to turn the sound off
Features
- `preload` is passed to the native element and defaults to `metadata`
- The fullscreen button does nothing where the Fullscreen API isn't available
Preview
Usage
This component needs JavaScript. Use the Web Component or a framework wrapper.
<arc-video
src="/media/launch-recap.mp4"
poster="/media/launch-recap.jpg"
label="Launch recap"
></arc-video>
<!-- Ambient background video: no controls, muted autoplay loop -->
<arc-video
src="/media/hero-loop.mp4"
controls="false"
autoplay
muted
loop
></arc-video>import { Video } from '@arclux/arc-ui-react';
export default function Example() {
return (
<Video
src="/media/launch-recap.mp4"
poster="/media/launch-recap.jpg"
label="Launch recap"
onArcPlay={(e) => console.log('started at', e.detail.value)}
/>
);
}<script setup>
import { Video } from '@arclux/arc-ui-vue';
</script>
<template>
<Video
src="/media/launch-recap.mp4"
poster="/media/launch-recap.jpg"
label="Launch recap"
/>
</template><script>
import { Video } from '@arclux/arc-ui-svelte';
</script>
<Video
src="/media/launch-recap.mp4"
poster="/media/launch-recap.jpg"
label="Launch recap"
/>import { Component } from '@angular/core';
import { Video } from '@arclux/arc-ui-angular';
@Component({
imports: [Video],
template: `
<arc-video
src="/media/launch-recap.mp4"
poster="/media/launch-recap.jpg"
label="Launch recap"
/>
`,
})
export class MediaComponent {}import { Video } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<Video
src="/media/launch-recap.mp4"
poster="/media/launch-recap.jpg"
label="Launch recap"
/>
);
}import { Video } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<Video
src="/media/launch-recap.mp4"
poster="/media/launch-recap.jpg"
label="Launch recap"
/>
);
}API
srcstring''- Video source URL. A single source only; no multi-format machinery.
posterstring''- Poster image URL shown before the first play.
labelstring''- Accessible name for the player region. Falls back to a generic label when empty.
controlsbooleantrue- Shows the custom control bar once playback has started, and enables the player keyboard shortcuts. Defaults to true; set
controls="false"for ambient or presentation video. autoplaybooleanfalse- Starts playback as soon as the browser allows. Browsers only honor autoplay when the video is muted, so pair it with
muted; when autoplay is blocked, the play overlay remains and the user starts playback themselves. loopbooleanfalse- Restarts playback from the beginning when the video ends.
mutedbooleanfalse- Mutes the audio track. Toggled live by the mute button and the M key.
preload'none' | 'metadata' | 'auto''metadata'- Passed through to the native video element. The default
metadataloads dimensions and duration without buffering content.
Events
arc-playdetail:{ value: number }- Fired when playback starts or resumes.
detail.valueis the current time in seconds. arc-pausedetail:{ value: number }- Fired when playback pauses.
detail.valueis the current time in seconds. arc-endeddetail:{ value: number }- Fired when playback reaches the end.
detail.valueis the final time in seconds.
See also
- ImageImage with a shimmer skeleton while it loads, a fade-in, an error fallback and aspect ratio presets.
- CarouselShows its children one at a time as full-width slides in a scroll-snapping strip.
- Aspect RatioA box that holds its content to a fixed width-to-height ratio.
- WaveformDraws an audio clip's shape from peak values you supply, and doubles as a seek control.