JRiver Media Center Plugin

Attached is a Plugin for JRiver Media Center.
https://jriver.com

To install the plugin, use the Plugin Import utility in the Designer. The import process will ask you for the Host (IP Address) of the server running JRiver.

Here is the plugin code:
JRiverMediaCenter.plugin (2.4 KB)

plugin.Name = "JRiverMediaCenter";
plugin.OnChangeRequest = onChangeRequest;
plugin.OnConnect = onConnect;
plugin.OnDisconnect = onDisconnect;
plugin.OnPoll = onPoll;
plugin.OnSynchronizeDevices = onSynchronizeDevices;
plugin.PollingInterval = -1;
plugin.DefaultSettings = { "Host": "192.168.1.100" };

var http = new HTTPClient();

var baseUrl;

var commands = {
    "Play": "Playback/PlayPause?Zone=-1&ZoneType=ID",
    "Pause": "Playback/PlayPause?Zone=-1&ZoneType=ID",
    "Stop": "Playback/Stop?Zone=-1&ZoneType=ID",
    "SkipForward": "Playback/Next?Zone=-1&ZoneType=ID",
    "SkipBackward": "Playback/Previous?Zone=-1&ZoneType=ID",
    "DirectionUp": "Control/Key?Key=Up",
    "DirectionRight": "Control/Key?Key=Right",
    "DirectionDown": "Control/Key?Key=Down",
    "DirectionLeft": "Control/Key?Key=Left",
    "Select": "Control/Key?Key=Enter",
    "PageUp": "Control/Key?Key=Page%20Up",
    "PageDown": "Control/Key?Key=Page%20Down",
    "Back": "Control/Key?Key=Backspace",
    "Space": "Control/Key?Key=Space",
    "DisplayToggle": "Control/MCC?Command=10012",
    "ShuffleOn": "Control/MCC?Command=10005&Parameter=4",
    "ShuffleOff": "Control/MCC?Command=10005&Parameter=3",
    "PowerOff": "Control/MCC?Command=27001,0",
    "FastForward": "Control/MCC?Command=10008&Parameter=10",
    "Rewind": "Control/MCC?Command=10009&Parameter=10",
    "Audio": "Control/MCC?Command=22001&Parameter=3",
    "Video": "Control/MCC?Command=22001&Parameter=5",
    "Images": "Control/MCC?Command=22001&Parameter=4",
    "Home": "Control/MCC?Command=22001&Parameter=1",
}

function onChangeRequest(device, attribute, value) {
    if (attribute != "MediaCommand")
        throw "Invalid attribute";

    var command = commands[value];
    if (!command)
        throw "Invalid command";

    http.get(baseUrl + command);
}

function onConnect() {
    baseUrl = "http://" + plugin.Settings["Host"] + ":52199/MCWS/v1/";

    var mediaCenter = plugin.Devices["1"];
    if (mediaCenter != null) {
        mediaCenter.SupportedMediaCommands = Object.keys(commands);
    }
}

function onDisconnect() {
}

function onPoll() {
}

function onSynchronizeDevices() {
    var mediaCenter = new Device();
    mediaCenter.Id = "1";
    mediaCenter.DisplayName = "JRiver Media Center";
    mediaCenter.Capabilities = ["MediaControl"];
    mediaCenter.Attributes = [];
    plugin.Devices[mediaCenter.Id] = mediaCenter;
}

Hi Bill.

Where is the “Plugin Import utility in the Designer” please?

Right-click the Devices folder.

Thanks Bill, but I don’t seem to have that option?Bill

Do you have the latest version of the Designer installed? The current is 4.4.3.0

https://downloads.thehomeremote.com/designer/index.html

I have, however for some reason I’ve been using an old version all this time. Thanks

Is there a guide available which my help me understand how to use installed plugin’s?

Using a plugin is really no different than using an official integration. All devices work the same.

I’m OK with linking IR codes to buttons, this I understand. And I followed Brian’s video’s today and set up a volume slider/mute toggle for my LG TV today. I just don’t see how I use the plugin’s.

To send a Play command to JRiver:

  1. Add a DataAction to a Button’s Clicked EventTrigger
  2. Set the Binding of the DataAction to MyDeviceName.MediaCommand
  3. Set the Value of the DataAction to Play
1 Like

Bill, are you still working on this plugin? Have you given any thought on feedback from jRiver?

I am not working on this plugin. This was something I threw together rather quickly for a customer.