SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   SageMC Custom Interface (http://forums.sagetv.com/forums/forumdisplay.php?f=41)
-   -   Netflix Control: A Netflix Silverlight Remote Control Script (http://forums.sagetv.com/forums/showthread.php?t=38969)

brainbone 01-23-2009 04:29 PM

Utility: Netflix Control v0.9 - A Netflix Silverlight Remote Control Script
 
3 Attachment(s)
Netflix Control is an AutoHotKey script for controlling a Netflix Silverlight Watch Now Movie Viewer running under Internet Explorer with a remote control. While it was made as an aid to users of the SageMC NetFlix Import that are stuck with a Silverlight account, it does not require SageTV or the SageMC Netflix Import to function. All it requires is AutoHotKey, a Netflix Silverlight account, and Internet Explorer.

Now Included with SageMC Netflix:
No need to to install Netflix Control if using with SageMC Netflix. Simply install and configure SageMC NetFlix Import v2.1 or greater. You should not need to change your SageTV remote configuration at all. If you were previously using Netflix Control with SageMC Netflix, remove and restore your SageTV remote configuration to the way it was before using Netflix Control. Then continue with the installation of SageMC Netflix v2.1 (or greater).

Overview:
Netflix Control runs in the background waiting until a Netflix Viewer running in Internet Explorer becomes active. It will then force the Netflix Viewer into full screen, translating keys into the necessary mouse movements for controlling the viewer.

Netflix Control can:
- Jump forward and backward in the time line
- Change episodes
- Play/Pause
- Mute/Unmute
- Adjust Volume
- Close the Netflix Movie Viewer

Key definitions in Netflix Control:
CTRL-a or Left Arrow: Jump back in the time line
CTRL-s or Right Arrow: Jump ahead in the time line
CTRL-f : Change to next episode (for titles that have episodes)
CTRL-b : Change to previous episode (for titles that have episodes)
F10 : Increase Volume
F9 : Decrease Volume
F8 : Toggle Mute/Unmute
CTRL-p : Toggle Play/Pause
CTRL-e : Close Netflix Viewer / IE window

If you have a remote or keyboard that use the standard windows media keys/buttons, the following also work:
STOP : Close Netflix Viewer / IE window
Next Track: Change to next episode (for titles that have episodes)
Previous Track : Change to previous episode (for titles that have episodes)
Volume + : Increase Volume
Volume - : Decrease Volume
Mute : Toggle Mute/Unmute

Installation:

1) If you have a previous version of Nerflix Control installed, please delete it, and any support files (like the "netflix_player_buttons" folder) to remove any possible confusion before installing the new version.

2) Download Netflix Control v0.9 and extract to an appropriate location. No need for AutoHotKey, unless you plan on modifying the Netflix Control scripts.

Using with EventGhost:

1) Download and install EventGhost. I use version 0.3.6.1487 (from the EventGhost "Nightly Builds")

2) Install the EventGhost plugin included with Netflix Control, as described in the plugin's readme file. (simple as copying the "NetflixSilverlightControl" plugin folder into EventGhost's plugin folder)

3) Start netflix_silverlight_control.exe (not netflix_control.exe) from the folder you extracted Netflix Control to. (Once you get things working, you'll likely want to add a shortcut to netflix_silverlight_control.exe in your Startup folder)

4) Download and extract the "NetflixControl_EventGhost_Template_v0.1.xml" EventGhost template from NetflixControl_EventGhost_Template_v0.1.zip

5) Start EventGhost, and open up the file "NetflixControl_EventGhost_Template_v0.1.xml" from step 4

6) Adding your remote plugin to the NetflixControl_EventGhost_Template_v0.1 in EventGhost:
a) From the EventGhost Menu, select "Configuration -> Add Plugin"

b) In the "Choose plugin to add..." window, select the applicable remote control device from the "Remote Receiver" branch, click "OK".

c) Configure the appropriate options for the remote receiver.

d) Once back to the main EventGhost window, expand the "EnableInputPluginOnOpen" branch.

e) Double click the "Enable: " action in the "EnableInputPluginOnOpen" branch.

f) In the "EventGhost: Enable an item" window, Expand the "Autostart" banch, and select the "Plugin: <name of remote plugin you selected>". Click "OK"

