@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
44 lines (43 loc) • 1.09 kB
JavaScript
import { BaseProvider, PlayerStates } from '../../core/esl-media-provider';
export class BaseProviderMock extends BaseProvider {
constructor() {
super(...arguments);
this._state = PlayerStates.UNINITIALIZED;
}
bind() {
this._state = PlayerStates.UNSTARTED;
this._ready = Promise.resolve();
this._ready.then(() => this.component._onReady());
}
unbind() {
this._state = PlayerStates.UNINITIALIZED;
this.component._onDetach();
this._ready = null;
}
get duration() {
return 100;
}
get currentTime() {
return 0;
}
get defaultAspectRatio() {
return 0;
}
pause() {
this._state = PlayerStates.PAUSED;
this.component._onPaused();
}
play() {
this._state = PlayerStates.PLAYING;
this.component._onPlay();
}
stop() {
this._state = PlayerStates.ENDED;
this.component._onEnded();
}
seekTo(pos) { }
get state() {
return this._state;
}
}
BaseProviderMock.providerName = 'mock';