diff --git a/README.md b/README.md index 21a778f..614949b 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ poster: https://home-assistant.io/images/cast/splash.png # still image when str intersection: 0.75 # auto pause stream when less than 75% of video element is in the screen, 50% by default muted: false # disable sound, default true ui: true # custom video controls, default false -should_run_in_background: true # makes the component run when not displayed (ex. for quick video loading), default false +background: true # run stream when not displayed (ex. for quick video loading), default false ptz: # check full examples in wiki diff --git a/custom_components/webrtc/www/webrtc-camera.js b/custom_components/webrtc/www/webrtc-camera.js index 1261ad0..065be97 100644 --- a/custom_components/webrtc/www/webrtc-camera.js +++ b/custom_components/webrtc/www/webrtc-camera.js @@ -657,7 +657,7 @@ class WebRTCCamera extends HTMLElement { this.rendered = true; } - if (this.ws && this.config.should_run_in_background === true) return; + if (this.ws && this.config.background === true) return; if (!this.ws || [this.ws.CLOSING, this.ws.CLOSED].includes(this.ws.readyState)) { await this.initMSE(this.hass); @@ -665,7 +665,7 @@ class WebRTCCamera extends HTMLElement { } disconnectedCallback(){ - if (this.config.should_run_in_background !== true) { + if (this.config.background !== true) { this.subscriptions.forEach(callback => callback()); this.subscriptions = []; }