1.2.3 • Published 2 years ago

vue-dynamic-island-player v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vue-dynamic-island-player

Description

a vue-audio-player based on Howler.js,The animation of the player is interacted with reference to IOS dynamic island.

Additional information, live demos and a user showcase are available at https://zhichao8756.github.io/player-demo/.

welcome to create issue, help improve the player :)

Features

  • A set of Vue components out of the box.
  • Single API for all audio needs
  • Defaults to Web Audio API and falls back to HTML5 Audio
  • Supports all codecs for full cross-browser support
  • Full control for fading, rate, seek, volume, etc.
  • Customize the theme freely
  • No outside dependencies, just pure JavaScript

Browser Compatibility

Tested in the following browsers/versions:

  • Google Chrome 7.0+
  • Firefox 4.0+
  • Safari 5.1.4+
  • Mobile Safari 6.0+ (after user input)
  • Opera 12.0+
  • Microsoft Edge

Live Demo

Install

$ npm i vue-dynamic-island-player

Quick Start

<script setup>
import { DynamicIslandPlayer } from 'vue-dynamic-island-player'
import "../node_modules/vue-dynamic-island-player/style.css"; //引入组件样式
import { ref } from 'vue'

const playList = ref([
{
    // song of title
    title: 'Rave Digger',
    // sound file
    file: 'http://music.163.com/song/media/outer/url?id=447925558.mp3',
    // howler instance
    howl: null,
    // song of author
    author: 'Cherrystones',
    // song of cover
    cover: cover1
}
])
const player = ref()
player.value.toggle()
player.value.playPrevious()
    ...
</script>

<template>
    <div>
        <DynamicIslandPlayer ref="player"/>
    </div>
</template>

API Docs

Props Attributes

AttributeDescriptiontypeAccepted Valuesdefault
playListsongs of listArray--
volumesound volumeNumber0.0 ~ 1.00.5
html5set to true to force HTML5 AudioBooleantrue/ falsetrue
themecustom the themeStringaccept Hexadecimal color or picture-

Methods

MethodsDescriptionParameters
getSoundState()return the current sound state (playing / pause)-
setVolume()set sound volume, range 0.0 to 1.0function(0.8)
setMute()Mutes the sound, but doesn't pause the playbackfunction(Boolean) True to mute and false to unmute.
setRate()set rate of playback, range 0.5 to 4.0, with 1.0 being normal speedfunction(2.0)
seekBySeconds()Get/set the position of playback for a soundfunction(Number) skip to a second of sound.
toggle()toggle the sound play or /pause-
playNext()skip to next song-
playPrevious()back to previous song-

Events

Event NameDescriptionParameters
playtriggers when click play-
pausetriggers when click pause-
nexttriggers when click next-
previoustriggers when click previous-

License

vue-dynamic-island-player is open source software licensed as MIT.

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago