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

music-box-core

v1.1.5

Published

A Vue.js project for music-box-core by zzh 2019-6-14 16:24

Downloads

22

Readme

music-box-core

Music box play

Build Setup

插件使用方法

 npm i music-box-core

在main.js中引入

import MusicBox from 'music-box-core';

Vue.use(MusicBox);

在需要使用的.vue文件中直接使用组件

<music-box></music-box>即可

使用如下所示:

    <music-box :singList='list' :setVolume='getval' :repeatState="state" :setProgress='getprogress' @totalTime='totaltime' @currentTime='getime' ref='musicbox'></music-box>

所有参数说明 重要参数


singList:表示往组件传递一歌曲路径的数组,如['http://xxxxx','http://xxxx'],也可以只传递单首歌曲的路径,如'http://xxxx';


setVolume:设置播放音量,可接受0-1之间的数值,0最小,1最大,默认值0.5


repeatState:播放状态选择,例如,单曲循环,列表循环等。。。该状态有四个值'allCircle','currentCircle','playListOneTimesStop','randomPlay',分别代表所有歌曲循环,当前歌曲循环,仅播放列表一次,随机播放


setProgress:设置播放进度,进度范围0~[歌曲最大秒数]之间

@totalTime:事件,组件传出的当前歌曲的最大秒数以及格式化为分秒的时间数

 @currentTime:组件传出的当前歌曲的播放进度秒数以及格式化为分秒的时间数

 @error:播放失败的错误事件,传出播放失败的一些信息

 @isPlay:是否播放状态,返回值为bolen类型

 @isNoVoice:是否静音状态,返回值为bolen类型

 @ended:当前歌曲是否播放完毕状态,返回值为bolen类型

 在<music-box ref='musicbox'></music-box>绑定ref钩子后,可操作组件
 可操作的方法有常见的播放,暂停,上一曲,下一曲,静音,

播放以及暂停方法调用

调用一次暂停,在调用一次恢复播放
this.refs.musicbox.playing()

上一曲以及下一曲调用

this.refs.musicbox.next();
this.refs.musicbox.last()

静音方法,调用一次静音,在调用一次恢复播放

this.refs.musicbox.novoice()

git Hub docs for music-box-core.