Netflix Streaming LIRC Integration
- 1 Current Version
- 2 Install Extra Software
- 3 Mythnetflix Easy Install
- 4 Edit Mythfrontend
- 5 The Remote
- 6 About: The LIRC File
- 7 About: Mythnetflix Scripts
- 8 Problems I Have Ran Into
This is a set of scripts and custom LIRC file to decently integrated Netflix with Mythfrontend on a Mythtv system.
The scripts will only work right if there is no other instances of Firefox running at the same time.
All of these steps must be performed as the same user that runs Mythfrontend
These are instruction for a Mythbuntu 12.04 install. I did get it to also work just fine on an Xubuntu 14.04 install. if you are using a dual monitor setup you may want to read write-mouse-position and set the x= and y= to just one of your monitors
Version 07 is extremely different than earlier versions.
If you want to upgrade:
- note any change you may have made to your .lirrc file
- delete your mythnetflix folder
- rm -rf ~/mythnetflix
- install unclutter
- sudo apt-get install unclutter
- follow the easy install instructions
- re-edit mythnetflix.lircrc
first thing, access the desktop by either exiting out of Mythfrontend completely or hitting Ctrl-Alt-Right Arrow
Install Extra Software
- lirc-x -- provides irxevent
- xautomation -- provides xte
sudo apt-get install lirc-x xdotool xautomation unclutter
- The first thing you need to do is install the Pipelight plugin and enable Sliverlight (directions for enabling are lower on install instructions page)
- Close Firefox if you are running it
- Start Firefox and wait for the Pipelight/Silverlight plugin to install
- Go to the test page to make sure Pipelight/Silverlight plugin is working
- Close Firefox
Mythnetflix Easy Install
open a terminal
- download the installer
- make the installer executable
- run the installer
- run Mythnetflix
- login -- make sure "Remember Me" checked
- make sure remote works right, if the buttons on the player window aren't working right see button-mapper
- exit mythnetflix with either the remote or hitting Ctrl-q
wget http://www.schaderules.com/files/3413/9888/7080/mythnetflix-install07.sh chmod +x mythnetflix-install07.sh ./mythnetflix-install07.sh ~/mythnetflix/mythnetflix.sh
To add a menu button for your theme you need to go to ~/.mythtv/themes/'the theme your using'/
note: I have been using the MythMediaStream theme
Open mainmenu.xml and add the following lines somewhere that you think fits (I put it below the videos section)
<button> <type>VIDEO</type> <text>Netflix</text> <description>Watch videos on</description> <action>EXEC ~/mythnetflix/mythnetflix.sh</action> </button>
Now when you restart your Mythfrontend the Netflix option should show up
the included LIRC file is a whole bunch of mouse position and click commands. you may need to edit it. I set it up to work with the remote I have but it should give you a good starting point to make it work. I will post some more advanced LIRC and xdtool stuff when I get a chance.
right now it will only work with mceusb remote
When in the Netflix choose video screen:
- UP, DOWN, LEFT, RIGHT -- buttons jump 100 pixels, hold down enabled
- 2, 8, 4, 6 -- small button steps 10 pixels at a time, hold down enabled
- OK -- mouse click I use it to select profile (will start movie)
- Channel UP, DOWN -- scroll the page up or down
- ENTER -- will start movie and try to auto full screen, sometimes fails if video loading take too long
- ← (back arrow) -- exit Netflix, returns you to Mythfrontend
- 1 -- zooms-in
- 7 -- zooms-out
When watching a video:
the UP, DOWN, LEFT, RIGHT, 2, 8, 4, 6, OK buttons do all the same thing and are to be used if needed.
Volume keys -- I added a control, but I don't use system volume controls YMMV
- PLAY, PAUSE -- both buttons will play or pause the video
- STOP -- sends you back to the Netflix video chooser screen
- FF, REW -- will put the mouse on the position bar in the middle-- bar will disappear but if you use the buttons to move along it it will re-appear, OK selects
- DVD -- puts the mouse on the audio menu -- my remote it's the little button to the right of the mute button
- RecTV -- puts the mouse on the HD button -- my remote it's the button to the left of the mute button
- GREEN BUTTON -- centers the mouse on the menu bar -- kinda worthless I think
- ∗ -- Kills Silverlight plugin if mis-behaving. only use if necessary!
About: The LIRC File
I had to write a bunch of mouse position and mouse click commands for this file.
I also have it only set up for a MCEUSB remote.
Only 1 thing may need changing if at all in the mythnetflix.lircrc file.
starts at line 48
begin ###firefox### ##exit Netflix/Firefox## #!!!!if you change any of the buttons make sure the button = KEY_BACK line is commented out!!!!# remote = mceusb prog = irexec ## to use "info" button uncomment #button = More ##to use "power" button uncomment #button = KEY_POWER button = KEY_BACK config = ~/mythnetflix/lirc/exit-firefox.sh repeat = 0 delay = 0 end
About: Mythnetflix Scripts
If you need to edit the scripts I tried to make it relatively fool proof.
they can all be found in /home/'user'/mythnetflix
- mythnetflix.sh -- found in /home/'user'/mythnetflix This is the mythnetflix script
- write-mouse-position.sh -- found in /home/'user'/mythnetflix/build-lirc This script attempts to find current screen resolution and calculate the proper position of the buttons for use with LIRC. for more information see write-mouse-position for how to use and how to manually set screen resolution
- mythnetflix-map.sh -- found in /home/'users'/mythnetflix/button-mapper This script allows you to easy set the button positions if they were not properly set by write-mouse-position.sh see button-mapper for how to use
Problems I Have Ran Into
Everything works fine when I launch the script from the command line but when I launch it from the Mythfrontend Silverlight always crashes.
This one took a while for me to figure out how to make it work, it's not a fix per say more of a workaround. make sure you have SSH client and server enable on the machine your running Netflix on
- from the terminal make sure you can ssh back into your mythtv box ssh 'email@example.com where user is the user running Mythfrontend.
- exit out of the ssh session
- set the ssh server to allow you to login over ssh without a password ssh-copy-id 'firstname.lastname@example.org
- try logging in again ssh 'email@example.com
- edit your mainmenu.xml <action> to look like this. Insert username where it says user:
<action>EXEC ssh firstname.lastname@example.org 'env DISPLAY=:0 ~/mythnetflix/mythnetflix.sh'</action>