Rename stream_type to frontend_stream_type (#10298)

This commit is contained in:
Allen Porter 2021-10-18 03:42:34 -07:00 committed by GitHub
parent a8ff98b808
commit 84533b8843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ class HaCameraStream extends LitElement {
this.stateObj &&
(changedProps.get("stateObj") as CameraEntity | undefined)?.entity_id !==
this.stateObj.entity_id &&
this.stateObj!.attributes.stream_type === STREAM_TYPE_HLS
this.stateObj!.attributes.frontend_stream_type === STREAM_TYPE_HLS
) {
this._forceMJPEG = undefined;
this._url = undefined;
@ -84,7 +84,7 @@ class HaCameraStream extends LitElement {
.alt=${`Preview of the ${computeStateName(this.stateObj)} camera.`}
/>`;
}
if (this.stateObj.attributes.stream_type === STREAM_TYPE_HLS && true) {
if (this.stateObj.attributes.frontend_stream_type === STREAM_TYPE_HLS) {
return this._url
? html` <ha-hls-player
autoplay
@ -97,7 +97,7 @@ class HaCameraStream extends LitElement {
></ha-hls-player>`
: html``;
}
if (this.stateObj.attributes.stream_type === STREAM_TYPE_WEB_RTC) {
if (this.stateObj.attributes.frontend_stream_type === STREAM_TYPE_WEB_RTC) {
return html` <ha-web-rtc-player
autoplay
playsinline
@ -123,7 +123,7 @@ class HaCameraStream extends LitElement {
return true;
}
if (
this.stateObj!.attributes.stream_type === STREAM_TYPE_WEB_RTC &&
this.stateObj!.attributes.frontend_stream_type === STREAM_TYPE_WEB_RTC &&
typeof RTCPeerConnection === "undefined"
) {
// Stream requires WebRTC but browser does not support, so fallback to

View File

@ -17,7 +17,7 @@ interface CameraEntityAttributes extends HassEntityAttributeBase {
access_token: string;
brand: string;
motion_detection: boolean;
stream_type: string;
frontend_stream_type: string;
}
export interface CameraEntity extends HassEntityBase {

View File

@ -86,7 +86,7 @@ class MoreInfoCamera extends LitElement {
supportsFeature(this.stateObj!, CAMERA_SUPPORT_STREAM) &&
// The stream component for HLS streams supports a server-side pre-load
// option that client initiated WebRTC streams do not
this.stateObj!.attributes.stream_type === STREAM_TYPE_HLS
this.stateObj!.attributes.frontend_stream_type === STREAM_TYPE_HLS
) {
// Fetch in background while we set up the video.
this._fetchCameraPrefs();