mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-08-08 18:22:50 +00:00
Added toasts and UI update on device connection
This commit is contained in:
parent
5328087d64
commit
3142709d7f
17 changed files with 640 additions and 121 deletions
|
@ -202,8 +202,15 @@ export class FCastSession {
|
|||
case Opcode.SetSpeed:
|
||||
this.emitter.emit("setspeed", JSON.parse(body) as SetSpeedMessage);
|
||||
break;
|
||||
case Opcode.Version:
|
||||
this.emitter.emit("version", JSON.parse(body) as VersionMessage);
|
||||
break;
|
||||
case Opcode.Ping:
|
||||
this.send(Opcode.Pong);
|
||||
this.emitter.emit("ping");
|
||||
break;
|
||||
case Opcode.Pong:
|
||||
this.emitter.emit("pong");
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -228,5 +235,8 @@ export class FCastSession {
|
|||
this.emitter.on("seek", (body: SeekMessage) => { emitter.emit("seek", body) });
|
||||
this.emitter.on("setvolume", (body: SetVolumeMessage) => { emitter.emit("setvolume", body) });
|
||||
this.emitter.on("setspeed", (body: SetSpeedMessage) => { emitter.emit("setspeed", body) });
|
||||
this.emitter.on("version", (body: VersionMessage) => { emitter.emit("version", body) });
|
||||
this.emitter.on("ping", () => { emitter.emit("ping") });
|
||||
this.emitter.on("pong", () => { emitter.emit("pong") });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue