File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,16 +3,18 @@ export default (options) => {
33 // default options
44 const defaultOption = {
55 container : options . element || document . getElementsByClassName ( 'aplayer' ) [ 0 ] ,
6- mini : false ,
6+ mini : options . narrow || false ,
77 autoplay : false ,
88 mutex : true ,
9- lrc : 0 ,
9+ lrc : options . showlrc || 0 ,
1010 preload : 'auto' ,
1111 theme : '#b7daff' ,
1212 loop : 'all' ,
1313 order : 'list' ,
1414 volume : 0.7 ,
1515 listFolded : false ,
16+ listMaxHeight : options . listmaxheight ,
17+ audio : options . music
1618 } ;
1719 for ( const defaultKey in defaultOption ) {
1820 if ( defaultOption . hasOwnProperty ( defaultKey ) && ! options . hasOwnProperty ( defaultKey ) ) {
@@ -24,6 +26,13 @@ export default (options) => {
2426 options . audio = [ options . audio ] ;
2527 }
2628
29+ options . audio . map ( ( item ) => {
30+ item . name = item . name || item . title ;
31+ item . artist = item . artist || item . author ;
32+ item . cover = item . cover || item . pic ;
33+ return item ;
34+ } ) ;
35+
2736 if ( options . audio . length <= 1 && options . loop === 'one' ) {
2837 options . loop = 'all' ;
2938 }
You can’t perform that action at this time.
0 commit comments