g) Once back to the main EventGhost window, expand the "DisableInputPluginOnClose" branch.

h) Double click the "Disable: " action in the "DiableInputPluginOnClose" branch.

i) In the "EventGhost: Disable an item" window, Expand the "Autostart" banch, and select the "Plugin: <name of remote plugin you selected>". Click "OK"
7) Mapping events from your remote to Netflix Control in EventGhost
a) Right-click "Plugin: <name of remote plugin you selected>", and make sure "Disable Item" is NOT checked.

b) Press a button on your remote. You should see an event pop-up in the left frame of EventGhost. If not, you may need to double click the "Plugin: <name of remote plugin you selected>" plugin and modify its configuration.

c) Expand the "Netflix Silverlight Control" tree in EventGhost.

d) Press a button on your remote that you want to assign to a Netflix function, like the stop button for example. You should see an event pop-up in the left frame.

e) Grab the event that popped up in step 7-d, and drag it to the Netflix Silverlight Control action you want to assign it to, like "Stop".

f) Repeat steps 7-d and 7-e until you assign all the buttons you desire.

g) Right-click "Plugin: <name of remote plugin you selected>", and make sure "Disable Item" IS checked. This will be enabled as necessary by EventGhost.
8) Save the EventGhost configuration file.

9) In EventGhost, select "File -> Options...". In the "Options" window, check "Launch on Windows Startup" and "Send to Systray on Close". Click "OK"

10) Open internet explorer, go to Netflix and start a Watch Now movie. The movie should automatically go full screen. If not, netflix_silverlight_control.exe is probably not running. run it.

11) Test your remote. If it works, report it back here. If not, double check all steps above, and finally check back here.


Using keyboard to control Netflix Control without EventGhost:

1) Start netflix_control.exe (not netflix_silverlight_control.exe. netflix_control.exe will automatically start netflix_silverlight_control.exe) from the folder you extracted Netflix Control to.

2) Open internet explorer, go to Netflix and start a Watch Now movie. The movie should automatically go full screen. If not, netflix_control.exe is probably not running. run it.

3) Test controlling Netflix using the keys described in "Key definitions in Netflix Control:", above.

4) Using a hauppauge 45 button remote with netflix_control.exe:
a) As the first item under [Applications] your rremote.ini add "NetflixControl=". This must be the first, default, item.

b) Add the following definitions to your rremote.ini

Code:

[NetflixControl]
BACK={ctrl}e
MUTE={F8}
VOLUP={F10}
VOLDOWN={F9}
CHNLUP={VK_UP}
CHNLDOWN={VK_DN}
NAVUP={VK_UP}
NAVDOWN={VK_DN}
NAVLEFT={ctrl}a
NAVRIGHT={ctrl}s
OK={enter}
STOP={ctrl}e
PAUSE={ctrl}p
PLAY={ctrl}p
REWIND={ctrl}a
FASTFWD={ctrl}s
SKIPFWD={ctrl}f
SKIPREV={ctrl}b

c) restart IR.EXE
Using SendMessage() to instruct Netflix Control from your application:

1) Start netflix_silverlight_control.exe (not netflix_control.exe) from the folder you extracted Netflix Control to.

2) Get the handle for netflix_silverlight_control.exe by searching for a window title of "NetflixSilverlightControl" with a class of "AutoHotKey". For example: hWnd = FindWindow("AutoHotkey", "NetflixSilverlightControl")

3) Launch a Netflix Silverlight Movie (open IE to a Watch Now movie using a Netflix Silverlight Account)

4) Send a message of "0x5555" to the window handle from step 2 with wParam of 10 and lParam between 100 and 110 (see table in 5, below, for details). Example: SendMessage(hWnd, 0x5555, 10, 100)

5) Table of lParam for use with wParam of 10:
100 - Exit the netflix movie viewer, and wait for a new viewer window to open

101 - Jump ahead in the timeline

102 - Jump back in the timeline

103 - Move to next Chapter/Episode

104 - Move to previous Chapter/Episode

105 - Play

106 - Pause

107 - Toggle play/pause

108 - Toggle Mute On/Off

109 - Move volume Up

110 - Move volume down
Modification:

