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

hxz-mini-audio-player

v1.0.3

Published

hxz-mini-audio-player是一款基于vue3的迷你音乐播放器,界面全部自定义,支持上一曲下一曲、支持调整音量,通过滑块或者将鼠标放到滑块上滚动滚轮,可以实现音量大小控制。点击封面图,播放音乐,播放中封面图会自动旋转。支持播放暂停事件。

Downloads

2

Readme

hxz-mini-audio-player

hxz-mini-audio-player是一款基于vue3的音乐播放器,支持最多九首歌曲,至少一首,界面全部自定义,支持上一曲下一曲、支持调整音量,通过滑块或者将鼠标放到滑块上滚动滚轮,可以实现播放进度控制和音量大小控制。点击封面图,播放对应的音乐,音乐专辑图会显示在下方并自动播放,播放中封面图会自动旋转。

打包发布

npm run build
npm publish

安装

// 安装本插件
npm install hxz-mini-audio-player --save

局部引入本插件(建议)

// 引入本插件
import HxzMiniAudioPlayer from "hxz-mini-audio-player/dist/hxz-mini-audio-player"
import 'hxz-mini-audio-player/dist/style.css'

// 在components中加入本插件
components: {HxzMiniAudioPlayer},

全局引入本插件

// main.js 引入本插件
import HxzMiniAudioPlayer from "hxz-mini-audio-player/dist/hxz-mini-audio-player"
import 'hxz-mini-audio-player/dist/style.css'

app.use(HxzMiniAudioPlayer)

使用插件

// 在template中加入本插件
<hxz-mini-audio-player />

参数

参数名 | 默认值 | 类型 | 解释 :---: | :---: | :---: | :---: list | [] | Array | 播放列表,list的item参数见下方

上传接口参数

参数名 | 类型 | 解释 :---: | :---: | :---: title | String | 歌曲名,必填 cover | String | 封面图路径,必填 url | String | 歌曲地址,必填

事件

事件名 | 参数 | 解释 :---: | :---: | :---: play | null | 播放器播放事件 pause | null | 播放器暂停事件

方法

方法名 | 参数 | 解释 :---: | :---: | :---: onPlayPause | state | 播放方法

使用示例

效果:

hxz-mini-audio-player

代码:

<template>
  <div>
    <HxzMiniAudioPlayer :list="list" @play="play" @pause="pause"></HxzMiniAudioPlayer>
  </div>
</template>

<script setup>
function play() {
  alert('开始播放')
}

function pause() {
  alert('暂停播放')
}

const list = [
  {
    cover: '/songs/cover1.png',
    title: '盛夏',
    url: '/songs/song1.mp3',
  },
  {
    cover: '/songs/cover2.png',
    title: '当潮不让',
    url: '/songs/song2.mp3',
  },
  {
    cover: '/songs/cover3.png',
    title: '果汁分你一半',
    url: '/songs/song3.mp3',
  },
  {
    cover: '/songs/cover4.png',
    title: '逆战',
    url: '/songs/song4.mp3',
  },
  {
    cover: '/songs/cover5.png',
    title: '淋雨一直走',
    url: '/songs/song5.mp3',
  },
  {
    cover: '/songs/cover6.png',
    title: '浮夸',
    url: '/songs/song6.mp3',
  },
  {
    cover: '/songs/cover7.png',
    title: '让我欢喜让我忧',
    url: '/songs/song7.mp3',
  },
  {
    cover: '/songs/cover8.png',
    title: '练习',
    url: '/songs/song8.mp3',
  },
  {
    cover: '/songs/cover9.png',
    title: '屋顶',
    url: '/songs/song9.mp3',
  },
]
</script>