Skip to content

Commit

Permalink
Merge pull request #58 from dermotduffy/fix-clip-error
Browse files Browse the repository at this point in the history
Use a classic video tag if it's not HLS
  • Loading branch information
dermotduffy authored Sep 6, 2021
2 parents 199a4b8 + 45fef46 commit fb906a6
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions src/frigate-hass-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,18 +783,35 @@ export class FrigateCard extends LitElement {
/>`
: ``}
${this._view.is('clip')
? html`<ha-hls-player
.hass=${this._hass}
.url=${resolvedMedia.url}
class="frigate-card-viewer"
title="${mediaToRender.title}"
muted
controls
playsinline
allow-exoplayer
?autoplay="${autoplay}"
>
</ha-hls-player>`
? resolvedMedia?.mime_type.toLowerCase() == 'application/x-mpegurl'
? html`<ha-hls-player
.hass=${this._hass}
.url=${resolvedMedia.url}
class="frigate-card-viewer"
title="${mediaToRender.title}"
muted
controls
playsinline
allow-exoplayer
?autoplay="${autoplay}"
>
</ha-hls-player>`
: html`<video
class="frigate-card-viewer"
title="${mediaToRender.title}"
muted
controls
playsinline
@play=${() => {
this._clipPlaying = true;
}}
@pause=${() => {
this._clipPlaying = false;
}}
?autoplay="${autoplay}"
>
<source src="${resolvedMedia.url}" type="${resolvedMedia.mime_type}" />
</video>`
: html`<img
src=${resolvedMedia.url}
class="frigate-card-viewer"
Expand Down

0 comments on commit fb906a6

Please sign in to comment.