Skip to content

dandiws/svelte-audio-player

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published