Skip to content

Commit

Permalink
Change background option name
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Jun 7, 2021
1 parent cc3337f commit 8ecf178
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions custom_components/webrtc/www/webrtc-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,15 +657,15 @@ 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);
}
}

disconnectedCallback(){
if (this.config.should_run_in_background !== true) {
if (this.config.background !== true) {
this.subscriptions.forEach(callback => callback());
this.subscriptions = [];
}
Expand Down

0 comments on commit 8ecf178

Please sign in to comment.