diff --git a/src/components/ha-camera-stream.ts b/src/components/ha-camera-stream.ts index 1a73c3c673..5a10ec764e 100644 --- a/src/components/ha-camera-stream.ts +++ b/src/components/ha-camera-stream.ts @@ -115,23 +115,18 @@ class HaCameraStream extends LitElement { // Fallback when unable to fetch stream url return true; } - if ( - !isComponentLoaded(this.hass!, "stream") || - !supportsFeature(this.stateObj!, CAMERA_SUPPORT_STREAM) - ) { + if (!supportsFeature(this.stateObj!, CAMERA_SUPPORT_STREAM)) { // Steaming is not supported by the camera so fallback to MJPEG stream return true; } if ( - this.stateObj!.attributes.frontend_stream_type === STREAM_TYPE_WEB_RTC && - typeof RTCPeerConnection === "undefined" + this.stateObj!.attributes.frontend_stream_type === STREAM_TYPE_WEB_RTC ) { - // Stream requires WebRTC but browser does not support, so fallback to - // MJPEG stream. - return true; + // Browser support required for WebRTC + return typeof RTCPeerConnection === "undefined"; } - // Render stream - return false; + // Server side stream component required for HLS + return !isComponentLoaded(this.hass!, "stream"); } private async _getStreamUrl(): Promise {