If you know how to write autohotkey scripts, you can easily modify the keys bound to the different commands in netflix_control.ahk. The script source code is found the the src.zip file. The AutoHotKey documentation is a good place to start.

Change Log:

v0.9

- Made changes to hopefully resolve an issue where player button locations were not always properly detected. This resulted in the Netflix Player not going into full screen.

v0.8a:

- No changes made to the control scripts. Only change is the repair of the EventGhost plugin.

- Updated EventGhost plugin to version 0.2. Please do not use v0.1.x version of the plugin - it has many issues.

- NOTE: If you used the original EventGhost plugin from v0.8, please update to the v0.2 plugin. You will also need to remove the old plugin from your EventGhost script(s) and re-add it. Sorry for the inconvenience.

v0.8:

- Separated operations into two scripts; netflix_silverlight_control.exe and netflix_control.exe. netflix_silverlight_control.exe does the bulk of work, but does not listen for any keyboard or remote input. netflix_control.exe listens for keyboard input, and sends messages to netflix_silverlight_control.exe.

- Added EventGhost plugin for use with netflix_silverlight_control.exe (do not use netflix_control.exe with EventGhost, just netflix_silverlight_control.exe)

v0.6:

- Fixed: Netflix Navigation bar did not always become visible on some configurations, stopping commands from working.

brainbone 01-24-2009 11:49 AM

Updated to version 0.6. See top post for details.

SteveD 02-04-2009 06:40 PM

Help with your control
 
I use a hauppauge 45 button remote with a usb-uirt. I do not understand how to program the ahk file to use this configuration.

Thanks
Steve

brainbone 02-04-2009 06:48 PM

I would think Event Ghost may be the place to start, however its use may complicate your SageTV configuration.

Morgan111 is looking into the possibility of interfacing Netflix Control with the SageMC Netflix STVi at a lower level, possibly eliminating the complication that various different types of remotes can cause.

alijiwani 02-05-2009 08:29 AM

any chance a version of this script could be used to control HULU?

brainbone 02-05-2009 09:11 AM

I don't see any reason why one couldn't be made, however I hesitate doing it because SageTV may soon have native support for hulu. It would also require an STVi, like the Netflix STVi, to navigate, select and launch the HULU programming for a hulu control script to use - and I don't yet have any experience in creating STVis.

brainbone 02-06-2009 09:55 PM

Updated to version 0.8. See top post for details.

The main change is the ability to use EventGhost.

brainbone 02-07-2009 08:40 AM

Updated to version 0.8a. See top post for details.

No changes made to the control programs. Only change is the repair of the EventGhost plugin.

NOTE: If you used the original EventGhost plugin from v0.8, please update to the v0.2 plugin. You will also need to remove the old plugin from your EventGhost script(s) and re-add it. Sorry for the inconvenience.

brainbone 02-10-2009 10:22 AM

Added an EventGhost Template, and detailed instructions for using EventGhost with Netflix Control and the new template to the top post.

SteveD 02-11-2009 06:34 AM

Following the instructions given for remote control configuration, the auto fullscreen is the only thing that works , none of the silver-light commands are being passed to the browser window. I am using the USB UIRT

brainbone 02-11-2009 06:55 AM

Quote:

Originally Posted by SteveD (Post 337348)
Following the instructions given for remote control configuration, the auto fullscreen is the only thing that works , none of the silver-light commands are being passed to the browser window. I am using the USB UIRT


In event ghost, you were able to press a remote button, see the button event in the left window, and drag that event to the Netflix Silverlight Control action in the right window that you wanted to bind it to?

If so, are you sure you're leaving EventGhost running (the green arrow in your systray)?

Please post your EventGhost configuration file here (.xml file you saved after modifying the supplied template).

SteveD 02-11-2009 07:05 AM

Silverlight control works with streamzap remote after you disable streamzap driver

brainbone 02-11-2009 07:59 AM

Quote:

Originally Posted by SteveD (Post 337355)
Silverlight control works with streamzap remote after you disable streamzap driver

In this case, you'll need to add the SageTV plugin (or other applications you wish to control) in EventGhost, then map the buttons that you want to control in that same way you did with Netflix Silverlight Control.

In the "Autostart" branch:

