npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xns-audio-player-simple

v3.2.2

Published

A simple yet powerful music player for VueJs inspired by xns-audio-player

Downloads

49

Readme

xns-audio-player-simple

A simple yet powerful music player for VueJs inspired by xns-audio-player

Demo

xns-audio-player-simple

Vue 2 Support

Vue 3 Support

install

$ npm i xns-audio-player-simple

Import & initiate plugin on your entry js file

import { createApp } from "vue";
import App from "./App.vue";
import XnsAudioPlayerSimple from "xns-audio-player-simple";
import "xns-audio-player-simple/styles.css"

const app = createApp(App);
app.use(XnsAudioPlayerSimple);
app.mount("#app");

Import plugin inside a Vue SFC

<script>
import { XnsAudioPlayerSimple } from "xns-audio-player-simple";
import "xns-audio-player-simple/styles.css";

export default {
  components: { XnsAudioPlayerSimple },
  data(){
    return {
      playlist: [...]
    }
  }
}
</script>

Import plugin inside a Vue SFC with the script-setup sugar

<script setup>
import XnsAudioPlayerSimple from 'xns-audio-player-simple';
import "xns-audio-player-simple/styles.css";
import { ref } from "vue";  
const playlist = ref([...]);
</script>

On the template

<xns-audio-player-simple :playlist="playlist"></xns-audio-player-simple>

Supported song Object properties | Property | Type | Required | | ------ | ---- | -------- | | audio | String | true | | artist | String | true | | tittle | String | true | | album | String | true | | cover | String | true |

Example

export default {
  data () {
    return {
      playlist: [
        { audio: 'audio.mp3', artist: 'Superstar', tittle: 'Funky Disco House', album: 'Alpha Zulu', cover: 'cover-art.jpg' }, ...
      ]
    }
  }
}

Options

| Option | Type | Required | Default | | ------ | ---- | -------- | ------- | | playerWidth | Number | false | 0 (100%) | | playlist | Array | true | [] | | repeatAll | Boolean | false | true | | playerVolume | Number | false | 0.5 | | stopPlayback | Boolean | false | false | | pausePlayback | Boolean | false | false | | showAudioDuration | Boolean | false | true | | showAudioData | Boolean | false | true | | progressBarColor | String (HEX color) | false | '#008080' |

Options Details

playerWidth : Lets you set the width of the player in pixels, when set to zero (the default value) the player's width adjusts to fit the content space width as prescribed by the parent.

playlist : Pass audio list as an array.

repeatAll : Enable repetition of all audio files in the playlist

playerVolume : Lets you set the player's volume programatically, from 0 to 1.

stopPlayback : Lets you programatically stop audio playback.

pausePlayback : Lets you programatically pause audio playback.

showAudioDuration : Let's the player show the total duration of the audio file. (This is true for playerWidth >= 400px)

showAudioData : Let's the player show the audio data, specifically artist & title (This is true for playerWidth >= 600px)

progressBarColor : Let's you choose colors for the progress bar from the following array of colors

['#008080', '#009688', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#00bcd4', '#4caf50', '#ff9800', '#607d8b', '#795548']

Player Width = 320px

xns-audio-player-simple

Player Width = 1300px

xns-audio-player-simple

Events

PlayerStatus Returns a string describing the status that the player is in, whether 'playing', 'paused' or 'stopped'

PlaybackTimer Returns an obect containing playing item's duration and current position in seconds:

{
	playingItemDuration: *Number*,
	playingItemTime: *Number*
}

Important Note:

To avoid playback and player seek issues you should make sure that where your audio files are served from are done so as a stream. More Here

Buy Me A Coffee