分离部分工具函数

This commit is contained in:
Harvey Zack committed 2018-12-20 12:25:02 +08:00
1 parent 8ad0605e1a
commit 4658d3f4b4
6 files changed
+38 -37

No files matched your search

+4 -8
View File
@@ -12,8 +12,11 @@ class Flv extends Emitter {
constructor(options) {
super();
this.options = Object.assign({}, Flv.DEFAULTS, options);
console.log(this.options);
checkSupport(this.options);
this.events = new EventProxy(this);
this.workers = new CreatWorker(this);
this.mediaSource = new CreatMediaSource(this);
this.flvData = new FlvParse(this);
id += 1;
this.id = id;
Flv.instances.push(this);
@@ -38,13 +41,6 @@ class Flv extends Emitter {
return utils;
}
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();