AudioPlayer
Less than 1 minute
Deprecated
We recommend you to use VidStack for better experience.
Embed audios in Markdown files.
Install vidstack@next
package in your project first to use this component:
pnpm
pnpm add -D vidstack@next
yarn
yarn add -D vidstack@next
npm
npm i -D vidstack@next
Demo
An audio player
<AudioPlayer src="//theme-hope-assets.vuejs.press/files/sample.mp3" />
An audio player with poster and title
<AudioPlayer
src="//theme-hope-assets.vuejs.press/files/sample.mp3"
title="A Sample Audio"
poster="//theme-hope-assets.vuejs.press/logo.svg"
/>
Props
src
Type:
PlayerSrc
type PlayerSrc = MediaSrc | MediaSrc[]; type MediaSrc = | string | AudioSrc | VideoSrc | HLSSrc | DASHSrc | YouTubeSrc | VimeoSrc;
Required: Yes
Video source link.
Relative URL is NOT supported. When filling in a pathname, base
will be automatically added to the beginning of the pathname.
tracks
- Type:
TextTrackInit[]
- Required: No
Audio/Video subtitles and chapters.
player
- Type:
Omit<VidstackPlayerConfig, "target" | "src" | "sources" | "tracks">
- Required: No
VidStack player options
layout
- Type:
Partial<DefaultLayoutProps>
- Required: No
VidStack layout options