Handle inifinity media duration (#11749)

This commit is contained in:
Paulus Schoutsen 2022-02-20 20:07:10 -08:00 committed by GitHub
parent afe044d152
commit 9b4c6eea63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -339,7 +339,7 @@ export const computeMediaControls = (
};
export const formatMediaTime = (seconds: number | undefined): string => {
if (seconds === undefined) {
if (seconds === undefined || seconds === Infinity) {
return "";
}

View File

@ -205,7 +205,9 @@ class BarMediaPlayer extends LitElement {
`
)}
</div>
${this.narrow
${stateObj?.attributes.media_duration === Infinity
? html``
: this.narrow
? html`<mwc-linear-progress></mwc-linear-progress>`
: html`
<div class="progress">