Streaming Tubi TV From MythTV Menu

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
urbnsr
Junior
Posts: 33
Joined: Wed Oct 22, 2014 11:50 am
United States of America

Streaming Tubi TV From MythTV Menu

Post by urbnsr » Mon Dec 30, 2019 6:40 pm

I want to share this info in case someone else may find it useful to stream shows from the internet using the MythTV interface as the starting point. Please let me know of typos and/or better suggestions. This is also based on streaming from Tubi TV (tubitv.com), but I am sure you can adopt other similar streaming sites. I also have this setup to access PlutoTV, but find TubiTV a better interface. This post is based on Ubuntu 18.04 LTS and a step or two assumes that xbindkeys is not being used otherwise.

I have nothing against the way MythTV format is setup for (recording scheduled programming), but when I go through seemingly 100's of cable channels and not finding anything I want to watch, I like the idea of having another source for TV shows and movies. Initiating a browser from the MythTV menu only helps the enjoyment, in my opinion. Streaming programs, while they are available, is sort of a hybrid recording. Plus, if you install this on multiple MythTV frontends and register/log into TubiTV on each frontend, you can stop watching a stream on one TV and pickup your show on another TV.

If similar/better instructions are already posted here previously, tough ;-), Sorry, I couldn't find them :-/



First, I installed a few packages. Chromium Browser, while not my first choice, seems to give me better results streaming:

Code: Select all

sudo apt install chromium-browser xbindkeys xdotool
I already had a local copy of mainmenu.xml in my ~/.mythtv/ directory. If not, this can be applied (modify to your current theme):

Code: Select all

cp /usr/share/mythtv/themes/[Your_Current_Theme]/mainmenu.xml ~/.mythtv/mainmenu.xml
mkdir ~/.mythtv/stream
I then added the following to my ~/.mythtv/mainmenu.xml at a convenient spot:

Code: Select all

<button>
        <type>Tubi_TV</type>
        <text>Tubi TV</text>
        <action>EXEC ~/.mythtv/stream/tubitv</action>
</button>
This assumes there is a file named tubitv in the ~/.mythtv/stream/ directory and this file needs to be marked as executable (chmod +x ~/.mythtv/stream/tubitv). Its contents:

Code: Select all

#!/bin/bash
xbindkeys -f ~/.xbindkeysrc
xscreensaver-command -exit
/usr/bin/chromium-browser https://tubitv.com/home/ --start-fullscreen
killall xbindkeys		#Assumes xbindkeys is not needed outside of this setup.
xscreensaver -nosplash &
exit
I use xbindkeys mostly to kill the browser in order to return to the main MythTV menu via my remote. If you use a standard keyboard, you can simply <Alt-F4> on the keyboard to quit the browser. In my ~/.xbindkeysrc file I have a few entries. Some work, some don't (yet). You will have to figure out what keys on your remote work best for you:

Code: Select all

"~/.mythtv/stream/quitkey"
        XF86WWW
"~/.mythtv/stream/backpage"
        XF86BACK
"~/.mythtv/stream/reload"
        XF86Tools
These entries assume there are three files in the ~/.mythtv/stream/ directory: quitkey, backpage and reload. They need to be marked as executable, also (chmod +x ~/.mythtv/stream/quitkey, chmod +x ~/.mythtv/stream/backpage, chmod +x ~/.mythtv/stream/reload):

quitkey:

Code: Select all

#!/bin/bash
sleep 0.4
xdotool key ALT+F4
exit
backpage:

Code: Select all

#!/bin/bash
xdotool key Alt+Left
exit
reload (doesn't seem to work right for me. Maybe chromium-browser is catching the activation key before xbindkey has a chance):

Code: Select all

#!/bin/bash
xdotool key ctrl+r
exit

Notes: When selecting a stream to watch from Tubi TV, a double left-button mouse click will enlarge to fullscreen. If you double-click during a commercial, a new browser tab will open up to the commercials contents.

I think thats it. Enjoy! If I forgot something, I will edit this post to fix.

Post Reply