Difference between revisions of "Netflix Native Integration"

From MythTV Official Wiki
Jump to: navigation, search
(MythTV changes)
(Binary Installations)
 
(15 intermediate revisions by the same user not shown)
Line 30: Line 30:
 
These scripts were designed for the keys on a Windows-compatible remote control.
 
These scripts were designed for the keys on a Windows-compatible remote control.
 
You may have to adjust the LIRC configuration for other models.
 
You may have to adjust the LIRC configuration for other models.
Full integration requires the <tt>BACK</tt> and <tt>ZOOM</tt> buttons and a number keypad.
+
Full integration requires arrow buttons and a <tt>BACK</tt> button and a number keypad.
  
 
[[File:MCERemoteControl.jpg|link=http://www.amazon.com/Azend-Group-MediaGate-GP-IR01BK-1-Channel/dp/B0028N6XDA]]
 
[[File:MCERemoteControl.jpg|link=http://www.amazon.com/Azend-Group-MediaGate-GP-IR01BK-1-Channel/dp/B0028N6XDA]]
Line 47: Line 47:
 
===MythTV changes===
 
===MythTV changes===
  
These instructions assume that you built and installed MythTV yourself.
+
====Source Installations====
If you used a binary installation, you will need to [[User_Manual:Initial_Installation#Getting_and_compiling_the_source_code|reinstall MythTV]] to get these features.
 
  
The changes can all be retrieved from GitHub.
+
The most reliable way to access these features is to [[User_Manual:Initial_Installation#Getting_and_compiling_the_source_code|install MythTV from source]].
  
<code>git remote add chadparry https://github.com/chadparry/mythtv.git && git pull chadparry netflix</code>
+
The changes can all be retrieved from a [https://github.com/chadparry/mythtv/tree/netflix GitHub branch].
 +
 
 +
<code>git remote add chadparry <nowiki>https://github.com/chadparry/mythtv.git</nowiki> && git pull chadparry netflix</code>
  
 
Then re-install like normal.
 
Then re-install like normal.
  
<code>make && sudo make install</code>
+
<code>cd mythtv && make && sudo make install && cd ../mythplugins && ./configure && make && sudo make install</code>
 +
 
 +
====Binary Installations====
 +
 
 +
You can perform surgery on an existing binary installation.
 +
You will probably have to reinstall these features every time you update your binaries.
 +
 
 +
First download the patch file [http://chad.parry.org/software/mythtv/netflix.patch <tt>netflix.patch</tt>].
 +
Then apply the patch with the following command.
 +
Where it says <code>--directory=/usr/local</code>, substitute the <tt>PREFIX</tt> of your existing installation.
 +
For example, if your frontend files are found in <tt>/usr/share/mythtv</tt> and <tt>/usr/bin/mythtv</tt>, then specify <code>--directory=/usr</code>.
 +
 
 +
<code>sudo patch --directory=/usr/local --strip=0 <netflix.patch</code>
  
===Usage===
+
==Usage==
  
====Starting====
+
===Starting===
  
 
*Start by choosing "Netflix" or "Amazon Instant Video" from the "Internet Video" menu.
 
*Start by choosing "Netflix" or "Amazon Instant Video" from the "Internet Video" menu.
 
*To exit, use the <tt>BACK</tt> remote control button. (It looks like a &#x2b05; on the Windows remote control).
 
*To exit, use the <tt>BACK</tt> remote control button. (It looks like a &#x2b05; on the Windows remote control).
*To control the volume, use the <tt>VOLUMEUP</tt> and <tt>VOLUMEDOWN</tt> buttons.
+
*To control the volume, use the <tt>VOLUMEUP</tt> and <tt>VOLUMEDOWN</tt> and <tt>MUTE</tt> buttons.
  
====Shortcut Keys====
+
===Shortcut Keys===
  
 
While a show is playing in Netflix, the following keys are available.
 
While a show is playing in Netflix, the following keys are available.
When a show is not playing, pressing these buttons could cause nonsense characters to be entered.
 
 
These buttons are not supported in Amazon Instant Video.
 
These buttons are not supported in Amazon Instant Video.
  
Line 76: Line 88:
 
*<tt>REWIND</tt>
 
*<tt>REWIND</tt>
 
*<tt>FORWARD</tt>
 
*<tt>FORWARD</tt>
*<tt>MUTE</tt>
 
*<tt>ZOOM</tt> (toggles fullscreen mode)
 
  
====Mouse Controls====
+
===Mouse Controls===
  
 
The arrows can be used to control the mouse.
 
The arrows can be used to control the mouse.
 
Mouse acceleration is supported, meaning that the cursor will speed up as long as you hold the button down.
 
Mouse acceleration is supported, meaning that the cursor will speed up as long as you hold the button down.
 
This is ideal for both fine and large pointer adjustments.
 
This is ideal for both fine and large pointer adjustments.
 +
The <tt>OK</tt> button acts as a mouse click.
  
====Multi-Tap====
+
===Multi-Tap===
  
 
The number buttons can be used to enter alphabetic characters.
 
The number buttons can be used to enter alphabetic characters.
Line 93: Line 104:
 
To enter an actual number <tt>5</tt>, press <tt>5555</tt>.
 
To enter an actual number <tt>5</tt>, press <tt>5555</tt>.
 
To enter a space, press <tt>0</tt>.
 
To enter a space, press <tt>0</tt>.
 +
The <tt>ENTER</tt> and <tt>CLEAR</tt> buttons act as enter and backspace, respectively.
 +
 +
== Customization ==
 +
 +
The menu options can be customized in your sources by modifying some XML files.
 +
If you use the default menus, then you should edit <tt>mythtv/themes/defaultmenu/library.xml</tt>.
 +
If you use the classic menus, then you should edit <tt>mythplugins/mythnetvision/theme/menus/netvisionmenu.xml</tt>.
 +
(If you aren't sure which one you use, then it doesn't hurt to edit both).
 +
You can add new menu options for different web pages.
 +
Just copy those lines and change the <tt>type</tt> and <tt>text</tt> and <tt>description</tt> to whatever you want.
 +
The <tt>action</tt> line should start with <tt>EXEC /usr/local/bin/lircfirefox.py /usr/bin/firefox</tt> and then include the URL for your desired page.
 +
 +
For example, the following snippet from the XML shows how to add a menu entry for Sesame Street Videos.
 +
 +
    <button>
 +
        <type>SESAME_STREET</type>
 +
        <text>Sesame Street</text>
 +
        <description>Sesame Street Videos</description>
 +
        <action>EXEC lircfirefox.py /usr/bin/firefox '<nowiki>http://www.sesamestreet.org/videos</nowiki>'</action>
 +
    </button>
 +
 +
After you make any changes, run <tt>sudo make install</tt> again.
 +
You should run the installation from the <tt>mythtv</tt> directory if you made changes under it, and from the <tt>mythplugins</tt> directory if you made changes under it.
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Latest revision as of 00:51, 24 December 2014

This describes how to integrate Netflix and Amazon Instant Video with a MythTV frontend. The system is made for maximum convenience, including these features:

  • Netflix runs in a native Chrome browser.
    • The HTML5 player with Encrypted Media Extensions is used.
    • Neither WINE nor pipelight are required for Netflix, (but pipelight is recommended for Amazon Instant Video).
    • Hardware acceleration is supported.
  • The remote can be used to load and start and stop movies and control the volume.
  • The remote can act as a mouse with acceleration.
  • The remote can enter letters using multi-tap on the number buttons.

These instructions are only for Linux.

Installation

Dependencies

The latest Chrome browser should be downloaded and installed by following the instructions at https://www.google.com/chrome/browser/. (The Chromium builds do not include all the required plugins, so use Chrome).

On a Debian-like system, the other dependencies can be installed with this command:

sudo apt-get install xdotool python-alsaaudio python-pylirc

These scripts were designed for the keys on a Windows-compatible remote control. You may have to adjust the LIRC configuration for other models. Full integration requires arrow buttons and a BACK button and a number keypad.

MCERemoteControl.jpg

Firefox changes

For Amazon Instant Video to work smoothly, you then need a Firefox installation with Silverlight support.

  1. Follow all the instructions in this article:
        How to Watch Amazon Instant Video on Linux
    Make sure that videos play well before proceeding.
  2. Start the Firefox profile manager:
    firefox -P
  3. Create a new profile called Kiosk and make it the default.
  4. Start the browser using the new profile.
  5. Log in to your Amazon Instant Video Library. Ask the browser to remember your password.
  6. Install the R-kiosk add-on. This will remove the navigation bar and enable the browser's fullscreen mode all the time. This makes it easier to watch movies, but harder to customize, so make sure movies are working before installing the add-on.

MythTV changes

Source Installations

The most reliable way to access these features is to install MythTV from source.

The changes can all be retrieved from a GitHub branch.

git remote add chadparry https://github.com/chadparry/mythtv.git && git pull chadparry netflix

Then re-install like normal.

cd mythtv && make && sudo make install && cd ../mythplugins && ./configure && make && sudo make install

Binary Installations

You can perform surgery on an existing binary installation. You will probably have to reinstall these features every time you update your binaries.

First download the patch file netflix.patch. Then apply the patch with the following command. Where it says --directory=/usr/local, substitute the PREFIX of your existing installation. For example, if your frontend files are found in /usr/share/mythtv and /usr/bin/mythtv, then specify --directory=/usr.

sudo patch --directory=/usr/local --strip=0 <netflix.patch

Usage

Starting

  • Start by choosing "Netflix" or "Amazon Instant Video" from the "Internet Video" menu.
  • To exit, use the BACK remote control button. (It looks like a ⬅ on the Windows remote control).
  • To control the volume, use the VOLUMEUP and VOLUMEDOWN and MUTE buttons.

Shortcut Keys

While a show is playing in Netflix, the following keys are available. These buttons are not supported in Amazon Instant Video.

  • PLAY
  • PAUSE
  • REWIND
  • FORWARD

Mouse Controls

The arrows can be used to control the mouse. Mouse acceleration is supported, meaning that the cursor will speed up as long as you hold the button down. This is ideal for both fine and large pointer adjustments. The OK button acts as a mouse click.

Multi-Tap

The number buttons can be used to enter alphabetic characters. This is necessary for entering a name into a search box. Use the multi-tap system like on old mobile phones. For example, to enter the letter L, press 555. To enter an actual number 5, press 5555. To enter a space, press 0. The ENTER and CLEAR buttons act as enter and backspace, respectively.

Customization

The menu options can be customized in your sources by modifying some XML files. If you use the default menus, then you should edit mythtv/themes/defaultmenu/library.xml. If you use the classic menus, then you should edit mythplugins/mythnetvision/theme/menus/netvisionmenu.xml. (If you aren't sure which one you use, then it doesn't hurt to edit both). You can add new menu options for different web pages. Just copy those lines and change the type and text and description to whatever you want. The action line should start with EXEC /usr/local/bin/lircfirefox.py /usr/bin/firefox and then include the URL for your desired page.

For example, the following snippet from the XML shows how to add a menu entry for Sesame Street Videos.

    <button>
        <type>SESAME_STREET</type>
        <text>Sesame Street</text>
        <description>Sesame Street Videos</description>
        <action>EXEC lircfirefox.py /usr/bin/firefox 'http://www.sesamestreet.org/videos'</action>
    </button>

After you make any changes, run sudo make install again. You should run the installation from the mythtv directory if you made changes under it, and from the mythplugins directory if you made changes under it.