赞
踩
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。