mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:51:20 -08:00
改变flv插件加载方式
This commit is contained in:
1 parent
efb5f69dab
commit
7264d0b3a3
11 files changed
+84
-103
No files matched your search
@@ -0,0 +1,17 @@
|
||||
export default class EventProxy {
|
||||
constructor() {
|
||||
this.destroyEvents = [];
|
||||
this.proxy = this.proxy.bind(this);
|
||||
}
|
||||
|
||||
proxy(target, name, callback, option = {}) {
|
||||
target.addEventListener(name, callback, option);
|
||||
this.destroyEvents.push(() => {
|
||||
target.removeEventListener(name, callback, option);
|
||||
});
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.destroyEvents.forEach(event => event());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user