IAudioProps
Full props contract for <OrigamAudio> — composes useAudioPlayer with OrigamMediaController to paint an opinionated audio card (cover + title/artist + transport bar). Exposes variant, cover, playlist, loop mode, shuffle, waveform, playback rates and the full design surface.
TypeScript
Définition
La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.
Héritage
Hérite de
Interfaces parentes dont celle-ci hérite. Leurs propriétés sont disponibles pour tout consommateur de cette interface.
API
Propriétés
Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.
- variantTAudioVariant'expanded'
- Visual variant: 'expanded' (full strip with waveform) or 'compact' (slim transport dock).
- coverPositionTCoverPosition'left'
- Side of the surface where the album cover is painted. The controller sits on the opposite side.
- srcrequisstring | IAudioSource | Array<IAudioSource>
- Media URL — a single string, an IAudioSource object or an array for codec fallback.
- tracksArray<IVideoTrack>[]
- Optional captions/chapters tracks attached to the audio element.
- titlestring
- Optional title shown above the controls.
- artiststring
- Optional artist/author shown next to the title.
- albumstring
- Optional album name shown below the artist.
- coverstring | ISrcObject
- Optional cover image (URL string or ISrcObject for srcset/lazy-src support).
- waveformboolean | 'auto'false
- Display the computed waveform above controls. 'auto' activates only when OfflineAudioContext is supported.
- waveformColorstring'currentColor'
- Stroke colour for the played portion of the waveform bars.
- autoplaybooleanfalse
- Starts playback as soon as loadedmetadata fires. Suppressed when the user has requested reduced motion.
- mutedbooleanfalse
- Starts the player muted.
- loopbooleanfalse
- Legacy loop flag — maps to loopMode="one". Prefer loopMode for new code.
- loopModeTAudioLoopMode'none'
- Tri-state loop strategy: 'none', 'all' (loop playlist) or 'one' (loop current track).
- shufflebooleanfalse
- Shuffle the playlist order when navigating with prev/next or auto-advancing.
- playlistArray<IAudioTrack>
- Optional list of tracks to play sequentially.
- currentTrackIndexnumber0
- Index of the currently-active track in the playlist. Supports v-model:currentTrackIndex.
- preload'none' | 'metadata' | 'auto''metadata'
- Buffering hint: 'metadata', 'none' or 'auto'.
- crossoriginstring
- Mirrors the native crossorigin attribute. Required when CORS-enabled origin needs WebAudio access.
- controlsTAudioControls'custom'
- Which control surface to render: 'custom' paints OrigamMediaController; 'native' uses the browser built-in controls.
- playbackRatesReadonlyArray<number>[0.5, 0.75, 1, 1.25, 1.5, 2]
- Available playback rates exposed via the config menu.
- playbackRatenumber1
- Initial playback rate.
- allowRemotePlaybackbooleanfalse
- Enable the cast/AirPlay button (Remote Playback API).
- downloadablebooleanfalse
- Adds a Download row to the cog menu.
- downloadFilenamestring
- Override the downloaded file name. Defaults to the trailing segment of the source URL.
Écosystème
Utilisé par
Composants et composables qui étendent ou consomment cette interface.
Usage
Exemples
Extraits de code prêts à coller utilisant cette interface.
Audio player with playlist and waveform