File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const ap1 = new APlayer ( {
22 element : document . getElementById ( 'player1' ) ,
3- narrow : false ,
3+ mini : false ,
44 autoplay : true ,
55 lrc : false ,
66 mutex : true ,
@@ -37,7 +37,7 @@ ap1.on('error', function () {
3737
3838const ap2 = new APlayer ( {
3939 element : document . getElementById ( 'player2' ) ,
40- narrow : true ,
40+ mini : true ,
4141 autoplay : false ,
4242 lrc : false ,
4343 mutex : true ,
@@ -52,7 +52,7 @@ const ap2 = new APlayer({
5252
5353const ap3 = new APlayer ( {
5454 element : document . getElementById ( 'player3' ) ,
55- narrow : false ,
55+ mini : false ,
5656 autoplay : false ,
5757 lrc : 3 ,
5858 mutex : true ,
@@ -68,7 +68,7 @@ const ap3 = new APlayer({
6868
6969const ap4 = new APlayer ( {
7070 element : document . getElementById ( 'player4' ) ,
71- narrow : false ,
71+ mini : false ,
7272 autoplay : false ,
7373 lrc : false ,
7474 mutex : true ,
@@ -98,7 +98,7 @@ const ap4 = new APlayer({
9898
9999const ap5 = new APlayer ( {
100100 element : document . getElementById ( 'player5' ) ,
101- narrow : false ,
101+ mini : false ,
102102 autoplay : false ,
103103 lrc : 3 ,
104104 mutex : true ,
Original file line number Diff line number Diff line change @@ -471,6 +471,7 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height - 6;
471471 cursor : pointer ;
472472 transition : all 0.2s ease ;
473473 overflow : hidden ;
474+ margin : 0 ;
474475
475476 & :first-child {
476477 border-top : none ;
Original file line number Diff line number Diff line change @@ -3,13 +3,16 @@ export default (options) => {
33 // default options
44 const defaultOption = {
55 container : options . element || document . getElementsByClassName ( 'aplayer' ) [ 0 ] ,
6- narrow : false ,
6+ mini : false ,
77 autoplay : false ,
88 mutex : true ,
99 lrc : 0 ,
10+ preload : 'auto' ,
1011 theme : '#b7daff' ,
1112 loop : 'all' ,
1213 order : 'list' ,
14+ volume : 0.7 ,
15+ listFolded : false ,
1316 } ;
1417 for ( const defaultKey in defaultOption ) {
1518 if ( defaultOption . hasOwnProperty ( defaultKey ) && ! options . hasOwnProperty ( defaultKey ) ) {
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class APlayer {
4444 if ( this . arrow ) {
4545 this . container . classList . add ( 'aplayer-arrow' ) ;
4646 }
47- if ( this . options . narrow ) {
47+ if ( this . options . mini ) {
4848 this . container . classList . add ( 'aplayer-narrow' ) ;
4949 }
5050
@@ -101,7 +101,7 @@ class APlayer {
101101
102102 initAudio ( ) {
103103 this . audio = document . createElement ( 'audio' ) ;
104- this . audio . preload = this . options . preload ? this . options . preload : 'auto' ;
104+ this . audio . preload = this . options . preload ;
105105
106106 for ( let i = 0 ; i < this . events . audioEvents . length ; i ++ ) {
107107 this . audio . addEventListener ( this . events . audioEvents [ i ] , ( ) => {
@@ -178,7 +178,7 @@ class APlayer {
178178 }
179179 } ) ;
180180
181- this . volume ( this . user . get ( 'volume' ) , true , true ) ;
181+ this . volume ( this . user . get ( 'volume' ) , true ) ;
182182 }
183183
184184 switchAudio ( index ) {
You can’t perform that action at this time.
0 commit comments