Skip to content

Commit

Permalink
fix hls.js to work correctly
Browse files Browse the repository at this point in the history
fix `Event` to `@export {HlsEvents}`
  • Loading branch information
azu committed Feb 9, 2018
1 parent 4485ec0 commit 45a34e3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/hls.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {hlsDefaultConfig} from './config';
import {FragmentTracker} from './helper/fragment-tracker';

import HlsEvents from './events';

import EventEmitter from 'events';

// polyfill for IE11
Expand Down Expand Up @@ -50,7 +49,7 @@ export default class Hls {
* @type {HlsEvents}
*/
static get Events() {
return Event;
return HlsEvents;
}

/**
Expand Down Expand Up @@ -239,7 +238,7 @@ export default class Hls {
*/
destroy() {
logger.log('destroy');
this.trigger(Event.DESTROYING);
this.trigger(HlsEvents.DESTROYING);
this.detachMedia();
this.coreComponents.concat(this.networkControllers).forEach(component => {component.destroy();});
this.url = null;
Expand All @@ -254,15 +253,15 @@ export default class Hls {
attachMedia(media) {
logger.log('attachMedia');
this.media = media;
this.trigger(Event.MEDIA_ATTACHING, {media: media});
this.trigger(HlsEvents.MEDIA_ATTACHING, {media: media});
}

/**
* Detach from the media
*/
detachMedia() {
logger.log('detachMedia');
this.trigger(Event.MEDIA_DETACHING);
this.trigger(HlsEvents.MEDIA_DETACHING);
this.media = null;
}

Expand All @@ -275,7 +274,7 @@ export default class Hls {
logger.log(`loadSource:${url}`);
this.url = url;
// when attaching to a source URL, trigger a playlist load
this.trigger(Event.MANIFEST_LOADING, {url: url});
this.trigger(HlsEvents.MANIFEST_LOADING, {url: url});
}

/**
Expand Down

0 comments on commit 45a34e3

Please sign in to comment.