diff --git a/app/cyp.js b/app/cyp.js index 8f93972..821f9e4 100644 --- a/app/cyp.js +++ b/app/cyp.js @@ -1110,7 +1110,15 @@ class Player extends Component { const DOM = this._dom; DOM.play.addEventListener("click", _ => this._app.mpd.command("play")); - DOM.pause.addEventListener("click", _ => this._app.mpd.command("pause 1")); + DOM.pause.addEventListener("click", _ => { + if (!this.multiuser_warned) { + this.multiuser_warned = true; + document.getElementById("warningpopup").style.display="block"; + } + else { + this._app.mpd.command("pause 1"); + } + }); DOM.prev.addEventListener("click", _ => this._app.mpd.command("previous")); DOM.next.addEventListener("click", _ => this._app.mpd.command("next")); @@ -1130,8 +1138,24 @@ class Player extends Component { this._app.mpd.command(`seekcur ${elapsed}`); }); - DOM.volume.addEventListener("input", e => this._app.mpd.command(`setvol ${e.target.valueAsNumber}`)); - DOM.mute.addEventListener("click", _ => this._app.mpd.command(`setvol ${this._toggleVolume}`)); + DOM.volume.addEventListener("input", e => { + if (!this.multiuser_warned) { + this.multiuser_warned = true; + document.getElementById("warningpopup").style.display="block"; + } + else { + this._app.mpd.command(`setvol ${e.target.valueAsNumber}`); + } + }); + DOM.mute.addEventListener("click", _ => { + if (!this.multiuser_warned) { + this.multiuser_warned = true; + document.getElementById("warningpopup").style.display="block"; + } + else { + this._app.mpd.command(`setvol ${this._toggleVolume}`) + } + }); } _dispatchSongChange(detail) { diff --git a/app/index.html b/app/index.html index ec16b4d..0d09bef 100644 --- a/app/index.html +++ b/app/index.html @@ -5,10 +5,100 @@ Control Your Player + +
+ × +
+
+

Warning

+

Be aware there may be other users listening to the same stream.

+

Pausing or changing volume on the server will affect them as well.

+

Please avoid server-side pausing or volume change if possible.

+

You can find client-side volume and pause control in the Settings Panel.

+ +
+
+