From e6698a135099348b62d295e904580f4341447958 Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 10 Jul 2020 20:52:13 -0300 Subject: basic command relay across socket clients --- players.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'players.js') diff --git a/players.js b/players.js index 959bf27..7b11a3b 100644 --- a/players.js +++ b/players.js @@ -255,20 +255,15 @@ export class ControllableMPVPlayer extends MPVPlayer { } setPause(val) { - const wasPaused = this.isPaused - this.isPaused = !!val - - if (this.isPaused !== wasPaused) { - this.sendCommand('cycle', 'pause') + if (!!val !== this.isPaused) { + this.togglePause() } - - // For some reason "set pause" doesn't seem to be working anymore: - // this.sendCommand('set', 'pause', this.isPaused) } setLoop(val) { - this.isLooping = !!val - this.sendCommand('set', 'loop', this.isLooping) + if (!!val !== this.isLooping) { + this.toggleLoop() + } } async kill() { -- cgit 1.3.0-6-gf8a5