12
my $file = "/etc/mythtv/mythexport/mythexport.cfg";
13
my ($script,$content) = "";
14
my $template = HTML::Template->new(filename => 'template/html5.tmpl');
16
# if we have a valid config
17
if(-e $file && -s $file > 5){
18
my $cfg = new Config::Simple();
19
$cfg->read($file) || die $cfg->error();
21
my $myth = new MythTV();
23
$connect = $myth->{'dbh'};
27
# find the exported recordings
28
my $query = "SELECT file FROM mythexport where id=?";
29
my $query_handle = $connect->prepare($query);
30
$query_handle->execute($id) || die "Unable to query mythexport table";
32
$content = "<p>This page is a work in progress, it may work for your Anroid device or iPhone.<br />";
34
while ( my $file = $query_handle->fetchrow_array() ) {
35
$content .= "<video width=\"480\" height=\"320\" autobuffer controls onClick=\"this.play();\">
36
<source src=\"/mythexport/video/$file\" /></video>";
42
$content = "<p>Missing or Invalid configuration file, please create one.</p>";
45
$template->param(CONTENT => $content);
47
print generateContentType(), $template->output;