Updates
This commit is contained in:
@@ -100,6 +100,10 @@
|
|||||||
visibilityDuration = data.param1 || visibilityDefault;
|
visibilityDuration = data.param1 || visibilityDefault;
|
||||||
showSongInfo();
|
showSongInfo();
|
||||||
});
|
});
|
||||||
|
SBdispatcher.on('musicPlaying-hide', data => {
|
||||||
|
visibilityDuration = -1;
|
||||||
|
SetVisibility(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectws() {
|
function connectws() {
|
||||||
@@ -123,6 +127,9 @@
|
|||||||
// Song changes
|
// Song changes
|
||||||
case ("playbackStatus.nowPlayingItemDidChange"):
|
case ("playbackStatus.nowPlayingItemDidChange"):
|
||||||
UpdateSongInfo(data);
|
UpdateSongInfo(data);
|
||||||
|
if (visibilityDuration != "-1") {
|
||||||
|
showSongInfo();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Progress bar moves
|
// Progress bar moves
|
||||||
@@ -149,6 +156,12 @@
|
|||||||
SetVisibility(false);
|
SetVisibility(false);
|
||||||
}, visibilityDuration * 1000);
|
}, visibilityDuration * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (visibilityDuration == "-1") {
|
||||||
|
setTimeout(() => {
|
||||||
|
SetVisibility(false);
|
||||||
|
}, visibilityDefault * 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateSongInfo(data) {
|
function UpdateSongInfo(data) {
|
||||||
@@ -169,9 +182,6 @@
|
|||||||
document.getElementById("albumArtBack").src = albumArtUrl;
|
document.getElementById("albumArtBack").src = albumArtUrl;
|
||||||
document.getElementById("backgroundImageBack").src = albumArtUrl;
|
document.getElementById("backgroundImageBack").src = albumArtUrl;
|
||||||
}, 2 * animationSpeed * 500);
|
}, 2 * animationSpeed * 500);
|
||||||
|
|
||||||
showSongInfo()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateTextLabel(div, text) {
|
function UpdateTextLabel(div, text) {
|
||||||
@@ -204,7 +214,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function UpdatePlaybackState(data) {
|
function UpdatePlaybackState(data) {
|
||||||
console.log(data);
|
|
||||||
switch (data.state) {
|
switch (data.state) {
|
||||||
case ("paused"):
|
case ("paused"):
|
||||||
case ("stopped"):
|
case ("stopped"):
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ public class CPHInline
|
|||||||
if (args.ContainsKey("wsParam3")) message.Add("param3",args["wsParam3"]);
|
if (args.ContainsKey("wsParam3")) message.Add("param3",args["wsParam3"]);
|
||||||
if (args.ContainsKey("wsParam4")) message.Add("param4",args["wsParam4"]);
|
if (args.ContainsKey("wsParam4")) message.Add("param4",args["wsParam4"]);
|
||||||
if (args.ContainsKey("wsParam5")) message.Add("param5",args["wsParam5"]);
|
if (args.ContainsKey("wsParam5")) message.Add("param5",args["wsParam5"]);
|
||||||
|
if (args.ContainsKey("wsParam6")) message.Add("param6",args["wsParam6"]);
|
||||||
|
if (args.ContainsKey("wsParam7")) message.Add("param7",args["wsParam7"]);
|
||||||
|
if (args.ContainsKey("wsParam8")) message.Add("param8",args["wsParam8"]);
|
||||||
|
if (args.ContainsKey("wsParam9")) message.Add("param9",args["wsParam9"]);
|
||||||
|
|
||||||
var jsonMessage = JsonConvert.SerializeObject(message);
|
var jsonMessage = JsonConvert.SerializeObject(message);
|
||||||
CPH.WebsocketBroadcastJson(jsonMessage);
|
CPH.WebsocketBroadcastJson(jsonMessage);
|
||||||
|
|||||||
Reference in New Issue
Block a user