Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Passing remote or keycodes through to WMC plugin.

If you have a question or need help, this is the place to be.
Post Reply
bengalih
Posts: 48
Joined: Sat Feb 25, 2012 1:13 am

Passing remote or keycodes through to WMC plugin.

Post by bengalih »

So I have been successfully and happily been using EG for about 2 years to control my HTPC with WMC, XBMC and some other apps.

I use WMC exclusively for the Netflix plugin and have no issues using is. In my xml I have things defined like:

MceRemote.Mce.Up will trigger Emulate Keystrokes UP
MceRemote.Mce.Stop will trigger Emulate Keystrokes Shift+Ctrl+S

Again, this all works great.

Well, I am trying to use another plugin for WMC for Amazon Prime:
http://sharepointsnapple.com/amazonmceaddin/

The problem with this plugin is that it is coded to directly interpret the MCE commands to perform it's media player functions (stop/start/ff/etc).

Because I use EG with the MCE IR service, all codes get intercepted by EG and never make it on to the application.

The application is not coded with any keyboard shortcuts to control the app, either simply an on screen GUI (mouse control) or the direct remote codes.

The player is built in javascript and has a code section like the following:

Code: Select all

function onRemoteEvent(keyID) {
            switch (keyID) {
                case 19:
                    //Pause
                    var mainPlayer = document.getElementById("objPlayerControlHost").Content.Bridge;
                    mainPlayer.Pause();
                    return false;
                    break;
                case 250:
                    //Play
                    slControls.resumePlaybackFromLastPos(parseInt(slControls.currentSeconds));
                    return false;
                    break;
                case 179:
                    //playPause
                    if (lastPress + 100 < new Date().getTime()) {
                        lastPress = new Date().getTime();
                        if (isPaused == 1) {
                            //Play
                            isPaused = 0;
                            slControls.resumePlaybackFromLastPos(parseInt(slControls.currentSeconds));
                        }
                        else {
                            //Pause
                            isPaused = 1;
                            var mainPlayer = document.getElementById("objPlayerControlHost").Content.Bridge;
                            mainPlayer.Pause();
                        }
                    }
                    return false;
                    break
                case 178:
                    //Stop
                    var mainPlayer = document.getElementById("objPlayerControlHost").Content.Bridge;
                    mainPlayer.Pause();
                    mainPlayer.Seek(slControls.currentSeconds);
                    window.external.MediaCenter.CloseApplication();
                    return false;
                    break;
                case 166:
                    //Go back to main app
                    var mainPlayer = document.getElementById("objPlayerControlHost").Content.Bridge;
                    mainPlayer.Pause();
                    mainPlayer.Seek(slControls.currentSeconds);
                    window.external.MediaCenter.CloseApplication();
                    return false;
                    break;
                case 177:
                    //Skip Back
                    var mainPlayer = document.getElementById("objPlayerControlHost").Content.Bridge;
                    mainPlayer.Seek(slControls.currentSeconds - 30);
                    break;
                case 176:
                    //Skip Forward
                    var mainPlayer = document.getElementById("objPlayerControlHost").Content.Bridge;
                    mainPlayer.Seek(slControls.currentSeconds + 30);
                    break;
                default:
                    //Ignore
            }
So it is expecting the WMC onRemote event to be passing it directly the keycodes listed in the case statements.

As is, I can't find anyway to control this with my remote while having EG running.

Ideas?
Post Reply