1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-01-18 14:07:26 -05:00
parent 4572a9dbaf
commit 576ca0442c
22 changed files with 472 additions and 303 deletions

View file

@ -3,14 +3,13 @@
*/
import Event from '../events';
import EventHandler from '../event-handler';
import {ErrorTypes, ErrorDetails} from '../errors';
class FragmentLoader {
class FragmentLoader extends EventHandler {
constructor(hls) {
this.hls = hls;
this.onfl = this.onFragLoading.bind(this);
hls.on(Event.FRAG_LOADING, this.onfl);
super(hls, Event.FRAG_LOADING);
}
destroy() {
@ -18,10 +17,10 @@ class FragmentLoader {
this.loader.destroy();
this.loader = null;
}
this.hls.off(Event.FRAG_LOADING, this.onfl);
EventHandler.prototype.destroy.call(this);
}
onFragLoading(event, data) {
onFragLoading(data) {
var frag = data.frag;
this.frag = frag;
this.frag.loaded = 0;

View file

@ -3,16 +3,15 @@
*/
import Event from '../events';
import EventHandler from '../event-handler';
import {ErrorTypes, ErrorDetails} from '../errors';
class KeyLoader {
class KeyLoader extends EventHandler {
constructor(hls) {
this.hls = hls;
super(hls, Event.KEY_LOADING);
this.decryptkey = null;
this.decrypturl = null;
this.ondkl = this.onDecryptKeyLoading.bind(this);
hls.on(Event.KEY_LOADING, this.ondkl);
}
destroy() {
@ -20,10 +19,10 @@ class KeyLoader {
this.loader.destroy();
this.loader = null;
}
this.hls.off(Event.KEY_LOADING, this.ondkl);
EventHandler.prototype.destroy.call(this);
}
onDecryptKeyLoading(event, data) {
onKeyLoading(data) {
var frag = this.frag = data.frag,
decryptdata = frag.decryptdata,
uri = decryptdata.uri;

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);
}