fix: initialized the button text at creation
This commit is contained in:
@@ -56,6 +56,11 @@ export class BaseUI {
|
||||
private createPlayButton(): void {
|
||||
const playButton = document.createElement("button");
|
||||
playButton.className = this.prefixClass + "-playButton";
|
||||
if (this.video.paused) {
|
||||
playButton.innerText = "play";
|
||||
} else {
|
||||
playButton.innerText = "pause";
|
||||
}
|
||||
|
||||
this.video.addEventListener("play", function (): void {
|
||||
playButton.innerText = "pause";
|
||||
|
||||
Reference in New Issue
Block a user