New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@liripeng/vue-audio-player

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liripeng/vue-audio-player

## 线上演示 ![image](https://github.com/1014156094/vue-audio-player/blob/master/public/qrcode.png)

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7K
decreased by-9.1%
Maintainers
1
Weekly downloads
 
Created
Source

Vue音频播放器组件

线上演示

image

特性

  • 经过童星汇APP线上业务检验的组件
  • 完善的文档和示例
  • 支持进度条拖拽(PC 端需引入这个库模拟 Touch 事件,链接:https://github.com/hammerjs/touchemulator)

安装项目

npm install

开始开发

npm run serve

生产打包

npm run build

注意事项

组件CSS使用 less 预编译语言

快速开始

<template>
  <div>
    <AudiPlayer :audio-list="audioList" />
  </div>
</template>

<script>
import AudiPlayer from '@/components/audio-player'

export default {
  components: {
    AudiPlayer
  },
  data() {
    return {
      audioList: [
        'http://txh-cdn.96qbhy.com/20180817175211dtC1vE3z.mp3',
        'http://txh-cdn.96qbhy.com/20181106105737sOcozMqw.mp3'
      ]
    }
  }
}
</script>

Props

参数说明类型默认值
audio-list音频播放列表Array-
before-play播放前的回调函数
调用 done() 后开始播放
(done)=>void-
before-prev上一首前的回调函数
调用 done() 后开始播放上一首
(done)=>void-
before-next下一首前的回调函数
调用 done() 后开始播放下一首
(done)=>void-
isLoop是否列表循环播放Booleantrue

Event

事件说明回调
ended音频播放结束后触发-

组件data

方法说明回调
currentPlayIndex当前播放的音频索引0
isPlaying音频是否正在播放false
duration音频持续时间-
currentTime音频当前播放时间-

更多请自行使用 ref 打印组件的 data 查看

组件methods

方法说明回调
play开始播放-
pause暂停播放-
playPrev播放上一首-
playNext播放下一首-

更多请自行使用 ref 打印组件的 methods 查看

作者

小七

FAQs

Package last updated on 09 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc