Sunday, May 13, 2018

Mythyoutube - Add a Menu Button in MythTV That Launches YouTube

Edit 4/1/2020:  Consider using Mythchromium to access YouTube.

Edit 12/8/2019:  YouTube's youtube.com/tv web page no longer works with the 10-ft leanback interface on Chromium unless the user agent is changed as explained at https://forum.kodi.tv/showthread.php?tid=347222.  Also, setting youtube.com/tv to be the first page to open can cause the 10 ft user interface to not display.

Instructions for Adding a Menu Button in MythTV That Launches YouTube in a Browser


Launching YouTube in a browser such as Chromium in kiosk (full screen) mode and opening YouTube's 10-ft interface site at www.youtube.com/tv#/browse allows YouTube to be displayed in a format that is best suited for a TV.  Steps to follow:

  1. Download the latest release from https://github.com/heyted/mythyoutube/releases.
  2. Unzip the files, and copy the bash and menu files to the .mythtv folder in your home folder. Hidden folders will need to be shown. The user name in the menu file will need to be changed. The mainmenu.xml file may need to be edited depending on what menu items you want to see.
  3. Make youtube_leanback.sh executable.  In Ubuntu, right click on the file, choose properties, choose permission and select "allow executing the file a program."
  4. Install xwit to make the cursor disappear. Open a terminal and enter "sudo apt install xwit" without the quotes. You may need to change the numbers in the bash file noted above depending on the TV resolution. 
  5. To close the Chromium window, set a single key on the remote to close the widow. In Mythbuntu (or Xubuntu), go to the keyboard settings. Under Application Shortcuts, add the command 'wmctrl -c "Chromium"' without the single quotes, and assign a key such as the break (pause) key. This should produce a different key code than the media pause key. Edit the ir-keytable config file (mine is rc6_mce) to assign whatever key code you want to KEY_Pause. 
  6. If videos play fine on youtube.com, but freeze on the first frame on youtube.com/tv, change the app settings. Open youtube.com/tv, and go to Settings on the left. Clear the watch and search history or reset the app, and disable sounds (video sounds should still work).

Usage Notes


This procedure assumes that LIRC is not being used, and it assumes the browser is already setup on a Linux PC with the proper video format support.  If LIRC is being used or for information about using Chromium with VAAPI support, please see https://forum.mythtv.org/viewtopic.php?f=29&t=238.

No comments:

Post a Comment