Skip to content

Commit 4727023

Browse files
committed
Fix bug: Symbol is not defined
1 parent 04e950b commit 4727023

4 files changed

Lines changed: 9 additions & 10 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.

dist/APlayer.min.js.map

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.4.3",
3+
"version": "1.4.4",
44
"description": "Wow, such a beautiful html5 music player",
55
"main": "dist/APlayer.min.js",
66
"scripts": {

src/APlayer.js

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

43
class APlayer {
54
/**
@@ -128,12 +127,12 @@
128127
// define APlayer events
129128
this.eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];
130129
this.event = {};
131-
for (let type of this.eventTypes) {
132-
this.event[type] = [];
130+
for (let i = 0; i < this.eventTypes.length; i++) {
131+
this.event[this.eventTypes[i]] = [];
133132
}
134133
this.trigger = (type) => {
135-
for (let func of this.event[type]) {
136-
func();
134+
for (let i = 0; i < this.event[type].length; i++) {
135+
this.event[type][i]();
137136
}
138137
}
139138
}
@@ -623,4 +622,4 @@
623622
else {
624623
window.APlayer = APlayer;
625624
}
626-
})();
625+
})([]);

0 commit comments

Comments
 (0)