Merge pull request #339 from dermotduffy/webrtc-fixes
Fixes for native WebRTC support
This commit is contained in:
@@ -701,6 +701,7 @@ export class FrigateCardViewerCarousel extends FrigateCardMediaCarousel {
|
|||||||
? html`<frigate-card-ha-hls-player
|
? html`<frigate-card-ha-hls-player
|
||||||
allow-exoplayer
|
allow-exoplayer
|
||||||
aria-label="${mediaToRender.title}"
|
aria-label="${mediaToRender.title}"
|
||||||
|
?autoplay=${false}
|
||||||
controls
|
controls
|
||||||
muted
|
muted
|
||||||
playsinline
|
playsinline
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ customElements.whenDefined('ha-camera-stream').then(() => {
|
|||||||
return this._url
|
return this._url
|
||||||
? html` <frigate-card-ha-hls-player
|
? html` <frigate-card-ha-hls-player
|
||||||
${ref(this._playerRef)}
|
${ref(this._playerRef)}
|
||||||
|
?autoplay=${false}
|
||||||
playsinline
|
playsinline
|
||||||
.allowExoPlayer=${this.allowExoPlayer}
|
.allowExoPlayer=${this.allowExoPlayer}
|
||||||
.muted=${this.muted}
|
.muted=${this.muted}
|
||||||
@@ -110,6 +111,8 @@ customElements.whenDefined('ha-camera-stream').then(() => {
|
|||||||
}
|
}
|
||||||
if (this.stateObj.attributes.frontend_stream_type === STREAM_TYPE_WEB_RTC) {
|
if (this.stateObj.attributes.frontend_stream_type === STREAM_TYPE_WEB_RTC) {
|
||||||
return html`<frigate-card-ha-web-rtc-player
|
return html`<frigate-card-ha-web-rtc-player
|
||||||
|
${ref(this._playerRef)}
|
||||||
|
?autoplay=${false}
|
||||||
playsinline
|
playsinline
|
||||||
.muted=${this.muted}
|
.muted=${this.muted}
|
||||||
.controls=${this.controls}
|
.controls=${this.controls}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
import { TemplateResult, css, html } from 'lit';
|
import { TemplateResult, css, html } from 'lit';
|
||||||
import { Ref, createRef, ref } from 'lit/directives/ref';
|
import { Ref, createRef, ref } from 'lit/directives/ref';
|
||||||
import { customElement } from 'lit/decorators.js';
|
import { customElement } from 'lit/decorators.js';
|
||||||
import { dispatchMediaShowEvent } from '../common.js';
|
import { dispatchErrorMessageEvent, dispatchMediaShowEvent } from '../common.js';
|
||||||
|
|
||||||
customElements.whenDefined('ha-hls-player').then(() => {
|
customElements.whenDefined('ha-hls-player').then(() => {
|
||||||
@customElement('frigate-card-ha-hls-player')
|
@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
|
// - https://github.com/home-assistant/frontend/blob/dev/src/components/ha-hls-player.ts
|
||||||
// =====================================================================================
|
// =====================================================================================
|
||||||
protected render(): TemplateResult {
|
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`
|
return html`
|
||||||
<video
|
<video
|
||||||
${ref(this._videoRef)}
|
${ref(this._videoRef)}
|
||||||
|
?autoplay=${this.autoPlay}
|
||||||
.muted=${this.muted}
|
.muted=${this.muted}
|
||||||
?playsinline=${this.playsInline}
|
?playsinline=${this.playsInline}
|
||||||
?controls=${this.controls}
|
?controls=${this.controls}
|
||||||
|
|||||||
Reference in New Issue
Block a user