Merge pull request #339 from dermotduffy/webrtc-fixes

Fixes for native WebRTC support
This commit is contained in:
Dermot Duffy
2022-02-07 21:20:12 -08:00
committed by GitHub
3 changed files with 11 additions and 1 deletions
+1
View File
@@ -701,6 +701,7 @@ export class FrigateCardViewerCarousel extends FrigateCardMediaCarousel {
? html`<frigate-card-ha-hls-player
allow-exoplayer
aria-label="${mediaToRender.title}"
?autoplay=${false}
controls
muted
playsinline
+3
View File
@@ -99,6 +99,7 @@ customElements.whenDefined('ha-camera-stream').then(() => {
return this._url
? html` <frigate-card-ha-hls-player
${ref(this._playerRef)}
?autoplay=${false}
playsinline
.allowExoPlayer=${this.allowExoPlayer}
.muted=${this.muted}
@@ -110,6 +111,8 @@ customElements.whenDefined('ha-camera-stream').then(() => {
}
if (this.stateObj.attributes.frontend_stream_type === STREAM_TYPE_WEB_RTC) {
return html`<frigate-card-ha-web-rtc-player
${ref(this._playerRef)}
?autoplay=${false}
playsinline
.muted=${this.muted}
.controls=${this.controls}
+7 -1
View File
@@ -12,7 +12,7 @@
import { TemplateResult, css, html } from 'lit';
import { Ref, createRef, ref } from 'lit/directives/ref';
import { customElement } from 'lit/decorators.js';
import { dispatchMediaShowEvent } from '../common.js';
import { dispatchErrorMessageEvent, dispatchMediaShowEvent } from '../common.js';
customElements.whenDefined('ha-hls-player').then(() => {
@customElement('frigate-card-ha-hls-player')
@@ -53,9 +53,15 @@ customElements.whenDefined('ha-hls-player').then(() => {
// - https://github.com/home-assistant/frontend/blob/dev/src/components/ha-hls-player.ts
// =====================================================================================
protected render(): TemplateResult {
if (this._error) {
// Use native Frigate card error handling, and attach the entityid to
// clarify which camera the error refers to.
return dispatchErrorMessageEvent(this, this._error);
}
return html`
<video
${ref(this._videoRef)}
?autoplay=${this.autoPlay}
.muted=${this.muted}
?playsinline=${this.playsInline}
?controls=${this.controls}