1) Select "Configure -> Add Plugin -> Program Control -> SageTV (or any other application you wish to control)"

2) Map buttons from your remote to the Plugin from step 1 above, just as you did with Netflix Silverlight Control

In the "EnableInputPluginOnOpen" macro:

3) Change the "Enable: " action to enable "Plugin: Netflix Silverlight Control"

4) Add a "Disable: " action (Configuration -> Add Action -> EventGhost -> Disable Item...), and configure it to disable the Plugin: SageTV (or any other application plugins other than Netflix Silverlight Control)

5) Repeat step 4 for all application plugins, except Netflix Silverlight Control

Now, in the "DisableInputPluginOnClose" macro:

6) Change the "Disable: " action to disable "Plugin: Netflix Silverlight Control"

7) Add an "Enable: " action (Configuration -> Add Action -> EventGhost -> Enable Item...), and configure it to enable the Plugin: SageTV (or any other application plugins other than Netflix Silverlight Control)

8) Repeat step 7 for all application plugins, except Netflix Silverlight Control

Now in the Autostart branch:

9) Right-click and Disable "Plugin: Netflix Silverlight Control"

10) Right-click and Enable "Plugin: <your remote plugin>"

If the application you wish to control does not exist in Program Control list in EventGhost, first make sure you are running the latest beta of EventGhost, then try looking in the EventGhost forums for additional plugins.

SteveD 02-11-2009 08:19 AM

USB-uirt works ass well did not realize that event ghost had to be running. Thanks for this solution.

Would it be possible to control powerdvd in this way as well

brainbone 02-11-2009 08:42 AM

Yes. EventGhost has a Cyberlink PowerDVD plugin. Look under Configuration -> Add Plugin -> Program Control -> Cyberlink PowerDVD

SteveD 02-11-2009 08:44 AM

I found that , but I am unsure how to link it to the usb uirt. It add the plugin into the tree, but the keys are grayed out.

brainbone 02-11-2009 09:01 AM

Make sure the USB-UIRT plugin is enabled (right-click it and un-check Disabled)

Now, press a button on your remote and drag the event that pops up to the appropriate PowerDVD macro, like: "Play", "Pause", etc., just like you did with Netflix Silverlight Control.

Note: You need to drop the remote event on the Macro (the item with the gear), not on the Action (the item with the grey lego). So for "Play", drop it on "Play", not "Cyberlink PowerDVD: Play". The Remote event should then appear in the Macro folder, just above the "Cyberlink PowerDVD: Play" action.

Make sure you follow the instructions from this post for changing the way the program control plugins are enabled/disabled.

panteragstk 02-12-2009 03:34 AM

I have gotten the .8a version of the plugin working with eventghost when opening netflix from internet explorer and choosing to play a movie now. It refuses to work when I launch the silverlight player through the sagetv netflix plugin. For some reason your autohotkey control is not "grabbing" or recognizing that the player is open when using through sage. Any suggestions?

gplasky 02-12-2009 06:56 AM

Quote:

Originally Posted by panteragstk (Post 337656)
I have gotten the .8a version of the plugin working with eventghost when opening netflix from internet explorer and choosing to play a movie now. It refuses to work when I launch the silverlight player through the sagetv netflix plugin. For some reason your autohotkey control is not "grabbing" or recognizing that the player is open when using through sage. Any suggestions?

Did you follow the instructions? (See bolded below)

Quote:

Installation (Netflix Control v0.8+):

1) If you previously installed Netflix Control v0.6, delete it to remove any possible confusion.

2) Download Netflix Control v0.8a and extract to an appropriate location. No need for AutoHotKey, unless you plan on modifying the Netflix Control scripts.

Gerry

brainbone 02-12-2009 07:03 AM

Quote:

Originally Posted by panteragstk (Post 337656)
For some reason your autohotkey control is not "grabbing" or recognizing that the player is open when using through sage. Any suggestions?

Are you sure Netflix Control is running (green H in the systray)?

When the player is opened through Sage, is the "Full Screen" button completely visible? If not, please take a screen shot of what you see and post it here.

Is SageTV running in Fullsreen Exclusive Mode? (If it is, it could be causing issues)


All times are GMT -6. The time now is 12:41 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.