Skip to content

Commit

Permalink
Don't show LoadingSpinner and BigPlayButton at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
gorillamoe committed May 25, 2022
1 parent 6d0e84c commit 2f8004a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.0.8",
"version": "0.0.9",
"name": "@stroeer/stroeer-videoplayer-livestream-ui",
"description": "Ströer Videoplayer Livestream UI",
"main": "dist/StroeerVideoplayer-livestream-ui.cjs.js",
Expand Down
16 changes: 11 additions & 5 deletions src/UI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,24 +232,30 @@ class UI {

const showLoading = (modus: boolean): void => {
if (modus) {
hideElement(overlayContainer)
showElement(loadingSpinnerContainer)
} else {
hideElement(loadingSpinnerContainer)
}
}

StroeerVideoplayer.loading = (modus: boolean): void => {
showLoading(modus)
}

StroeerVideoplayer.showBigPlayButton = (modus: boolean): void => {
const showBigPlayButton = (modus: boolean): void => {
if (modus) {
hideElement(loadingSpinnerContainer)
showElement(overlayContainer)
} else {
hideElement(overlayContainer)
}
}

StroeerVideoplayer.loading = (modus: boolean): void => {
showLoading(modus)
}

StroeerVideoplayer.showBigPlayButton = (modus: boolean): void => {
showBigPlayButton(modus)
}

videoEl.addEventListener('waiting', () => {
showLoading(true)
})
Expand Down

0 comments on commit 2f8004a

Please sign in to comment.