コード例 #1
0
ファイル: streams.php プロジェクト: switchUA/stuff
/** returns all movies and corresponding thumbs
 * $from and $to specify start/end time
 *
 * $ret[$moviefilename]=array($thumbfilename1,$thumbfilename2....)
 */
function getmovies($stream, $from = 0, $to = 0, $maxthumbs = 0)
{
    $thumbscount = 0;
    $movies = getdir("streams/{$stream}");
    //sorteer
    rsort($movies);
    foreach ($movies as $movie) {
        if (is_file("{$movie}")) {
            $timestamp = movie2timestamp($movie);
            if ($from && $timestamp < $from) {
                continue;
            }
            if ($to && $timestamp > $to) {
                continue;
            }
            //get thumbs
            $thumbs = getthumbs($movie);
            if ($thumbs) {
                $ret[$movie] = $thumbs;
                $thumbscount += count($thumbs);
            }
            //kappen als we genoeg hebben
            if ($maxthumbs && $thumbscount >= $maxthumbs) {
                break;
            }
        }
    }
    return $ret;
}
コード例 #2
0
ファイル: streams2.php プロジェクト: switchUA/stuff
/** returns all movies and corresponding thumbs
 * $from and $to specify start/end time
 *
 * $ret[$moviefilename]=array($thumbfilename1,$thumbfilename2....)
 */
function getmovies($stream, $from = 0, $to = 0)
{
    $movies = getdir("streams/{$stream}");
    foreach ($movies as $movie) {
        if (is_file("{$movie}")) {
            $timestamp = movie2timestamp($movie);
            if ($from && $timestamp < $from) {
                continue;
            }
            if ($to && $timestamp > $to) {
                continue;
            }
            //get thumbs
            $thumbs = getdir("{$movie}.thumbs");
            asort($thumbs);
            $thumbs = array_reverse($thumbs);
            $ret[$movie] = $thumbs;
        }
    }
    //sorteer
    ksort($ret);
    return array_reverse($ret);
}
コード例 #3
0
ファイル: index2.php プロジェクト: switchUA/stuff
//get data
$movies = getmovies("biercam", $from, $to);
$nav = "<a href='?from=" . ($from - $step) . "&to=" . ($to - $step) . "'>Eerder</a> ";
if ($from + $step < time()) {
    $nav .= "<a href='?from=" . ($from + $step) . "&to=" . ($to + $step) . "'>Later</a>";
}
$nav .= " <a href='?'>Nu</a>";
$nav .= " <a href='view.php?url=mms://lounge.datux.nl:9192&desc=Biercam Live stream 1'>Livestream 1</a>";
$nav .= " <a href='view.php?url=mmsh://lounge.datux.nl:9192&desc=Biercam Live stream 2'>Livestream 2</a>";
$nav .= " <a href='view.php?url=http://lounge.datux.nl:9192&desc=Biercam Live stream 3'>Livestream 3</a>";
//print navigation
echo "{$nav}";
//print the grand movie table
foreach ($movies as $movie => $thumbs) {
    echo "<h1>";
    $time = movie2timestamp($movie);
    printtime($time);
    echo "</h1>";
    echo "<table>";
    $nr = 0;
    echo "<tr>";
    foreach ($thumbs as $thumb) {
        echo "<td id=thumb>";
        echo "<image src='{$thumb}'><br>";
        $thumbtime = filectime($thumb);
        echo date("G:i", $thumbtime);
        $nr++;
        if ($nr == 5) {
            $nr = 0;
            echo "</tr><tr>";
        }
コード例 #4
0
ファイル: view.php プロジェクト: switchUA/stuff
<?php

require_once "streams.php";
head();
$movie_name = $_REQUEST[movie_name];
$start = (int) $_REQUEST[start];
$time = movie2timestamp($movie_name);
$src = "http://" . $_SERVER["HTTP_HOST"] . "/";
if ($start) {
    //indirect omdat we een startpositie hebben
    $src .= "get.php?movie_name={$movie_name}&start={$start}";
} else {
    //rechtstreek via apache
    $src .= $movie_name;
}
echo "<h1>Opname van ";
printtime($time);
echo "</h1>";
echo date("d/m/Y", $time);
echo " " . date("G:i", $time);
if ($start) {
    echo " ({$start} seconden vanaf het begin)";
}
echo "<br>";
echo "\n<embed type='video/x-ms-asf' \n  name='video'\n  width='368px'\n  height='294px'\n  src='{$src}' />\n";
echo "<br>";
echo "<a href='{$src}'>Download</a>";
echo "<span id='{$movie_name}'>";
echo GetRatingHtml($movie_name);
echo "</span>";
foot();