Page 3 of 3

Re: MM5 API with WebSockets in NodeJS

Posted: Tue Jun 22, 2021 3:02 am
by MyVikes
Thanks Ludek

Where can i get additional info/documentation regarding the remoteRequest such as how to properly set the responseType? I've tried "json" and "application/json; charset=utf-8" to have the Content-Type set in the returned Headers but no luck. It's returning json text but just not recognized as such by Postman.

Re: MM5 API with WebSockets in NodeJS

Posted: Tue Jun 22, 2021 12:10 pm
by Ludek
Hi, response headers settings isn't supported yet, just responseBody (as in the code example).
I'll add it to my TODO

Re: MM5 API with WebSockets in NodeJS

Posted: Thu Jun 24, 2021 4:26 am
by MyVikes
thumbs up and thanks!

Re: MM5 API with WebSockets in NodeJS

Posted: Wed Jul 07, 2021 6:51 am
by Reto S.
MyVikes wrote: Thu Jun 24, 2021 4:26 am thumbs up and thanks!
HI @MyVikes

I see you are working on a Remote Control (for yourself!?!) or do you plan to release this publicly as an App or something?

Re: MM5 API with WebSockets in NodeJS

Posted: Wed Jul 07, 2021 5:49 pm
by MyVikes
TBD....i've thought about it but not sure if i want to support an app outside of my own use. :-)

i've been using it for a 1+ year and love it. except for ripping and cataloging my music collection i no longer use the MM interface.

It currently requires a VB.Net proxy communicating with the MM4 COM objects.

Primarily it allows me to quickly randomly select an album, select from n random albums (both using filters on genre, artist, etc. if desired), skip forward/backward, pause, progress to a point in the playing song, view current playlist and select a song to advance to, control MM volume and browse my library among other things. Also, it provides simple links to artist and album wiki along with a lyrics search. The song progress is a simple estimation based on the length of the song and a background timer but works fine for my use. I've thought of using an occasional ping of the server but haven't found it necessary.

I'm about 70% done migrating the VB.Net app to javascript leveraging the "app.listen(app, 'remoteRequest', (r) => {" web server recently added. So it would require just the MM5 addin javascript and then my app (Android only although i might use this as an opportunity to learn Swift). I'd written a React front end as a learning opportunity but after having it ~80% functional compared to the Android app i lost interest (:-)) and have stopped working on that.

The current performance is excellent and the MM5 javascript version thus far is comparable.

Here is a screenshot: https://www.dropbox.com/s/tqu04ewq37gtx ... 6.png?dl=0

Re: MM5 API with WebSockets in NodeJS

Posted: Fri Jul 30, 2021 3:30 am
by zombiefly
hello,
i posted another topic re: creating a monkeybridge appliance and was wondering if any of you talented people could assist? from what i can see, this websocket work covers most of the requirement. interested to hear your thoughts please! :D

viewtopic.php?f=27&t=99672&e=1&view=unread#unread

Re: MM5 API with WebSockets in NodeJS

Posted: Sun Aug 01, 2021 5:04 am
by MyVikes
I've completed my MM5 javascript Addin leveraging the POST request Ludek added, see post here by him on Mon Jun 14, 2021 11:08 am
OK, if you have already re-written the addons for MM5 then I guess that you have already own PC app for processing the remote requests.

If you are still interesed in processing requests via the MM5 server then install build 2415 and in the /sampleScripts/ folder there is 'remoteControl' sample script.

Currently it accepts only POST requests including MMCustomRequest in the request header and valid JSON as request body.
More in the code.

The test request available at: https://reqbin.com/uw0qc1ma (adjust port based on your settings in Options > Media Sharing)
Ludek
So this doesn't use WebSockets as that was a dead end. My client is a an Android app but I'd done a React POC so anything that serves up a nothing more than a SPA app would work.

My next task it to add controls to the app/javascript Addin to redirect the output to available Chromecast device but if I understand what you're doing with a DAC bridge that would not be necessary.

Re: MM5 API with WebSockets in NodeJS

Posted: Sun Aug 01, 2021 9:51 am
by Peke
Hi,
He ants that on Pi that is used as DAC bridge (MM play to multiple devices) on its 7" Display he have Remote MM5 Player controls and Metadata info. An access to Now Playing in MM5 would be a bonus.

I also upgraded his request to feature that one Device can be Controller for MM5 (Play To), list and show all control points that access MM5 over DLNA, ... and fetch Metadata for playing files. Haven't deep dived in DLNA and control point to see if you can remotely control that control point player, something for future builds.

Re: MM5 API with WebSockets in NodeJS

Posted: Mon Sep 20, 2021 8:07 am
by Ludek
I've completed my MM5 javascript Addin leveraging the POST request Ludek added..

So this doesn't use WebSockets as that was a dead end. My client is a an Android app but I'd done a React POC so anything that serves up a nothing more than a SPA app would work.

My next task it to add controls to the app/javascript Addin to redirect the output to available Chromecast device but if I understand what you're doing with a DAC bridge that would not be necessary.
Is your script/addon already available for testing?

As for adding another output device/list, see e.g. 'choosePlayer' in actions.js and related generateChoosePlayerSubmenu
and related code like

Code: Select all

var apl = app.sharing.getActivePlayer();
var lst = app.sharing.getAvailablePlayers();
....
app.sharing.setActivePlayerUUID( ... )

Re: MM5 API with WebSockets in NodeJS

Posted: Fri Apr 08, 2022 11:07 am
by ushmaelen
Ludek wrote: Mon Sep 20, 2021 8:07 am Is your script/addon already available for testing?

As for adding another output device/list, see e.g. 'choosePlayer' in actions.js and related generateChoosePlayerSubmenu
and related code like

Code: Select all

var apl = app.sharing.getActivePlayer();
var lst = app.sharing.getAvailablePlayers();
....
app.sharing.setActivePlayerUUID( ... )
Great to see remote control support in the Android app @Ludek. Pretty please