Media

Media
stable

Universal media controls shell (controller, scrubber, volume) consumed by OrigamAudio and OrigamVideo. Headless and media-agnostic — drives any HTMLMediaElement via state + methods refs from useMediaPlayer().

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamMediaControllerSchematic of the MediaController shell with 6 numbered zones. #header slot #waveform / progress row play/pause time display volume cfg #footer slot 1 2 3 4 5 6
Anatomy of <origam-media-controller> — 6 internal zones: header slot, progress row (scrubber), transport row (buttons), footer slot, plus prepend/append transport injection points.
1.origam-media-controller
Root container. When inset=true, overlays the media surface with a gradient.
2.origam-media-controller__progress-row
Hosts the OrigamMediaScrubber timeline (or the #waveform slot override).
3.origam-media-controller__buttons-row
Transport row: play/pause, previous/next, time display, volume, config menu.
4.origam-media-controller__time
Current time / total duration display. Children: __time-current, __time-sep, __time-total.
5.origam-media-controller__buttons-left
Left side of transport row. Hosts #prepend-transport slot, play/pause, previous/next, time.
6.origam-media-controller__buttons-right
Right side of transport row. Hosts #extraControlsRight slot, volume control, config menu.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

state
requis
IMediaPlayerState
—
Reactive media state from useMediaPlayer() (or a specialisation). Required.
methods
requis
IMediaPlayerMethods
—
Imperative methods from useMediaPlayer(). Required.
inset
boolean
false
Overlay mode: the shell sits on top of the media surface with a dark gradient and auto-hides. When false, renders as an always-on toolbar.
visible
boolean
true
Visibility flag driven by the parent's autohide logic.
playbackRates
ReadonlyArray<number>
[0.5, 0.75, 1, 1.25, 1.5, 2]
Available playback rates exposed via the config menu.
allowRemotePlayback
boolean
false
Enables the cast / AirPlay button (Remote Playback API).
downloadable
boolean
false
Adds a "Download" row to the config menu.
downloadUrl
string | null
null
URL surfaced to the consumer when "Download" is clicked.
downloadFilename
string
Suggested filename written to the <a download="…"> attribute.
qualityOptions
ReadonlyArray<TQualityOption>
[]
Quality variants list. When ≥ 2 entries, a "Quality" drill-down appears in the config menu.
currentQuality
string | null
null
Currently-active quality identifier.
showPrevious
boolean
false
Show the "previous" transport button.
showNext
boolean
false
Show the "next" transport button.
showLoop
boolean
false
Show the tri-state loop button (none → all → one → none).
showShuffle
boolean
false
Show the shuffle toggle button.
loopMode
'none'
Current loop mode (v-model:loopMode). Cycles none → all → one → none on click.
shuffle
boolean
false
Current shuffle state (v-model:shuffle). Toggled on click.

API

Slots

Emplacements de contenu exposés par ce composant.

#header
Block rendered above the scrubber row. OrigamAudio injects cover + metadata here.
#waveform
Replaces the default OrigamMediaScrubber scrubber row. Receives state + methods to route seeks.
#footer
Block rendered below the transport row. OrigamAudio injects the playlist list here.
#prepend-transport
Buttons rendered at the start of the transport row, before the play button.
#append-transport
Buttons rendered at the end of the transport row, after the config menu.
#extraControlsLeft
Additional buttons rendered on the left side of the toolbar, after the time display.
#extraControlsRight
Additional buttons on the right side of the toolbar, before the config menu. OrigamVideo injects captions / PiP / fullscreen here.
#configExtra
Extra rows in the config menu (audio output device, subtitle track selector…).

API

Emits

Événements émis par ce composant.

@quality-change
string
Fired when the user picks a quality option from the config menu. Parent owns the <source> swap.
@download
void
Fired when the user clicks the Download button in the config menu.
@previous
void
Fired when the previous transport button is clicked. Parent decides skip-back vs playlist jump.
@next
void
Fired when the next transport button is clicked. Parent owns the playlist action.
@update:loopMode
TAudioLoopMode
Two-way binding for the loop mode. Emitted when the user cycles the loop button.
@update:shuffle
boolean
Two-way binding for shuffle state. Emitted on shuffle toggle click.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

Color of the filled progress track and thumb.
Border-radius of the track and progress bar (pill shape by default).
Color of the volume level bar inside the tooltip.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

group
progressbar
slider

Interactions clavier

Interactions clavier
ToucheAction
Space / KToggle play / pause.
ArrowLeft / JSeek backward (scrubber step or 5 s).
ArrowRight / LSeek forward (scrubber step or 5 s).
ArrowUp / ArrowDownAdjust volume (vertical scrubber when focused).
MToggle mute.

Notes

  • OrigamMediaScrubber sets role="slider", aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext on the track element. Keyboard users can seek using ArrowLeft/ArrowRight.
  • OrigamMediaVolumeControl mute button receives an aria-label from the muteLabel / unmuteLabel props. These must be translated strings passed by the parent.
  • Scrubber transitions and controller fade-in are suppressed under prefers-reduced-motion: reduce.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
color
{color.action.primary.bg}
Fill color of the scrubber progress bar and thumb.
dimension
{radius.full}
Border-radius of the track, progress and thumb (pill by default).

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

MediaController usage

vue

MediaScrubber standalone

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.