Difference between revisions of "Play Recordings On Windows From MythWeb"

From MythTV Official Wiki
Jump to: navigation, search
(Installing Required Window Applications: Changed title to videolan)
("setup" is a noun, not a verb.)
 
(27 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:HOWTO]]
 
 
 
==Introduction==
 
==Introduction==
Below are instructions on how users can browse the recordings via Mythweb on a Windows machine and with one click, have it play in [http://www.videolan.org/ VideoLan] (VLC). <strike>Videos can also be played with one click from the MythWeb video listing, but it is necessary to modify code.</strike> This no longer works with MythTV v0.20+
+
Below are instructions on how users can browse the recordings via Mythweb on a Windows machine and with one click, have it play in [http://www.videolan.org/ VideoLan] (VLC).
  
 
'''Notes'''
 
'''Notes'''
 
* These instructions will not work through a firewall or over a slow  < 5Mbps connection and assumes the computers are on the same LAN.
 
* These instructions will not work through a firewall or over a slow  < 5Mbps connection and assumes the computers are on the same LAN.
* It just uses VLC to play the files, not the VLC server to stream the recordings.
+
* It just uses VLC player to view the recordings, not the VLC server to stream the recordings.
* These instructions only work on MythTV 0.20 (or greater)
+
* These instructions only work on MythTV 0.21 (or greater).  If you want instructions that work on 0.20 or lower, then look at the [http://www.mythtv.org/wiki/index.php?title=Play_Recordings_On_Windows_From_MythWeb&oldid=30272 history] of this page.
* These instructions won't work for slave backends (because of limitations with MythWeb) but the recordings can be shared.
+
* These instructions work on Vista as well as XP.
 
* Assumes Fedora Core
 
* Assumes Fedora Core
 +
* Assumes latest version of Videolan, v0.9.6
 +
* Yes, you can use Windows Media Player, but it will not play the High-Def MPEG2 streams.
 +
* '''Requires Firefox''' (well, it doesn't really, the "file://" URLs will open in I.E. but darn if I can be bothered to make it use VLC by default.)
  
The instructions consist of three parts, first install and configure the necessary Windows applications, share the recordings directory via Samba, then modify Mythweb.
+
The instructions consist of three parts, first install and configure the necessary Windows applications, share the recordings directory via Samba, then modify a php file.
  
 
==Time to implement==
 
==Time to implement==
  
* 1/2 hour for recordings and assumes access to MYSQL and setting up Samba via command line
+
* 1 to 1-1/2 hour for recordings and ability to set up Samba via command line
* 1 hour for recordings from both master and slave back ends.
+
  
==Installing Required Videolan==
+
==Install Video Player==
  
First get and install [http://www.videolan.org/ VideoLan] on your Windows machine.  Then place the following code (with notepad) into a file on your windows box called "myth_shellx_vlc_handler.reg" (filename is arbitrary but has to end in .reg).  Save the file and run it - "Yes" you want to modify the registry.
+
===Videolan and Firefox Addon - Launchy===
 +
First get and install [http://www.videolan.org/ VideoLan] on your Windows machine.  Videolan is an open source video player that can handle all the MPEG codecs.
  
<pre>
+
Second, you will need to install the [https://addons.mozilla.org/en-US/firefox/addon/81 Launchy] add-on for Firefox.  It should automatically add Videolan to your list of possible applications to send the link to.  You can check by going under Firefox -> Tools -> Add-ons -> <under Launchy, click on "Options">
Windows Registry Editor Version 5.00
+
  
[HKEY_CLASSES_ROOT\myth]
+
* '''Note:''' You can use other media players but VLC has much better seek hotkeys, i.e. try the forward/backward buttons on your mouse, CTRL-right arrow or ALT-right arrow!
@="URL:MythTV File playback Protocol"
+
"EditFlags"=dword:00000002
+
"Source Filter"="{2D788796-26AD-4457-8097-EF0846CF8C3A}"
+
"URL Protocol"=""
+
  
[HKEY_CLASSES_ROOT\myth\shell]
 
 
[HKEY_CLASSES_ROOT\myth\shell\open]
 
 
[HKEY_CLASSES_ROOT\myth\shell\open\command]
 
@="\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\" \"%1\""
 
</pre>
 
 
* '''Note:''' Make sure the vlc.exe file is in the correct directory above.
 
* '''Note:''' You can use other media players but VLC has much better seek hotkeys, i.e. try the forward/backward buttons on your mouse, CTRL-right arrow or ALT-right arrow!
 
  
 
==Configuring Linux Samba Shares==
 
==Configuring Linux Samba Shares==
  
On your MythTV backend we are going to add a Samba share which will allow any Windows machine on the network to see all the recordings in the recordings directory on a read-only basis. First make sure the Samba and Lisa daemons are running and will start automatically on bootup:
+
On your MythTV backend, we are going to add a Samba share which will allow any Windows machine on the network to see all the recordings in the recordings directory on a read-only basis. First make sure the Samba and Lisa daemons are running and will start automatically on bootup:
  
 
  # /sbin/chkconfig lisa on
 
  # /sbin/chkconfig lisa on
Line 51: Line 37:
 
  # /sbin/service smb start
 
  # /sbin/service smb start
  
Now, you could edit "/etc/exports" file and add a line to it like "/video/recordings/ *(r,async,all_squash)" (and restart samba) but it is easier to use the graphical interface of KDE.  From the start menu, go to Control Panel -> Internet & Network -> Samba Configuration. You can then click the "Administrator Mode", enter the Root password, and setup the "Base Settings", i.e. Workgroup, Netbios name (leave as default) and the description. Then click on "File Sharing" above in the sidebar and go into "Administrator Mode" again, and "Add" the directory that contains all the MythTV recordings, for example "/video/recordings". Set the share to "visible" but not "writable" to avoid having recordings deleted. The name of the share is used by windows, you could call it "recodings".  
+
Now, you could edit "/etc/exports" file and add a line to it like "/video/recordings/ *(r,async,all_squash)" (and restart samba) but it is easier to use the graphical interface of KDE.  From the start menu, go to Control Panel -> Internet & Network -> Samba Configuration. You can then click the "Administrator Mode", enter the Root password, and setup the "Base Settings", i.e. Workgroup, Netbios name (leave as default) and the description. Then click on "File Sharing" above in the sidebar and go into "Administrator Mode" again, and "Add" the directory that contains all the MythTV recordings, for example "/video/recordings". Set the share to "visible" but not "writable" to avoid having recordings deleted. The name of the share is used by windows, you could call it "recordings".  
  
 +
* Note: To restart samba use "service smb restart"
 
* Note: If you can't see anything under the "Samba Configuration" or "File Sharing", check if the processes are running:
 
* Note: If you can't see anything under the "Samba Configuration" or "File Sharing", check if the processes are running:
 
  # ps -A | grep lisa
 
  # ps -A | grep lisa
Line 63: Line 50:
 
and replace "MyMythBackend" with whatever you want.   
 
and replace "MyMythBackend" with whatever you want.   
  
* Note: One of the benefits of having Samba running is that you can now access MythWeb with the hostname, for example http://MyMythBackend/mythweb
+
* Note: One of the benefits of having Samba running is that you can now access MythWeb with the hostname, for example http://MyMythBackend/mythweb but make sure the "nmb" service is running.
  
 
Now check if your Windows machine can see the recordings directory because there is little point in continuing if it can't. (Give it a few minutes, finding new shares can be slow as it discovers clients, figures out who is the master, etc.) One way to see the share is to enter the following in the Windows Explorer address bar:
 
Now check if your Windows machine can see the recordings directory because there is little point in continuing if it can't. (Give it a few minutes, finding new shares can be slow as it discovers clients, figures out who is the master, etc.) One way to see the share is to enter the following in the Windows Explorer address bar:
Line 75: Line 62:
 
The next step is to pass to VLC a URL from Mythweb that it can then use to play the recording off the samba share.
 
The next step is to pass to VLC a URL from Mythweb that it can then use to play the recording off the samba share.
  
This would have been dead easy through the MythWeb interface because you can modify the value needed under the MythWeb settings page (Click the icon next to the weather icon) -> "MythTV global defaults" -> "Video URL", but it doesn't work (as of v0.20).  Once you hit "Save" any required backward slashes "\" are replaced with "/" forward slashes which windows and VLC won't recognize.  In other words, what you need is something like:
+
The easiest way is to modify one file and at the prompt, first change to the includes directory, make a backup of the file, then edit it:
myth:\\MyMythBackend\recordings
+
but hitting save changes it to
+
myth://MyMythBackend/recordings
+
  
The only way is to modify the field directly in the database from a terminal window:
+
<pre>
# mysql -u root mythconverg
+
# cd /var/www/html/mythweb/includes
(enter the password)
+
# cp utils.php utils.php.mybackup
mysql> UPDATE `settings` SET `data` = 'myth:\\\\MyMythBackend/recordings/',
+
# nano utils.php
`hostname` = NULL WHERE `value` = 'WebVideo_URL' AND `hostname` IS NULL LIMIT 1 ;
+
</pre>
* '''Note''' The multiple backslashes are required, and yes there are forward and back slashes in there but VLC figures it out.
+
* '''Note''' Since this database setting does not exist by default you need to either save something in "MythTV global defaults" -> "Video URL" through MythWeb prior to executing the UPDATE, or change the mysql command to INSERT the setting.
+
*'''Note:''' You should only have to do this once and no modifications are necessary for future upgrades (Yah!!)
+
  
Now if you go back into MythWeb settings page -> MythTV global defaults, you should see the value you modified directly.  If you hit the recordings page and hold you mouse over a thumbnail, you should see in the status bar a link like:
+
Then in the video_url function on about line 328, make the following modifications by changing the original code:
  
myth:\\MyMythbackend/recordings/1043_20060919140000.mpg
+
<pre>
 +
if (!$ext && $_SESSION['file_url_override']) {
 +
...
 +
  // Which protocol should we use for downloads?
 +
</pre>
 +
to this:
 +
<pre>
 +
if (!$ext) {
 +
    $pos1 = stripos($show->filename,"192.168.0.103");
 +
                      # Change this ^^^^^^^^^^^^^
 +
    $video_slave_url = "Mypath\\to\\my\\recordings\\on\\my\\slave\\backend";
 +
          # Change this ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 +
    $video_master_url = "Mypath\\to\\my\\recordings\\on\\my\\master\\backend";
 +
          # Change this ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 +
    if ($pos1 == "")
 +
            return 'file:\\\\'.$video_master_url.str_replace('%2F', '/', rawurlencode(basename($show->filename)));
 +
    else
 +
            return 'file:\\\\'.$video_slave_url.str_replace('%2F', '/', rawurlencode(basename($show->filename)));
 +
}
 +
  // Which protocol should we use for downloads?
 +
</pre>
  
and if you click on it, it should bring up VLC and start playing the recording.
+
Here is how the code works:
 +
For each recording, it matches the IP address of your slave machine, in the example above, 192.168.0.103 and then it sets hard coded variables, first the network path to slave backend and then the path to the master.  If you look at the HTML of the recordings page, there is a large array at the beginning which this script uses.  That array contains the slave and master IP addresses in the .filename attribute.
  
===Slave Back End===
+
Depending on if the IP address in the filename matches the back end IP address or not, it modifies the value returned to the calling function.
The problem with the above code is that some of the recordings could be on a slave backend which means the path to the samba share will not work.  The code below will modify the path based on which backend the file resides on.
+
Note:
+
* It only works for one slave back end
+
* It uses the difference in the .filename attribute, which for slave backends in my case starts with "mythtv" and for files on my master backend start with "/MythTV".  It maybe different on your system - check the HTML source of the recordings page to know for sure.
+
  
First you need another URL in your DB
+
Of course, change the "video_slave_url" to point to your share you set up in previous steps and make sure to use double slashes.<br>  
  INSERT `settings` SET `hostname` = NULL WHERE CONVERT( `value` USING utf8 ) = 'WebVideo_URL_slave' AND CONVERT( `data` USING utf8 ) = 'myth:\\\\mythfrontendhd/hdrecordings/' AND CONVERT( `hostname` USING utf8 ) IS NULL LIMIT 1 ;
+
<b>Notes:</b>
 +
* This code modifies the direct download icon/link [[Image:Video sm.png]]
 +
* This code works for both slave and master backends
 +
* It only works for one slave back end, although it can be expanded easily.
 +
* It ignores the file_url_override switch in the database.
 +
* You don't need to change anything in your database because everything is hardcoded.
  
Modify the "myth:\\\\" part to point to your samba share on your slave, then you will need to modify a file:
+
'''Reload the recordings page and then right click on [[Image:Video sm.png]] and using "Launchy" send the "file:\\Mythbackend\..." URL to Videolan''' - if it works, then backup your file:
#cd /var/www/html/mythweb/modules/tv/tmpl/default
+
#cp recorded.php recorded.php_old
+
#nano recorded.php
+
  
On line 272 or abouts, inside the IF statement underneath where it says:
+
<pre>
  if (file_exists(cache_dir.'/'.basename($show->filename).'.png')) {
+
  #cp utils.php utils.php_modified
  list($width, $height, $type, $attr) = getimagesize(cache_dir.'/'.basename($show->filename).'.png');
+
</pre>
 
+
===Upgrading===
Add the following code:
+
When the next update overwrites your modified file, diff the files to make sure no major changes have occurred, then copy your custom file back over the new oneI have a little script I run after each upgrade that does everything for me:
                $pos1 = stripos($show->filename, "mythtv");
+
<pre>
                $video_url_slave = setting('WebVideo_URL_slave');
+
#!/bin/bash
                if ($pos1 == "")
+
echo "---------------------> Now checking the diff of utils.php..."
                        $modified_url= $video_url_slave.str_replace('%2F', '/',rawurlencode(basename($show->filename)));
+
cd /var/www/html/mythweb/includes
                else
+
diff utils.php utils.php_modified
                        $modified_url=$show->url;
+
read -p "Press any key to continue..."
 
+
echo "---------------------> Now copying the old modified utils.php over the new one ..."
The first line tests where in the recording's filename the word mythtv is.  It then gets the path to the slave's samba share from the database (WebVideo_URL_slave)The IF statement then tests the position of "mythtv" is at the start of the filename, i.e. if the filename starts with "mythtv%2F//192.168.xxx.xxx...", then it is a slave recording. Otherwise if the position of "mythtv" is 1 or greater, i.e. "mythtv" is here "/MythTV/...." then it uses the normal URL. It isn't elegant but it works.
+
cp utils.php_modified utils.php
 
+
echo "---------------------> Finished!"
The last change to code is in three places, directly below the IF statement, where it creates the links for the thumbnail, the title and the subtitle, change
+
</pre>
"$show->url" to "$modified_url".
+
It changes into the right directory, does the diff and then pauses while the user checks to see the only difference is the custom code. If everything is ok, it then copies the old modified over the new utils.php.
 
+
Reload the recordings page and if it works, then backup your file
+
 
+
#cp recorded.php recorded.php_modified
+
 
+
When the next update overwrites your modified file, copy your custom file back over the new file.
+
  
 
===Troubleshooting===
 
===Troubleshooting===
Line 138: Line 132:
 
* Is the directory and file in the place you expect, i.e. \\MyMythbackend\recordings\<etc>
 
* Is the directory and file in the place you expect, i.e. \\MyMythbackend\recordings\<etc>
 
* Can you open that file over the share manually with VLC?
 
* Can you open that file over the share manually with VLC?
* Is the path being generated by MythWeb correct?
+
* Is the path being generated by MythWeb correctly?
 
+
After working through the section above for Playing Recordings On Windows From MythWeb, when I went to the recordings page and held my mouse over a thumbnail, I didn't see, in the status bar, a link like:
+
 
+
  myth:\\MyMythbackend/recordings/1043_20060919140000.mpg
+
 
+
and, therefore, clicking on the link did nothing. All of the thumbnail links had only the base URL:
+
 
+
  myth:\\MyMythbackend/recordings/
+
 
+
The only way I could fix the problem was to edit the utils.php file (on my system, it's in /var/www/html/mythweb/includes). In the function video_url, I changed it from:
+
 
+
// Global override?
+
        $video_url = setting('WebVideo_URL');
+
        if ($video_url)
+
            return $video_url;
+
 
+
to:
+
 
+
// Global override?
+
        $video_url_base = setting('WebVideo_URL');
+
        if ($video_url_base) {
+
            $video_url = "$video_url_base"
+
                    .str_replace('%2F', '/', rawurlencode(basename($show->filename)));
+
            return $video_url;
+
        }
+
  
 
==Modifying MythWeb to View Videos==
 
==Modifying MythWeb to View Videos==
  
*'''Big Note: This no longer works in the latest versions and I got sick of modifying the files after every upgrade.  This needs to be properly address in the root code tree.'''
+
TDB
 
+
If you have videos you want to view directly through MythWeb, you can also share it via samba and modify MythWeb to create the correct links, but it requires modifying one file (assuming you use the default skin):
+
Modify
+
* /mythweb/modules/video/handler.php
+
 
+
Change the line at the very bottom which starts with:
+
$this-url = root . implode (...)
+
with
+
<nowiki>$this->url = root . preg_replace('#^'.$mythvideo_dir.'/?#', 'myth:\\\\\\\\\\MyMythBackend\\videos\\', $this->filename);</nowiki>
+
Note:
+
* That's eight backslashes
+
* and the URL should point to your videos directory over the samba share.
+
 
+
Now when you visit the video section of MythWeb, the link should be correct and bring up the movie in VLC when clicked on.  The link should look something like this:
+
myth:\\MyMythBackend\videos\myfavoritemovie.avi
+
 
+
===Troubleshooting===
+
* Again, make sure you can get to the video share directly first.
+
* It should also handle sub directories.
+
 
+
== Modifying MythWEB to point at mapped drives ==
+
 
+
If you would like MythWEB to send a URL of a locally mapped drive to VLC, simply modify /mythweb/modules/tv/tmpl/default/recorded.php
+
 
+
Case:
+
* Remote recordings directory is mapped to a local drive letter, ie:(/mnt/share == Z:)
+
* VLC and video player is working correctly.
+
* You want to click on the shows thumbnail to play.
+
 
+
---
+
Fix:
+
 
+
Modify line 274 in /mythweb/modules/tv/tmpl/default/recorded.php from:
+
 
+
echo "<a href=\"$show->url\" name=\"$row\">"
+
 
+
To:
+
 
+
(replace '///Z:/' with the drive and path of choice)
+
 
+
echo "<a href=\"myth:///Z:/".basename($show->filename)."\" name=\"$row\">"
+
 
+
* '''Note:''' Depending on your video player, it might not accept '/' in the URL.  Change to accepted path format of video player.
+
  
 
==Other alternatives==
 
==Other alternatives==
[http://www.sudu.dk/mythtvplayer/ MythTv Player] - MythTv Player is a free and simple Myth client and player for Windows.
+
See [[Play_Recordings_On_Windows]]
  
[http://tapeworm.spurgeonwoods.com/ Tapeworm] - TapeWorm is a "parasitic" Windows front end for MythTV
+
[[Category:HOWTO]]
 +
[[Category:Windows]]

Latest revision as of 14:34, 8 February 2012

Introduction

Below are instructions on how users can browse the recordings via Mythweb on a Windows machine and with one click, have it play in VideoLan (VLC).

Notes

  • These instructions will not work through a firewall or over a slow < 5Mbps connection and assumes the computers are on the same LAN.
  • It just uses VLC player to view the recordings, not the VLC server to stream the recordings.
  • These instructions only work on MythTV 0.21 (or greater). If you want instructions that work on 0.20 or lower, then look at the history of this page.
  • These instructions work on Vista as well as XP.
  • Assumes Fedora Core
  • Assumes latest version of Videolan, v0.9.6
  • Yes, you can use Windows Media Player, but it will not play the High-Def MPEG2 streams.
  • Requires Firefox (well, it doesn't really, the "file://" URLs will open in I.E. but darn if I can be bothered to make it use VLC by default.)

The instructions consist of three parts, first install and configure the necessary Windows applications, share the recordings directory via Samba, then modify a php file.

Time to implement

  • 1 to 1-1/2 hour for recordings and ability to set up Samba via command line

Install Video Player

Videolan and Firefox Addon - Launchy

First get and install VideoLan on your Windows machine. Videolan is an open source video player that can handle all the MPEG codecs.

Second, you will need to install the Launchy add-on for Firefox. It should automatically add Videolan to your list of possible applications to send the link to. You can check by going under Firefox -> Tools -> Add-ons -> <under Launchy, click on "Options">

  • Note: You can use other media players but VLC has much better seek hotkeys, i.e. try the forward/backward buttons on your mouse, CTRL-right arrow or ALT-right arrow!


Configuring Linux Samba Shares

On your MythTV backend, we are going to add a Samba share which will allow any Windows machine on the network to see all the recordings in the recordings directory on a read-only basis. First make sure the Samba and Lisa daemons are running and will start automatically on bootup:

# /sbin/chkconfig lisa on
# /sbin/service lisa start
# /sbin/chkconfig smb on
# /sbin/service smb start

Now, you could edit "/etc/exports" file and add a line to it like "/video/recordings/ *(r,async,all_squash)" (and restart samba) but it is easier to use the graphical interface of KDE. From the start menu, go to Control Panel -> Internet & Network -> Samba Configuration. You can then click the "Administrator Mode", enter the Root password, and setup the "Base Settings", i.e. Workgroup, Netbios name (leave as default) and the description. Then click on "File Sharing" above in the sidebar and go into "Administrator Mode" again, and "Add" the directory that contains all the MythTV recordings, for example "/video/recordings". Set the share to "visible" but not "writable" to avoid having recordings deleted. The name of the share is used by windows, you could call it "recordings".

  • Note: To restart samba use "service smb restart"
  • Note: If you can't see anything under the "Samba Configuration" or "File Sharing", check if the processes are running:
# ps -A | grep lisa
# ps -A | grep smb

You should also have set the hostname for the machine at this point by

# hostname MyMythBackend

and replace "MyMythBackend" with whatever you want.

  • Note: One of the benefits of having Samba running is that you can now access MythWeb with the hostname, for example http://MyMythBackend/mythweb but make sure the "nmb" service is running.

Now check if your Windows machine can see the recordings directory because there is little point in continuing if it can't. (Give it a few minutes, finding new shares can be slow as it discovers clients, figures out who is the master, etc.) One way to see the share is to enter the following in the Windows Explorer address bar:

\\MyMythBackend\recordings\

replacing the host and share name with yours. Another way is to click on the Start Menu, click Run, and type that into the run command. ie \\192.168.1.123\\recordings\

Modifying Mythweb to View Recordings

The next step is to pass to VLC a URL from Mythweb that it can then use to play the recording off the samba share.

The easiest way is to modify one file and at the prompt, first change to the includes directory, make a backup of the file, then edit it:

# cd /var/www/html/mythweb/includes
# cp utils.php utils.php.mybackup
# nano utils.php

Then in the video_url function on about line 328, make the following modifications by changing the original code:

if (!$ext && $_SESSION['file_url_override']) {
...
   // Which protocol should we use for downloads?

to this:

if (!$ext) {
    $pos1 = stripos($show->filename,"192.168.0.103");
                       # Change this ^^^^^^^^^^^^^ 
    $video_slave_url = "Mypath\\to\\my\\recordings\\on\\my\\slave\\backend";
          # Change this ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    $video_master_url = "Mypath\\to\\my\\recordings\\on\\my\\master\\backend";
          # Change this ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    if ($pos1 == "")
            return 'file:\\\\'.$video_master_url.str_replace('%2F', '/', rawurlencode(basename($show->filename)));
    else
            return 'file:\\\\'.$video_slave_url.str_replace('%2F', '/', rawurlencode(basename($show->filename)));
}
   // Which protocol should we use for downloads?

Here is how the code works: For each recording, it matches the IP address of your slave machine, in the example above, 192.168.0.103 and then it sets hard coded variables, first the network path to slave backend and then the path to the master. If you look at the HTML of the recordings page, there is a large array at the beginning which this script uses. That array contains the slave and master IP addresses in the .filename attribute.

Depending on if the IP address in the filename matches the back end IP address or not, it modifies the value returned to the calling function.

Of course, change the "video_slave_url" to point to your share you set up in previous steps and make sure to use double slashes.
Notes:

  • This code modifies the direct download icon/link Video sm.png
  • This code works for both slave and master backends
  • It only works for one slave back end, although it can be expanded easily.
  • It ignores the file_url_override switch in the database.
  • You don't need to change anything in your database because everything is hardcoded.

Reload the recordings page and then right click on Video sm.png and using "Launchy" send the "file:\\Mythbackend\..." URL to Videolan - if it works, then backup your file:

 #cp utils.php utils.php_modified

Upgrading

When the next update overwrites your modified file, diff the files to make sure no major changes have occurred, then copy your custom file back over the new one. I have a little script I run after each upgrade that does everything for me:

#!/bin/bash
echo "---------------------> Now checking the diff of utils.php..."
cd /var/www/html/mythweb/includes
diff utils.php utils.php_modified
read -p "Press any key to continue..."
echo "---------------------> Now copying the old modified utils.php over the new one ..."
cp utils.php_modified utils.php
echo "---------------------> Finished!"

It changes into the right directory, does the diff and then pauses while the user checks to see the only difference is the custom code. If everything is ok, it then copies the old modified over the new utils.php.

Troubleshooting

There are lots of things that can go wrong and the best way to fix it is to track backwards.

  • Can you see the samba share on your windows machine?
  • Is the directory and file in the place you expect, i.e. \\MyMythbackend\recordings\<etc>
  • Can you open that file over the share manually with VLC?
  • Is the path being generated by MythWeb correctly?

Modifying MythWeb to View Videos

TDB

Other alternatives

See Play_Recordings_On_Windows