Handle inifinity media duration

This commit is contained in:
Paulus Schoutsen 2022-02-20 19:53:42 -08:00
parent afe044d152
commit 3db626a07b
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 => { export const formatMediaTime = (seconds: number | undefined): string => {
if (seconds === undefined) { if (seconds === undefined || seconds === Infinity) {
return ""; return "";
} }

View File

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