vue 沿着弧线拖拽进度条_基于VUE和JS手写的移动端H5自定义音乐播放器(直线进度条和圆形滚动进度条)...

export default{

name:'music-view',

components: {

},

props: {

type:'',

},

data () {return{

cTime:'00:00', //已播放时间

dTime: '00:00', //总播放时间

play: false, //播放暂停按钮

audioHttp: 'http://up.mcyt.net/?down/46426.mp3', //音频链接

}

},

mounted () {

const music= this.$refs.player //音频所在对象

const musicBar = this.$refs.runbar //颜色进度条所在对象

const musicWidth = this.$refs.runfatbar.offsetWidth //底部进度条总宽

const rightCircle = this.$refs.yuanright.style //圆形滚动进度条右边

const leftCircle = this.$refs.yuanleft.style //圆形滚动进度条左边

//获得音频加载完成可播放时的处理

music.addEventListener('canplay', () =>{

const musicTime= music.duration //获得音频时长

const branch = Math.floor(mus

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值