Skip to content

Commit 18a3ef0

Browse files
committed
change default pic way
1 parent 9928750 commit 18a3ef0

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

dist/APlayer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aplayer",
3-
"version": "1.2.12",
3+
"version": "1.2.13",
44
"description": "Wow, such a beautiful html5 music player",
55
"main": "APlayer.js",
66
"scripts": {

src/APlayer.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ APlayer.prototype.init = function () {
5151

5252
// fill in HTML
5353
this.element.innerHTML = ''
54-
+ '<div class="aplayer-pic">'
54+
+ '<div class="aplayer-pic"' + (this.music.pic ? ' style="background-image: url(&quot;' + encodeURI(this.music.pic) + '&quot;);"' : '') + '>'
5555
+ '<div class="aplayer-button aplayer-pause aplayer-hide">'
5656
+ '<i class="demo-icon aplayer-icon-pause"></i>'
5757
+ '</div>'
@@ -90,11 +90,6 @@ APlayer.prototype.init = function () {
9090
+ '</div>'
9191
+ '</div>';
9292

93-
// music pic
94-
if (this.music.pic) {
95-
this.element.getElementsByClassName('aplayer-pic')[0].style.backgroundImage = 'url(' + encodeURI(this.music.pic) + ')';
96-
}
97-
9893
// fill in lrc
9994
if (this.option.showlrc) {
10095
this.element.classList.add('aplayer-withlrc');

0 commit comments

Comments
 (0)