Progress!!
Several hurdles hurdled with one last big one. Here's what I've done, if it helps anyone:
Hurdle 1: Get Kodi to play certain files in WMC.
Create/edit
playercorefactory.xml (
wiki) in the userdata folder to tell Kodi which video player to use for *.wtv files:
xml:
<?xml version="1.0" encoding="UTF-8"?>
<playercorefactory>
<players>
<player name="Windows Media Center" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Windows\ehome\ehshell.exe</filename>
<args>"{1}"</args>
<playcountminimumtime>20</playcountminimumtime>
</player>
</players>
<rules action="prepend">
<rule filetypes="wtv" player="Windows Media Center" />
</rules>
</playercorefactory>
After adding WMC's Recorded TV folder under Videos/Files/Add..., Kodi opens WMC to play *.wtv files.
Hurdle 2: Get the files into Kodi's library. The files cannot be moved and Kodi doesn't handle movies and tv shows in the same folder.
Out of the box thought...create a shortcut (.lnk) file! This can be placed anywhere and will play the recording when opened.
Kodi must be told that these files are video files. To do this, create/edit
advancedsettings.xml (
wiki) in the userdata folder:
xml:
<advancedsettings>
<videoextensions>
<add>.lnk</add>
</videoextensions>
</advancedsettings>
We also need to edit
playercorefactory.xml to include *.lnk files to be played by WMC:
xml:
...
<rules action="prepend">
<rule filetypes="wtv|lnk" player="Windows Media Center" />
</rules>
...
Now that Kodi considers that these files are videos, it will scrape them into the library. However, this leads to...
Hurdle 3: WMC launches, but the recording doesn't play.
The path Kodi is passing is something like c:\some\path\recording.wtv.lnk to WMC. Not good. That ".lnk" is messing everything up!
We need a way to just open the file. So, I used a batch file, I called it
PlayWMC.bat:
Code:
@echo off
%1
ping localhost -n 10 >NUL
It should work with just %1 in it. But, it opens and closes too fast and WMC never launches. So, that ping line introduces a delay of about 10 seconds.
Since it takes 3-4 seconds to open WMC, a message for my impatient family was added.
PlayWMC.bat:
Code:
@echo off
%1
echo " _ ____ _____ _____ _ _ _____ ";
echo " | | / __ \ /\ | __ \|_ _|| \ | | / ____| ";
echo " | | | | | | / \ | | | | | | | \| || | __ ";
echo " | | | | | | / /\ \ | | | | | | | . ` || | |_ | ";
echo " | |____| |__| |/ ____ \ | |__| |_| |_ | |\ || |__| | ";
echo " |______|\____//_/ \_\|_____/|_____||_| \_| \_____| ";
echo " ";
echo " ";
echo " _____ _ ______ _____ ______ __ __ _____ _______ ";
echo " | __ \ | | | ____| /\ / ____|| ____| \ \ / //\ |_ _||__ __| ";
echo " | |__) || | | |__ / \ | (___ | |__ \ \ /\ / // \ | | | | ";
echo " | ___/ | | | __| / /\ \ \___ \ | __| \ \/ \/ // /\ \ | | | | ";
echo " | | | |____ | |____ / ____ \ ____) || |____ \ /\ // ____ \ _| |_ | | _ _ _ ";
echo " |_| |______||______|/_/ \_\|_____/ |______| \/ \//_/ \_\|_____| |_|(_)(_)(_)";
echo " ";
echo " ";
ping localhost -n 10 >NUL
Now, we need to edit
playercorefactory.xml so that Kodi loads our batch file instead of WMC. We also need it to show the console window so the family knows something is happening:
xml:
<?xml version="1.0" encoding="UTF-8"?>
<playercorefactory>
<players>
<player name="Windows Media Center" type="ExternalPlayer" audio="false" video="true">
<filename>D:\PlayWMC.bat</filename>
<args>"{1}"</args>
<hideconsole>false</hideconsole>
<playcountminimumtime>20</playcountminimumtime>
</player>
</players>
<rules action="prepend">
<rule filetypes="wtv|lnk" player="Windows Media Center" />
</rules>
</playercorefactory>
And that leads us to the last really big hurdle:
AUTOMATION!
There's not going to be anything out there to do this. So, I'll need to do it myself, probably with a python script.
That'll take me longer to figure out.
One other nice-to-have feature would be returning to Kodi automatically when you stop the video. Maybe an autohotkey script could
intercept the stop or back command and return to Kodi. But that's for after the automation bit.
Hope this makes sense. If anyone has any improvements, please share!