add creatWorker

This commit is contained in:
Harvey Zack committed 2018-12-19 17:36:28 +08:00
1 parent 6cc89edcd9
commit 39f8c157ac
9 files changed
+222 -56

No files matched your search

@@ -1,6 +1,7 @@
import Emitter from 'tiny-emitter';
import checkSupport from './utils/checkSupport';
import EventProxy from './eventProxy';
import CreatWorker from './creatWorker';
import CreatMediaSource from './creatMediaSource';
import FlvParse from './flvParse';
import * as utils from './utils';
@@ -39,12 +40,14 @@ class Flv extends Emitter {
load() {
this.events = new EventProxy(this);
this.workers = new CreatWorker(this);
this.mediaSource = new CreatMediaSource(this);
this.flvData = new FlvParse(this);
}
destroy() {
this.events.destroy();
this.workers.killAll();
Flv.instances.splice(Flv.instances.indexOf(this), 1);
this.emit('destroy');
}