3 Commits
Author SHA1 Message Date
DIYgod 1386beaa27 Fix UMD bug 2016-09-26 01:50:13 +08:00
DIYgod 62d146a9dc Scrollbar style, close #72 2016-09-20 12:12:21 +08:00
DIYgod fa0017c55d random mode: from first music; play list: click to jump 2016-09-19 11:38:24 +08:00
8 changed files with 35 additions and 9 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ var option = {
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: 'metadata' in Desktop, 'none' in mobile
listmaxhight: '513px', // Optional, max height of play list
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
+1
View File
@@ -107,6 +107,7 @@ var ap5 = new APlayer({
mutex: true,
theme: '#ad7a86',
mode: 'random',
listmaxheight: '80px',
music: [
{
title: 'あっちゅ~ま青春!',
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "aplayer",
"version": "1.5.1",
"version": "1.5.3",
"description": "Wow, such a beautiful html5 music player",
"main": "dist/APlayer.min.js",
"scripts": {
+14 -4
View File
@@ -1,4 +1,4 @@
console.log("\n %c APlayer 1.5.1 %c http://aplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;");
console.log("\n %c APlayer 1.5.3 %c http://aplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;");
require('./APlayer.scss');
@@ -190,7 +190,7 @@ class APlayer {
</div>`;
if (this.multiple) {
eleHTML += `
<div class="aplayer-list" ${this.option.listmaxhight ? `style="max-height: ${this.option.listmaxhight}` : ``}">
<div class="aplayer-list" ${this.option.listmaxheight ? `style="max-height: ${this.option.listmaxheight}` : ``}">
<ol>`;
for (let i = 0; i < this.option.music.length; i++) {
eleHTML += `
@@ -406,7 +406,13 @@ class APlayer {
});
}
this.setMusic(0);
if (this.mode === 'random') {
let random = parseInt(Math.random() * this.option.music.length);
this.setMusic(random);
}
else {
this.setMusic(0);
}
instances.push(this);
}
@@ -441,6 +447,10 @@ class APlayer {
this.audio.currentTime = 0;
}
if (this.multiple) {
this.element.getElementsByClassName('aplayer-list')[0].scrollTop = indexMusic * 33;
}
// get this audio object
if ((this.multiple && !this.audios[indexMusic]) || this.playIndex === -1) {
this.audio = document.createElement("audio");
@@ -775,4 +785,4 @@ class APlayer {
}
}
export {APlayer};
module.exports = APlayer;
+14
View File
@@ -343,6 +343,20 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
height: 0 !important;
}
&::-webkit-scrollbar{
width: 5px;
}
&::-webkit-scrollbar-track{
background-color: #f9f9f9;
}
&::-webkit-scrollbar-thumb{
border-radius: 3px;
background-color: #eee;
}
&::-webkit-scrollbar-thumb:hover{
background-color: #ccc;
}
ol {
list-style-type: none;
margin: 0;
+1
View File
@@ -14,6 +14,7 @@ module.exports = {
output: {
path: BUILD_PATH,
filename: 'APlayer.min.js',
library: 'APlayer',
libraryTarget: 'umd',
umdNamedDefine: true
},