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

@dw/d-audio

v1.0.21

Published

d-audio

Downloads

1

Readme

d-audio

插件演示地址: http://www.daiwei.org/components/d-audio

播放器接入hexo博客: http://www.daiwei.org/hexo-blog

使用者:

http://fm.zkbhj.com/#carousel-example-generic

简洁的音乐播放器插件

新版本d-audio上线

  • 新增进度条随封面背景变化而变化

食用方法

安装:

  npm install d-audio

引入

import dAudio from 'd-audio'
const d = new dAudio ({
    ele: '#d-audio',
    src: '地址',
    imageurl: '地址',
    name: '音乐名字',
    singer: '歌手名字',
    next: function () {},
    ended: function () {}
})

es5安装: 如果不再es6环境下的代码,可以引入该项目根目录的lib文件夹下,引入js和css即可

<!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="http://daiwei.org/components/d-audio/lib/d-audio.css">
    <title>d-audio</title>
  </head>
  <body>
    <div class="d-audio" style="width: 300px;"></div>
  </body>
  <script src="http://daiwei.org/components/d-audio/lib/d-audio.js"></script>
  <script>
    var myAudio = new Daudio({
      ele: '.d-audio',
      ...
    })
  </script>
  </html>

参数

// 音乐append的元素
ele: '#d-audio',

// 音乐封面
imageurl: 'http://www.daiwei.org/sunmmer.jpg',

// 音乐地址
src: '',

// 音乐名字
name: '',

// 音乐歌手
singer: '',

// 是否显示进度信息
showprogress: true,

// '' 就是默认状态, cricle则是初始化就是圆形且可以旋转
initstate: '',

// 是否循环
loop: false,

// 音乐播放结束事件,可设置播放下一首音乐
ended: () => {},

// 音乐下一曲的点击事件触发,需要配合checkAudio体现切歌的效果
next: () => {}

实例化对象方法

// 显示loading
d.showLoading()

// 隐藏loading
d.hideLoading()

// 播放
d.play()

// 暂停
d.pause()

// 播放暂停
d.playPause()

// 切歌曲 播放下一首  音频地址,封面地址,名字,歌手
d.checkAudio(src, imageurl, name, singer)