diff --git a/demo/demo.js b/demo/demo.js index 5445591..45666c9 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -2,7 +2,7 @@ const ap1 = new APlayer({ element: document.getElementById('player1'), narrow: false, autoplay: true, - showlrc: false, + lrc: false, mutex: true, theme: '#e6d0b2', preload: 'metadata', @@ -39,7 +39,7 @@ const ap2 = new APlayer({ element: document.getElementById('player2'), narrow: true, autoplay: false, - showlrc: false, + lrc: false, mutex: true, theme: '#e6d0b2', music: { @@ -54,7 +54,7 @@ const ap3 = new APlayer({ element: document.getElementById('player3'), narrow: false, autoplay: false, - showlrc: 3, + lrc: 3, mutex: true, theme: '#615754', music: { @@ -70,7 +70,7 @@ const ap4 = new APlayer({ element: document.getElementById('player4'), narrow: false, autoplay: false, - showlrc: false, + lrc: false, mutex: true, theme: '#ad7a86', music: [ @@ -99,7 +99,7 @@ const ap5 = new APlayer({ element: document.getElementById('player5'), narrow: false, autoplay: false, - showlrc: 3, + lrc: 3, mutex: true, theme: '#ad7a86', listFolded: true, diff --git a/src/js/options.js b/src/js/options.js index 35b4663..7598d74 100644 --- a/src/js/options.js +++ b/src/js/options.js @@ -6,7 +6,7 @@ export default (options) => { narrow: false, autoplay: false, mutex: true, - showlrc: 0, + lrc: 0, theme: '#b7daff', loop: 'all', order: 'list', diff --git a/src/js/player.js b/src/js/player.js index 1d5c9f6..465167f 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -30,7 +30,7 @@ class APlayer { this.randomOrder = utils.randomOrder(this.options.music.length); - if (this.options.showlrc) { + if (this.options.lrc) { this.container.classList.add('aplayer-withlrc'); } if (this.options.music.length > 1) { @@ -49,7 +49,7 @@ class APlayer { // save lrc this.container = this.options.container; - if (this.options.showlrc === 2 || this.options.showlrc === true) { + if (this.options.lrc === 2 || this.options.lrc === true) { const lrcEle = this.container.getElementsByClassName('aplayer-lrc-content'); for (let i = 0; i < lrcEle.length; i++) { if (this.options.music[i]) { @@ -67,10 +67,10 @@ class APlayer { this.template.time.classList.add('aplayer-time-narrow'); } - if (this.options.showlrc) { + if (this.options.lrc) { this.lrc = new Lrc({ container: this.template.lrc, - async: this.options.showlrc === 3, + async: this.options.lrc === 3, content: this.options.music.map((item) => item.lrc), player: this, });