35 lines
1.8 KiB
TypeScript
35 lines
1.8 KiB
TypeScript
class Player {
|
|
private readonly playSvg = 'M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM6.79 5.093A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z';
|
|
private readonly pauseSvg = 'M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM6.25 5C5.56 5 5 5.56 5 6.25v3.5a1.25 1.25 0 1 0 2.5 0v-3.5C7.5 5.56 6.94 5 6.25 5zm3.5 0c-.69 0-1.25.56-1.25 1.25v3.5a1.25 1.25 0 1 0 2.5 0v-3.5C11 5.56 10.44 5 9.75 5z';
|
|
|
|
private readonly nowPlaying: HTMLElement;
|
|
private readonly rewButton: HTMLElement;
|
|
private readonly playButton: HTMLElement;
|
|
private readonly playButtonPath: HTMLElement;
|
|
private readonly ffwButton: HTMLElement;
|
|
private readonly cover: HTMLElement;
|
|
private readonly seriesName: HTMLElement;
|
|
private readonly episodeName: HTMLElement;
|
|
private readonly timeDisplay: HTMLElement;
|
|
private readonly volumeSlider: HTMLElement;
|
|
private ticker: number | undefined;
|
|
|
|
public constructor() {
|
|
setInterval
|
|
const controls = document.getElementById('controls');
|
|
const timeVolume = document.getElementById('timeVolume');
|
|
this.nowPlaying = document.getElementById('nowPlaying');
|
|
this.rewButton = controls.getElementsByTagName('button').item(0);
|
|
this.playButton = controls.getElementsByTagName('button').item(1);
|
|
this.playButtonPath = this.playButton.getElementsByTagName('path').item(0);
|
|
this.ffwButton = controls.getElementsByTagName('button').item(2);
|
|
this.cover = this.nowPlaying.getElementsByTagName('img').item(0);
|
|
this.seriesName = this.nowPlaying.getElementsByTagName('span').item(0);
|
|
this.episodeName = this.nowPlaying.getElementsByTagName('span').item(1);
|
|
this.timeDisplay = timeVolume.getElementsByTagName('span').item(0);
|
|
this.volumeSlider = timeVolume.getElementsByTagName('input').item(0);
|
|
this.howl = null;
|
|
this.ticker = null;
|
|
}
|
|
}
|