Getting Started/Discord RPC Plugin

To discuss development of addons / skins / customization of MediaMonkey v5 / v2024

Moderadores: jiri, drakinite, Addon Administrators

PetrCBR
Mensagens: 1793
Registado: terça mar 07, 2006 5:31 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por PetrCBR »

I understand ... you can put them into folder together with your script, but question is how to load them (as we don't use any 3rd party scripts and we don't use require) and i can help with that if you need ... but i need any sample library you need to use in your script.
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
malkierian
Mensagens: 159
Registado: quarta mai 10, 2017 1:38 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por malkierian »

Alright, this is the folder that was created with the libraries and their prerequisites.

https://www.dropbox.com/s/4pm0aveljkj8z ... s.zip?dl=0

These were installed into the project using node/NPM.
PetrCBR
Mensagens: 1793
Registado: terça mar 07, 2006 5:31 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por PetrCBR »

Hmm ... it will probably require to somehow include node runtime into script folder .. will try.
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
PetrCBR
Mensagens: 1793
Registado: terça mar 07, 2006 5:31 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por PetrCBR »

Hmm ... implement node.js core will not be easy ... it is using so much methods from native code of Node :-/.
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
malkierian
Mensagens: 159
Registado: quarta mai 10, 2017 1:38 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por malkierian »

I will appreciate anything you can do, but if necessary, I will figure out how to interface with Discord directly, since it is open-source, and I probably only need certain aspects of the API.
TIV73
Mensagens: 248
Registado: sábado nov 12, 2011 1:31 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por TIV73 »

From the looks of it you are going for a native implementation, but in case you still use the workaround via .net you might want to have a look at the github page for MediaMonkey.Net again. I just pushed several updates to the dev branch , which is pretty much a complete rewrite of the original plugin which and now uses an asynchronous implementation of most calls and offers event based updates to avoid having to constantly poll mediamonkey for updates.
Garion525

Re: Getting Started/Discord RPC Plugin

Mensagem por Garion525 »

Let me know when you get this working, I have been looking everywhere for a plugin for MM and Discord.
malkierian
Mensagens: 159
Registado: quarta mai 10, 2017 1:38 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por malkierian »

So, I finally revisited this, and discovered a Node app called Browserify that seems to do just about everything I would have needed, except that the method I need to use to actually broadcast RPC changes uses a module that isn't available through Browserify (Node's net module). I'm in contact with the author of the JS framework for Discord's RPC, as well as on the Browserify IRC channel, to see if there's a way around that, but the only other option I could see is if you were to use Electron, which bridges Node and Chromium in one platform (which, though I don't know for sure as I've never transferred a strictly Chromium project to Electron, would probably be ridiculous to do for just one script).

EDIT: to be more specific, Node's net module is TCP connections, which is only experimentally available in Chrome, and I don't know if that is also available in chromium.
mahduse
Mensagens: 2
Registado: quinta dez 31, 2020 3:56 am

Re: Getting Started/Discord RPC Plugin

Mensagem por mahduse »

Hi I started to use the api as stated, but I get only the app.* stuff working.
When I tried to start stop play...

Código: Selecionar todos

var request = {id:56,method:'Runtime.evaluate',params:{expression:'player.playAsync()'}}  
I get the following JSON back....

Código: Selecionar todos

{
  "id": 56,
  "result": {
    "result": {
      "type": "object",
      "className": "Object",
      "description": "Object",
      "objectId": "{\"injectedScriptId\":1,\"id\":1}"
    }
  }
}
Do you have some better samples?
Is the API still up2date?
Probably the usage is not working....
mahduse
Mensagens: 2
Registado: quinta dez 31, 2020 3:56 am

Re: Getting Started/Discord RPC Plugin

Mensagem por mahduse »

Sorry it is all working so far... no reply required anymore
Peke
Mensagens: 18647
Registado: terça jun 10, 2003 7:21 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por Peke »

Hi,
Even I wish you Happy Monkeying and New Year?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Imagem
Imagem
Imagem
How to attach PICTURE/SCREENSHOTS to forum posts
Hayatory
Mensagens: 1
Registado: segunda dez 20, 2021 12:19 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por Hayatory »

mahduse Escreveu: quinta dez 31, 2020 4:12 am Sorry it is all working so far... no reply required anymore
Did you ever upload it anywhere?
msfreed
Mensagens: 1
Registado: sexta out 13, 2023 7:24 pm

Re: Getting Started/Discord RPC Plugin

Mensagem por msfreed »

TIV73 :

Really new to the MM5 thing. I was looking and saw an offer for some Example code on how to communicate with MM5 Via C#... I would appreciate that very very much!!! I am new so I cannot PM... :(

Thank you in advance :)
Responder