html5音乐播放器模版,HTML5小型音乐播放器 - Aplayer

82d5913ac6b90bf2a8671326c6528b36.png

OPTION:

var option = {

element: document.getElementById('player1'), // Optional, player element

narrow: false, // Optional, narrow style

autoplay: true, // Optional, autoplay song(s), not supported by mobile browsers

showlrc: 0, // Optional, show lrc, can be 0, 1, 2, see: ###With lrc

mutex: true, // Optional, pause other players when this player playing

theme: '#e6d0b2', // Optional, theme color, default: #b7daff

mode: 'random', // Optional, play mode, can be `random` `single` `circulation`(loop) `order`(no loop), default: `circulation`

preload: 'metadata', // Optional, the way to load music, can be 'none' 'metadata' 'auto', default: 'auto'

listmaxheight: '513px', // Optional, max height of play list

music: { // Required, music info, see: ###With playlist

title: 'Preparation', // Required, music title

author: 'Hans Zimmer/Richard Harvey', // Required, music author

url: 'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.mp3', // Required, music url

pic: 'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.jpg', // Optional, music picture

lrc: '[00:00.00]lrc here\n[00:01.00]aplayer' // Optional, lrc, see: ###With lrc

}

}

API:

ap.play() // Resume play

ap.play(time) // Set currentTime

ap.pause() // Pause

ap.toggle() // Toggle between play and pause

ap.volume(percentage) // Set volume

ap.on(event, handler) // Event binding

ap.setMusic(index) // Switch music

ap.lrc // Lrc time and text

ap.playIndex // Current playing index

ap.audio // Return native audio, most native api are supported

ap.audio.currentTime // Returns the current playback position

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值