본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

오디오

원문 보기 위키 갱신

오디오 (Audio)

오디오를 재생하는 컴포넌트예요. 자동 재생·반복 재생·음소거 같은 재생 제어와 진행 상태 표시를 지원하고, 컨트롤 UI도 직접 만들 수 있어요.

출처: 문서

설치 (Install)

import { createApp } from 'vue'
import { Audio } from '@nutui/nutui'

const app = createApp()
app.use(Audio)

사용 예제 (Usage)

기본 사용법 (Basic Usage)

demo: audio basic

음성 재생 (Voice Playing)

demo: audio play

진행 상태 (Progress)

demo: audio progress

컨트롤 커스텀 (Custom Control)

demo: audio control

API

Props

Attribute Description Type Default
url Audio URL string ''
muted Whether to be muted boolean false
autoplay Whether to autoplay boolean false
loop Whether to loop playback boolean false
preload Whether to proload audio string auto
type Show type String progress

Events

Attribute Description CallBack
fast-back Emitted when audio back play time(millisecond)
forward Emitted when audio forward play time(millisecond)
play Emitted when audio play or pause play status
ended Emitted when audio ended ——
mute Emitted when audio mute ——
change-progress Emitted when audio progress change play time(millisecond)
can-play Emitted when the user agent can play the media event: Event

더 알아보기 (Learn more)

이 글은 NutUI 공식 문서의 영문 원문을 한국어로 번역한 내용이에요. 최신 내용과 전체 문서는 아래 링크에서 확인할 수 있어요: