INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Service Plugin  (Read 3578 times)

dhiggins

  • Regular Member
  • World Citizen
  • ***
  • Posts: 126
Service Plugin
« on: March 31, 2022, 12:13:34 pm »

Hi


I'm working up a simple plugin to allow Google Assistant to control MC playback.

I can completely control playback using the MCWS service, so that's really nice.

Now, I'm trying to decide the best way to host it.

I have a couple options


1) package the app up as a windows service that would be installed as any other windows service
or
2) package it up as a MC plugin that would run pretty much like the other services in JR (Tivo, or the Media server for instance).


I'm leaning toward (2) being generally easier for people to actually use...


But I'm not having much luck finding info on how to put together a plugin that runs like one of those JRiver "services"



Is that a doable thing?


and if so, anyone have any pointers to details about implementing one?


Many thanks!
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72534
  • Where did I put my teeth?
Re: Service Plugin
« Reply #1 on: March 31, 2022, 12:34:14 pm »

Great!  Thanks!

Download any plugin and open the mjp file with notepad.  You'll see how it's done.  Bob can help.

MJP stands for Media Jukebox Package.  It's a text file and gets executed by the current version of MC.
Logged

dhiggins

  • Regular Member
  • World Citizen
  • ***
  • Posts: 126
Re: Service Plugin
« Reply #2 on: March 31, 2022, 12:49:45 pm »

Hey JimH

Thanks for the pointer! I'll check that out


Darin
Logged

dhiggins

  • Regular Member
  • World Citizen
  • ***
  • Posts: 126
Re: Service Plugin
« Reply #3 on: April 01, 2022, 01:37:52 pm »

Hi


With your tip, I found a plugin called YARS, and was able to tweak it a bit, and get it to compile. Once I added the proper regsitry entries, I can run MC and my plugin displays a msgbox from within MC so I know that MC is successfully loading the plugin. Perfect!


So I remove the reg entries and built up a MJP file, but I always get a "Invalid Package File. Cannot continue" error when I dbl click the MJP to load it.


Here's the MJP

[Package]
Name=JRiverAssistantService
xxAction=UNZIPDIR
xxURL=file://C:/Dev/Darin/JRiverAssistantBridge/JRiverAssistantService/bin/Debug/JRiverAssistantService.zip
Action=NONE
Version=0.0.1
URL=JRiverAssistantService.dll

[Action]
File1=JRiverAssistantService.dll
File1Action1=COPY_PLUGINDIR
File1Action2=REGISTER

File2=JRiverAssistantService.dll.config
File2Action1=COPY_PLUGINDIR

File3=JRiverAssistantService.tlb
File3Action1=COPY_PLUGINDIR




As you can see, I've tried both with Action=None (and the MJP zipped into the zip) as well and Action=Unzip, with the URL pointed to the FILE: url of the zip file.




Here's the registry entries I'm using:



Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\JRiver\Media Center 29\Plugins\Interface\JRiverAssistantService]
"IVersion"=dword:00000001
"Company"="drVenture And Associates"
"Version"="0.0.1.0"
"URL"="www.yahoo.com"
"Copyright"="Copyright c 2022 drVenture and Associates"
"PluginMode"=dword:00000001
"ProdID"="JRiverAssistantService"
"Directory"="c:\\Program files\\J River\\Media Center 29\\Plugins"
"Path"="[Install Path]Plugins\JRiverAssistantService.dll"




It seems like my plugin dll is correct (because MC is loading it), so I suspect I'm just missing a step somewhere with the MJP file.


Any idea?


Many thanks
Darin
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72534
  • Where did I put my teeth?
Re: Service Plugin
« Reply #4 on: April 01, 2022, 02:02:15 pm »

Try this:
https://wiki.jriver.com/index.php/Package_Files

If you're naming it, please avoid using JRiver or MC.
Logged

dhiggins

  • Regular Member
  • World Citizen
  • ***
  • Posts: 126
Re: Service Plugin
« Reply #5 on: July 04, 2022, 12:13:57 pm »

Hey JimH


Great information! It's been a bit (finding time can be tough), but I do have the plugin working, stable etc now, so that's great.


I had a quick question for you.


This could be just a "preference", thing but I was wondering if you guys had any recommendations as to whether to use the REST API (and just point the URL to 127.0.0.1) or to use the MCAutomation API when working with plugins.


Either way appears to work, and the rest API seems to be a bit easier to work with (plus the docs seem better, I still can't figure out how to play a playlist using the MCAutomation!)


I was just wondering if you guys had a recommendation?
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72534
  • Where did I put my teeth?
Re: Service Plugin
« Reply #6 on: July 04, 2022, 12:41:42 pm »

MCWS
Logged
Pages: [1]   Go Up