fix destroy
This commit is contained in:
parent
bada61d667
commit
fc1a04b303
|
|
@ -446,12 +446,8 @@ class APlayer {
|
|||
instances.splice(instances.indexOf(this), 1);
|
||||
this.pause();
|
||||
this.container.innerHTML = '';
|
||||
clearInterval(this.playedTime);
|
||||
for (const key in this) {
|
||||
if (this.hasOwnProperty(key)) {
|
||||
delete this[key];
|
||||
}
|
||||
}
|
||||
this.audio.src = '';
|
||||
this.timer.destroy();
|
||||
}
|
||||
|
||||
handlePlayPromise (callback) {
|
||||
|
|
|
|||
|
|
@ -21,12 +21,10 @@ class Timer {
|
|||
}
|
||||
|
||||
init () {
|
||||
for (let i = 0; i < this.types.length; i++) {
|
||||
const type = this.types[i];
|
||||
if (type !== 'fps') {
|
||||
this[`init${type}Checker`]();
|
||||
}
|
||||
}
|
||||
this.types.map((item) => {
|
||||
this[`init${item}Checker`]();
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
initprogressChecker () {
|
||||
|
|
@ -79,8 +77,12 @@ class Timer {
|
|||
this[`enable${type}Checker`] = false;
|
||||
}
|
||||
|
||||
destroy (type) {
|
||||
this[`${type}Checker`] && clearInterval(this[`${type}Checker`]);
|
||||
destroy () {
|
||||
this.types.map((item) => {
|
||||
this[`enable${item}Checker`] = false;
|
||||
this[`${item}Checker`] && clearInterval(this[`${item}Checker`]);
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue