update components

This commit is contained in:
Luke Pulverenti 2016-01-18 14:07:26 -05:00
parent 047fd2b438
commit 6f96e87248
22 changed files with 472 additions and 303 deletions

View file

@ -3,19 +3,18 @@
*/
import Event from '../events';
import EventHandler from '../event-handler';
import {ErrorTypes, ErrorDetails} from '../errors';
import URLHelper from '../utils/url';
import AttrList from '../utils/attr-list';
//import {logger} from '../utils/logger';
class PlaylistLoader {
class PlaylistLoader extends EventHandler {
constructor(hls) {
this.hls = hls;
this.onml = this.onManifestLoading.bind(this);
this.onll = this.onLevelLoading.bind(this);
hls.on(Event.MANIFEST_LOADING, this.onml);
hls.on(Event.LEVEL_LOADING, this.onll);
super(hls,
Event.MANIFEST_LOADING,
Event.LEVEL_LOADING);
}
destroy() {
@ -24,15 +23,14 @@ class PlaylistLoader {
this.loader = null;
}
this.url = this.id = null;
this.hls.off(Event.MANIFEST_LOADING, this.onml);
this.hls.off(Event.LEVEL_LOADING, this.onll);
EventHandler.prototype.destroy.call(this);
}
onManifestLoading(event, data) {
onManifestLoading(data) {
this.load(data.url, null);
}
onLevelLoading(event, data) {
onLevelLoading(data) {
this.load(data.url, data.level, data.id);
}