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
|
||||
allow-exoplayer
|
||||
aria-label="${mediaToRender.title}"
|
||||
?autoplay=${false}
|
||||
controls
|
||||
muted
|
||||
playsinline
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user