added browser-player card

This commit is contained in:
2019-06-27 12:26:39 +02:00
parent 3e704e97d1
commit 4149759dd1
4 changed files with 173 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
import {deviceID} from "/card-tools/deviceId"
import "./browser-player"
class BrowserMod {
constructor() {
@@ -73,13 +75,19 @@ class BrowserMod {
this.player.volume = msg.volume_level;
}
mute(msg) {
if (msg.mute === undefined)
msg.mute = !this.player.muted;
this.player.muted = Boolean(msg.mute)
}
update() {
update(msg=null) {
if(!this.conn) return;
if(msg)
if(msg.entity_id)
this.entity_id = msg.entity_id;
this.conn.sendMessage({
type: 'browser_mod/update',
deviceID: deviceID,