UNPKG

@bradmax/player-ng

Version:

Bradmax Player Angular module.

61 lines 2.29 kB
import { EventEmitter, Input, Output } from '@angular/core'; export class AbstractBradmaxPlayerComponent { constructor(service, elementRef, debug) { this.service = service; this.elementRef = elementRef; this.debug = debug; this.config = null; this.playing = new EventEmitter(); this.currentTimeChange = new EventEmitter(); this.complete = new EventEmitter(); if (this.debug) console.debug(AbstractBradmaxPlayerComponent.name + '.new()'); try { this.service.setup(this.elementRef.nativeElement); } catch (e) { throw e; } } ngOnInit() { if (this.debug) console.debug(AbstractBradmaxPlayerComponent.name + '.ngOnInit(', this.config, ')'); if (this.config == null || typeof this.config === undefined) throw new Error(AbstractBradmaxPlayerComponent.name + '.ngOnInit.config == ' + this.config); this.service.onPlaying.subscribe((e) => this.playing.emit(e)); this.service.onCurrentTimeChange.subscribe((e) => this.currentTimeChange.emit(e)); this.service.onComplete.subscribe((e) => this.complete.emit(e)); try { this.service.create(this.config); } catch (e) { throw e; } } ngOnDestroy() { if (this.debug) console.debug(AbstractBradmaxPlayerComponent.name + '.ngOnDestroy()'); try { this.service.destroy(); } catch (e) { throw e; } } } AbstractBradmaxPlayerComponent.propDecorators = { config: [{ type: Input }], playing: [{ type: Output }], currentTimeChange: [{ type: Output }], complete: [{ type: Output }] }; function AbstractBradmaxPlayerComponent_tsickle_Closure_declarations() { AbstractBradmaxPlayerComponent.prototype.config; AbstractBradmaxPlayerComponent.prototype.playing; AbstractBradmaxPlayerComponent.prototype.currentTimeChange; AbstractBradmaxPlayerComponent.prototype.complete; AbstractBradmaxPlayerComponent.prototype.service; AbstractBradmaxPlayerComponent.prototype.elementRef; AbstractBradmaxPlayerComponent.prototype.debug; } //# sourceMappingURL=abstract.component.js.map