function is_process_running($PID) {
exec("ps $PID", $ProcessState);
return(count($ProcessState) >= 2);
}
function kill_process($PID) {
return (exec("kill $PID"));
}
function getPid($pidfile) {
$ret = null;
if (file_exists($pidfile)) {
$pidfileHandle = fopen($pidfile, "r");
$ret = fread($pidfileHandle, filesize($pidfile));
fclose($pidfileHandle);
}
return $ret;
}
function right($value, $count) {
return substr($value, ($count*-1));
}
function stop() {
}
?>
Streaming Server Browser
".$f."\n";
echo "\n";
$command = "vlc --pidfile=$pidfile -d \"$f\" $transcode";
run_in_background($command);
echo "
Watch Now\n";
echo "
Stop\n";
echo "
\n";
}
else {
echo "".htmlentities($dir, ENT_COMPAT, "ISO-8859-1")."
\n";
echo "\n";
if (is_dir($dir)) {
echo "
\n";
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (is_dir($dir."/".$file)) {
if ("." === $file) {
// echo "- ".htmlentities($file, ENT_COMPAT, "ISO-8859-1")."
\n";
}
else if (".." === $file) {
echo "- $file
\n";
}
else {
echo "- ".htmlentities($file, ENT_COMPAT, "ISO-8859-1")."
\n";
}
}
else {
if (false !== ($movie = new ffmpeg_movie($dir."/".$file, false))) {
$duration = $movie->getDuration();
if ($duration > 1) {
echo "- ".htmlentities($file, ENT_COMPAT, "ISO-8859-1")."
\n";
}
}
else if (".ifo" === strtolower(right($file, 4))) {
echo "- ".htmlentities($file, ENT_COMPAT, "ISO-8859-1")."
\n";
}
}
}
closedir($handle);
}
echo "
\n";
}
echo "
\n";
}
?>