You are reading a single comment by @Gordon and its replies.
Click here to read the full conversation.
-
Okay, I saw that code in the BG widget and I am using it in my app.
However, I do not know how to trigger it.The problem is, that I have to read what is playing, when I start the app.
Otherwise I cannot show title information and I do not know what the musicstate is.global.GB = function(j) { if (debug ==1) print("global.GB"); switch (j.t) { case "musicinfo": musicInfo = j; draw(); break; case "musicstate": musicState = j.state; draw(); break; } };
You just need to define a function called
GB
:More info on what form the data takes is at http://www.espruino.com/Gadgetbridge