Add MythTV Menu Button That Launches YouTube

For discussion of topics specific to MythTV on linux
Post Reply
User avatar
heyted
Senior
Posts: 301
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Add MythTV Menu Button That Launches YouTube

Post by heyted »

nexzzt wrote:
heyted wrote:
SpinnerRow wrote:Using OpenELEC 4.0.2 with XBMC. Whenever I go to TV it says there are no PVRs enabled but it is enabled in my PVR Addons. I'm using an HDHomeRun Prime and XBMC and MythTV are on the same box.
I have it the other way around with XBMC installed on Mythbuntu. It was fairly easy to set up.
Screenshot1.png
http://www.youtube.com/watch?v=Ds1NkMXNF1M
What application/plugin are you using for youtube? I am interesting in setting that up.

Thanks
I modified the MythTV menu to launch Chrome in kiosk mode and open YouTube at the TV-formatted site (https://www.youtube.com/tv#/).

The following is what I added in mainmenu.xml:

Code: Select all

   <button>
      <type>TV_WATCH_TV</type>
      <text>YouTube</text>
      <description>Launch Chrome and open YouTube</description>
      <action>EXEC /home/ted/.mythtv/youtube_leanback</action>
   </button>
I added the following file named youtube_leanback:

Code: Select all

irxevent /home/ted/.mythtv/youtube_leanback_lircrc &

unclutter -idle 5 &

google-chrome --kiosk https://www.youtube.com/tv#/browse

killall irxevent

killall unclutter


I am not sure if unclutter needs to be used the way it is used above, but it works to hide the cursor.

The following is my youtube_leanback_lircrc file:

Code: Select all

begin
    prog = irxevent
    button = KEY_PLAY
    repeat = 0
    config = Key space CurrentWindow
end
begin
    prog = irxevent
    button = KEY_PAUSE
    repeat = 0
    config = Key space CurrentWindow
end
begin
    prog = irxevent
    button = KEY_LEFT
    repeat = 0
    config = Key Left CurrentWindow
end
begin
    prog = irxevent
    button = KEY_RIGHT
    repeat = 0
    config = Key Right CurrentWindow
end

begin
    prog = irxevent
    button = KEY_STOP
    repeat = 0
    config = Key ctrl-w CurrentWindow
end

begin
    prog = irxevent
    button = KEY_BACK
    repeat = 0
    config = Key Escape CurrentWindow
end

begin
    prog = irxevent
    button = KEY_UP
    repeat = 0
    config = Key Up CurrentWindow
end

begin
    prog = irxevent
    button = KEY_DOWN
    repeat = 0
    config = Key Down CurrentWindow
end

begin
    prog = irxevent
    button = KEY_OK
    repeat = 0
    config = Key Return CurrentWindow
end
begin
    prog = irxevent
    button = KEY_ENTER
    repeat = 0
    config = Key F11 CurrentWindow
end
Ted | My blog
paulg
Newcomer
Posts: 9
Joined: Sat May 10, 2014 1:58 am

Re: Add MythTV Menu Button That Launches YouTube

Post by paulg »

Thanks, this looks useful! I'll check this out.
jamieb122
Newcomer
Posts: 2
Joined: Tue Nov 11, 2014 1:45 pm
United States of America

Re: Add MythTV Menu Button That Launches YouTube

Post by jamieb122 »

When doing this, how does this prevent mythfrontend from receiving those same button presses while the kiosk is in the foreground?
User avatar
heyted
Senior
Posts: 301
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: Add MythTV Menu Button That Launches YouTube

Post by heyted »

From http://www.mythtv.org/wiki/menu_theme_development_guide with an example:
To execute an external program through the MythTV menus and tell MythTV to ignore LIRC button presses until the program exits, add an EXEC action to the desired menu:

Code: Select all

  <button>
     <type>DVD</type>
     <text>Watch DVD</text>
     <action>EXEC xine --fullscreen dvd:/</action>
  </button>
I hope this helps.
Ted | My blog
User avatar
heyted
Senior
Posts: 301
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: Add MythTV Menu Button That Launches YouTube

Post by heyted »

Some quick notes showing the steps I used to get this working with Intel graphics are below. I verified hardware acceleration is working with a NUC having a 6th generation Intel Core i5-6260U processor and Intel Iris 540 graphics.
  1. Update the Intel graphics driver using the update tool from Intel. This may not be necessary. https://01.org/linuxgraphics/downloads/update-tool
  2. Chrome and Chromium do not currently support VAAPI. Install the custom Chromium build that does support VAAPI using the instructions found at https://launchpad.net/~saiarcot895/+arc ... romium-dev. Thank you Saikrishna.
  3. From my testing, the custom Chromium build noted above or the driver does not support the default YouTube video format. Fortunately, YouTube has a H.264 version for most videos. Install the h264ify extension from the Chrome Web Store which makes YouTube stream H.264 videos.
  4. If the cursor does not disappear, optionally install xwit. Open a terminal and enter "sudo apt install xwit" without the quotes. You may need to change the numbers in the bash file noted below depending on your TV resolution. Another option would be to install Unclutter.
  5. Copy the attached bash and menu file 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.
  6. I do not currently use LIRC, so no LIRC file is needed. To close the Chromium window, I just set a single key on my 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. There is probably a better way of doing this since it changes the break key system wide.
  7. 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).
I hope I did not miss a step. Does this work for you?
Attachments
Menu_and_sh_files.zip
(805 Bytes) Downloaded 94 times
Ted | My blog
Post Reply