In an earlier post, I explained how I use VLC to watch TV instead of MythTV due to the overhead of MythTV on OSX. VLC streams TV beautifully, and as long as I don't have an upcoming recording, everything works out fine. I also added a 'play' button to the Mythweb TV listings which communicates to the HDHR Prime and tells it which channel to stream. It's quite easy. Here's how I do it.
I imagine if you're running Mythweb, you already have a working web server with PHP installed on it. If you do, adding this code to index.php in a folder called /changechannel in your web folder should work just fine:
<?php $st=(int)$_GET['st']; shell_exec("/usr/bin/hdhomerun_config 131HDHRA3 set /tuner0/vchannel ".$st); ?>
This will simply execute the shell command used to change the channel. Now you can change the channel in a browser:
Note- so can everybody else unless you password protect this directory! You might want to do that and then call:
At the end of this file, I added a small script to perform the AJAX request:
Boom. Then add a call to that function after the icon/number on the listing. I put mine in around line 97 which is right after the closing 'a' tag and before the closing 'td' for that channel:
When all is said and done, you should have a button below all of your channels with a button to play it. Note, this script will not open VLC, so it's assuming you've already got it open perhaps with the command line.
NOTE: hacking Mythweb like this is NOT revision friendly. If Mythweb gets updated in the future, you'll have to re-hack it. This may also fall into legal gray area as I'm technically not using my listings data with MythTV. Use at your own risk!