svelte-audio-player Svelte Themes

Svelte Audio Player

Component that wraps html audio tag for building custom audio player.

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

Top categories

Loading Svelte Themes