Added camera functionality

This commit is contained in:
2022-07-13 23:05:27 +00:00
parent 466a5eb5e7
commit e4a65f3077
18 changed files with 355 additions and 223 deletions

View File

@@ -103,21 +103,32 @@ export const ConnectionMixin = (SuperClass) => {
})();
}
private async _reregister(newData = {}) {
await this.connection.sendMessage({
type: "browser_mod/reregister",
deviceID: this.deviceID,
data: {
...this.devices[this.deviceID],
...newData,
},
});
}
get meta() {
if (!this.registered) return null;
return this.devices[this.deviceID].meta;
}
set meta(value) {
(async () => {
await this.connection.sendMessage({
type: "browser_mod/reregister",
deviceID: this.deviceID,
data: {
...this.devices[this.deviceID],
meta: value,
}
})
})()
this._reregister({ meta: value });
}
get cameraEnabled() {
if (!this.registered) return null;
return this.devices[this.deviceID].camera;
}
set cameraEnabled(value) {
this._reregister({ camera: value });
}
sendUpdate(data) {