2012-01-22 19:47:47 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2012-01-22 19:47:47 +00:00
|
|
|
require ts.class pretty_size
|
|
|
|
|
|
|
|
puts "Content-Type: text/html\r\n"
|
|
|
|
|
|
|
|
cgi_input
|
|
|
|
#cgi_dump
|
|
|
|
|
|
|
|
header
|
|
|
|
|
|
|
|
set rfile [cgi_get file]
|
|
|
|
set ts [ts fetch $rfile]
|
|
|
|
if {[catch {$ts get file}]} {
|
|
|
|
puts "Invalid TS file, '$rfile'"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2012-01-25 23:19:57 +00:00
|
|
|
if {![$ts flag "ODEncrypted"]} {
|
|
|
|
set url $rfile
|
|
|
|
} else {
|
|
|
|
lassign [$ts dlnaloc] url
|
|
|
|
if {$url eq ""} {
|
|
|
|
alert("Media is encrypted and not indexed by the DLNA Server.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "
|
|
|
|
<span id=url style=\"display: none\">$url</span>
|
2012-07-16 20:29:59 +00:00
|
|
|
<span id=duration style=\"display: none\">[$ts duration 1]</span>
|
2012-01-25 23:19:57 +00:00
|
|
|
"
|
|
|
|
|
2012-01-22 19:47:47 +00:00
|
|
|
puts {
|
2012-07-16 20:29:59 +00:00
|
|
|
<script language=javascript src=vlc.js></script>
|
|
|
|
<link rel=stylesheet type=text/css href=vlc.css />
|
2012-01-25 23:19:57 +00:00
|
|
|
<script type=text/javascript src=play.js></script>
|
|
|
|
|
2012-01-22 19:47:47 +00:00
|
|
|
<fieldset class=cleft style="margin: 0 1em 1em 1em">
|
|
|
|
<legend>VLC Player</legend>
|
|
|
|
}
|
2012-01-25 23:19:57 +00:00
|
|
|
puts "<span class=also>Now playing: $rfile, [$ts duration] minutes.</span>"
|
2012-01-22 19:47:47 +00:00
|
|
|
puts {
|
2012-01-25 23:19:57 +00:00
|
|
|
<div id=vlc></div>
|
|
|
|
|
|
|
|
<div class=also id=info style="float: right">
|
2012-01-22 19:47:47 +00:00
|
|
|
</div>
|
2012-01-25 23:19:57 +00:00
|
|
|
|
2012-01-22 19:47:47 +00:00
|
|
|
</fieldset>
|
|
|
|
}
|
|
|
|
|