Beispiel #1
0
function getNearEvents()
{
    global $user, $sortColumn, $sortOrder;
    $eventId = $_REQUEST['id'];
    $event = dbFetchOne('select * from Events where Id = ?', NULL, array($eventId));
    parseFilter($_REQUEST['filter']);
    parseSort();
    if ($user['MonitorIds']) {
        $midSql = " and MonitorId in (" . join(",", preg_split('/["\'\\s]*,["\'\\s]*/', $user['MonitorIds'])) . ")";
    } else {
        $midSql = '';
    }
    $sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where {$sortColumn} " . ($sortOrder == 'asc' ? '<=' : '>=') . " '" . $event[$_REQUEST['sort_field']] . "'" . $_REQUEST['filter']['sql'] . $midSql . " order by {$sortColumn} " . ($sortOrder == 'asc' ? 'desc' : 'asc');
    $result = dbQuery($sql);
    while ($id = dbFetchNext($result, 'Id')) {
        if ($id == $eventId) {
            $prevEvent = dbFetchNext($result);
            break;
        }
    }
    $sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where {$sortColumn} " . ($sortOrder == 'asc' ? '>=' : '<=') . " '" . $event[$_REQUEST['sort_field']] . "'" . $_REQUEST['filter']['sql'] . $midSql . " order by {$sortColumn} {$sortOrder}";
    $result = dbQuery($sql);
    while ($id = dbFetchNext($result, 'Id')) {
        if ($id == $eventId) {
            $nextEvent = dbFetchNext($result);
            break;
        }
    }
    $result = array('EventId' => $eventId);
    $result['PrevEventId'] = empty($prevEvent) ? 0 : $prevEvent['Id'];
    $result['NextEventId'] = empty($nextEvent) ? 0 : $nextEvent['Id'];
    $result['PrevEventDefVideoPath'] = empty($prevEvent) ? 0 : getEventDefaultVideoPath($prevEvent);
    $result['NextEventDefVideoPath'] = empty($nextEvent) ? 0 : getEventDefaultVideoPath($nextEvent);
    return $result;
}
Beispiel #2
0
      <div id="eventVideo" class="">
<?php 
if ($event['VideoWriter']) {
    ?>
    <link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
    <script src="//vjs.zencdn.net/4.11/video.js"></script>
    <div id="videoFeed">
      <video id="videoobj" class="video-js vjs-default-skin" width="<?php 
    echo reScale($event['Width'], $scale);
    ?>
" height="<?php 
    echo reScale($event['Height'], $scale);
    ?>
" data-setup='{ "controls": true, "autoplay": false, "preload": "auto" }' >
      <source src="<?php 
    echo getEventDefaultVideoPath($event);
    ?>
" type="video/mp4">
      Your browser does not support the video tag.
      </video>
    </div>
<?php 
} else {
    ?>
    <div id="imageFeed">
<?php 
    if (ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT) {
        $streamSrc = getStreamSrc(array("source=event", "mode=mpeg", "event=" . $eid, "frame=" . $fid, "scale=" . $scale, "rate=" . $rate, "bitrate=" . ZM_WEB_VIDEO_BITRATE, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "format=" . ZM_MPEG_REPLAY_FORMAT, "replay=" . $replayMode));
        outputVideoStream("evtStream", $streamSrc, reScale($event['Width'], $scale), reScale($event['Height'], $scale), ZM_MPEG_LIVE_FORMAT);
    } else {
        $streamSrc = getStreamSrc(array("source=event", "mode=jpeg", "event=" . $eid, "frame=" . $fid, "scale=" . $scale, "rate=" . $rate, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "replay=" . $replayMode));