svelte-audio-player
v0.0.1
Published
Component that wraps html audio tag for building custom audio player.
Downloads
60
Readme
Svelte Audio Player
Component that wraps html audio tag for building custom audio player.
Installation
npm install svelte-audio-player
or using yarn
yarn add svelte-audio-player
Usage
<script>
import { AudioPlayer } from 'svelte-audio-player'
</script>
<AudioPlayer src="/BabyElephantWalk60.wav">
<MyAudioPlayer />
</AudioPlayer>
MyAudioPlayer.svelte
<script>
import { getAudioContext } from 'svelte-audio-player'
const {
currentTime,
repeat,
duration,
playing,
volume,
muted,
ended,
paused,
playbackRate,
seekBy,
seekTo
} = getAudioContext()
</script>
<!-- Your custom audio player component -->
Full documentation please visit Svelte Audio Player's website