renamed isPlaying to isProgressing
This commit is contained in:
@@ -12,7 +12,7 @@ export class SeekBar extends SignalWatcher(LitElement) {
|
|||||||
progressIntervalMillis: number = 1000;
|
progressIntervalMillis: number = 1000;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
isPlaying: boolean = false;
|
isProgressing: boolean = false;
|
||||||
|
|
||||||
timerID: number = -1;
|
timerID: number = -1;
|
||||||
private rangeRef = createRef<SlRange>();
|
private rangeRef = createRef<SlRange>();
|
||||||
@@ -38,13 +38,13 @@ export class SeekBar extends SignalWatcher(LitElement) {
|
|||||||
${ref(this.rangeRef)}
|
${ref(this.rangeRef)}
|
||||||
@sl-change="${(event: CustomEvent) => {
|
@sl-change="${(event: CustomEvent) => {
|
||||||
this.setProgressValue((event.target as SlRange).value);
|
this.setProgressValue((event.target as SlRange).value);
|
||||||
if(this.isPlaying) this.startProgress();
|
if(this.isProgressing) this.startProgress();
|
||||||
else this.stopProgress();
|
else this.stopProgress();
|
||||||
}}"
|
}}"
|
||||||
@sl-input="${() => {
|
@sl-input="${() => {
|
||||||
var playing = this.isPlaying;
|
var progressing = this.isProgressing;
|
||||||
this.stopProgress();
|
this.stopProgress();
|
||||||
this.isPlaying = playing;
|
this.isProgressing = progressing;
|
||||||
}}"></sl-range>
|
}}"></sl-range>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -55,12 +55,12 @@ export class SeekBar extends SignalWatcher(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopProgress(){
|
stopProgress(){
|
||||||
this.isPlaying = false;
|
this.isProgressing = false;
|
||||||
clearInterval(this.timerID);
|
clearInterval(this.timerID);
|
||||||
}
|
}
|
||||||
|
|
||||||
startProgress(){
|
startProgress(){
|
||||||
this.isPlaying = true;
|
this.isProgressing = true;
|
||||||
this.timerID = setInterval(this.incrementProgressValue, this.progressIntervalMillis);
|
this.timerID = setInterval(this.incrementProgressValue, this.progressIntervalMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user