![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@liripeng/vue-audio-player
Advanced tools
npm i -S @liripeng/vue-audio-player
import { AudioPlayer } from '@liripeng/vue-audio-player'
import '@liripeng/vue-audio-player/lib/vue-audio-player.css'
components: {
AudioPlayer
}
import AudioPlayer from '@liripeng/vue-audio-player'
import '@liripeng/vue-audio-player/lib/vue-audio-player.css'
Vue.use(AudioPlayer)
<template>
<div>
<AudioPlayer :audio-list="audioList"
:before-play="onBeforePlay" />
</div>
</template>
<script>
import { AudioPlayer } from '@liripeng/vue-audio-player'
import '@liripeng/vue-audio-player/lib/vue-audio-player.css'
export default {
components: {
AudioPlayer
},
data() {
return {
audioList: [
'http://txh-cdn.96qbhy.com/20180817175211dtC1vE3z.mp3',
'http://txh-cdn.96qbhy.com/20181106105737sOcozMqw.mp3'
]
}
},
methods: {
// 播放前做的事
onBeforePlay(next) {
console.log('这里可以做一些事情...')
next() // 开始播放
}
}
}
</script>
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
audio-list | 音频播放列表 | Array | - |
show-play-button | 是否显示播放按钮 | Boolean | true |
show-prev-button | 是否显示上一首按钮 | Boolean | true |
show-next-button | 是否显示下一首按钮 | Boolean | true |
show-progress-bar | 是否显示进度条 | Boolean | true |
isLoop | 是否列表循环播放 | Boolean | true |
progressInterval | 进度更新间隔 | Number | 1000 |
before-play | 点击播放前的回调函数 调用 next() 后开始播放 | (next)=>void | - |
before-prev | 点击上一首前的回调函数 调用 next() 后开始播放上一首 | (next)=>void | - |
before-next | 点击下一首前的回调函数 调用 next() 后开始播放下一首 | (next)=>void | - |
事件 | 说明 | 回调 |
---|---|---|
play | 点击播放后触发 | - |
pause | 点击暂停后触发 | - |
play-prev | 点击上一首后触发 | - |
play-next | 点击下一首后触发 | - |
playing | 播放中每 progressInterval 秒触发 | - |
timeupdate | 当前的播放位置发送改变时触发 | event |
loadedmetadata | 当媒介元素的持续时间以及其它媒介已加载数据时运行脚本触发 | event |
ended | 音频播放结束后触发 | event |
变量 | 说明 | 默认值 |
---|---|---|
currentPlayIndex | 当前播放的音频索引 | 0 |
isPlaying | 音频是否正在播放 | false |
duration | 音频持续时间 | - |
currentTime | 音频当前播放时间 | - |
使用 ref
调用, 更多请自行查看组件 data
方法 | 说明 | 回调 |
---|---|---|
play | 开始播放 | - |
pause | 暂停播放 | - |
playPrev | 播放上一首 | - |
playNext | 播放下一首 | - |
使用 ref
调用, 更多请自行查看组件 methods
版本 | 说明 | 更新时间 |
---|---|---|
v1.0.4 | 1. 修复 isLoop 无效 2. 简化类名 3. 支持原生 CSS | 2019-10-16 |
MIT
使用过程中发现任何问题都可以提 Issue
,也非常欢迎提 PR
FAQs
Simple and practical Vue audio player component for PC mobile terminal(简单实用的 PC 移动端的 Vue 音频播放器组件)
The npm package @liripeng/vue-audio-player receives a total of 2,843 weekly downloads. As such, @liripeng/vue-audio-player popularity was classified as popular.
We found that @liripeng/vue-audio-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.