[mythtv] Re: [mythtv-users] launching movies from mythweb - html
question
Chris Germano
netslayer at hotmail.com
Sun Oct 19 14:36:35 EDT 2003
Not sure if this is what you guys are talking about but I added links to the
show title on mythweb so that I can click to open the files. I gave up on
linking them localy and just made a link from my video directory to one in
the htdocs (ln -s /htdocs/video /home/chris/video) so all i had to do was
../video to get to it from my mythweb dir. If you guys really think this is
helpfull I can rewrite it for compatibility and include instructions.
*This is really rough scripting tailored to my directories. The substring
there needs to cut off the first half of the local path to the file, you can
probably reconstruct it from a bunch of other variables here, just didn't
bother. ie "/home/chris/video/" is 18 characters I chopped off to give me
just the filename.
/mythweb/includes/programs.php
// Load the remaining info we got from mythbackend (this part didn't change,
use as reference)
$this->title = $program_data[0]; // program name/title
// If no title exists, use Show name so link appears (add this)
if ($program_data[1] == " ") {$program_data[1] = $program_data[0];}
// Load Subtitle, add link (replace with this)
$this->subtitle = "<a href=../video/". substr($program_data[8], 18) . ">" .
$program_data[1] . "</a>";
If your really ambitous and want an ASX playlist of files with their titles
then you can follow what I did here. Again it's rough, and customized, but
it works, and well in Windows Media Player.
----
/mythweb/includes/programs.php (add this right after the above assignment of
title & subtitle):
// path to ASX file from mythweb. Again I have mounted my video folder
/video
$ASXFilename = "../video/videoASX.asx";
// Open the file for writing from the end
$fp = fopen($ASXFilename, "a+");
// Add the contents
$ASXdata = "<Entry><ref href=\"" . substr($program_data[8], 18) .
"\"/><title>" . $program_data[0] . " - " . $program_data[1] .
"</title></Entry>\n";
// Write the contents
fwrite($fp, $ASXdata);
fclose($fp);
----
/mythweb/recorded_programs.php
// Add the following right after the main comments at the very top of this
file.
// This empties the old file, and adds this header information to the new
file
$fp = fopen("../video/videoASX.asx", "w+");
$ASXheader = "<ASX version = \"3.0\">";
fwrite($fp, $ASXHeader);
fclose($fp);
-----
/mythweb/recorded_programs.php
// Add the following right after $Page -> print page line:
// Display the page (use as reference)
$Page->print_page();
// Open file, add footer information
$fp = fopen("../video/videoASX.asx", "a");
$ASXFooter = "</ASX>";
fwrite($fp, $ASXFooter);
fclose($fp);
Now each time you load "Recorded Programs" in MythWeb this playlist
including program title and program show information. You can link to it by
just opening the url of the playlist (ie yourserver/video/videoASX.asx) in
your media player. I added a link to the "Recorded Programs" page so that I
could launch the playlist right from there by doing the following. However
at least in windows, I couldn't get the stupid file to prompt for dl, it
kept opening it as a script.
/mythweb/themes/recorded_programs.php
// Add this link to point to your asx file, right above the table tag, half
way down
<a href="../video/videoASX.asx">ASX File Launcher</a>
// use as reference
<table width="100%" border="0" cellpadding="4" cellspacing="2" class="list
small">
<tr class="menu">
_________________________________________________________________
See when your friends are online with MSN Messenger 6.0. Download it now
FREE! http://msnmessenger-download.com
More information about the mythtv-dev
mailing list