Skip to content

Commit 5206eed

Browse files
committed
deprecate vars outside class
1 parent 82b7f77 commit 5206eed

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/APlayer.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
(() => {
2-
let APlayers = [];
1+
((instances) => {
32

43
class APlayer {
54
/**
@@ -404,8 +403,8 @@
404403

405404
this.setMusic(0);
406405

407-
APlayers.push(this);
408-
};
406+
instances.push(this);
407+
}
409408

410409
/**
411410
* Set music
@@ -557,9 +556,9 @@
557556

558557
// pause other players (Thanks @Aprikyblue)
559558
if (this.option.mutex) {
560-
for (let i = 0; i < APlayers.length; i++) {
561-
if (this != APlayers[i]) {
562-
APlayers[i].pause();
559+
for (let i = 0; i < instances.length; i++) {
560+
if (this != instances[i]) {
561+
instances[i].pause();
563562
}
564563
}
565564
}
@@ -613,4 +612,4 @@
613612
else {
614613
window.APlayer = APlayer;
615614
}
616-
})();
615+
})([]);

0 commit comments

Comments
 (0)