diff --git a/web/app/Controller/MonitorsController.php b/web/app/Controller/MonitorsController.php index e18c114d2..beefe9998 100755 --- a/web/app/Controller/MonitorsController.php +++ b/web/app/Controller/MonitorsController.php @@ -9,7 +9,7 @@ $this->set('monitors', $this->Monitor->find('all', $monitoroptions)); $monitors = $this->Monitor->find('all', array('recursive' => -1, 'fields' => array('Id', 'StreamReplayBuffer'))); foreach ($monitors as $monitor => $mon) { - $streamSrc[$monitor] = $this->Monitor->getStreamSrc($monitor['Monitor']['Id'], $zmBandwidth, $monitor['Monitor']['StreamReplayBuffer']); + $streamSrc[$mon['Monitor']['Id']] = $this->Monitor->getStreamSrc($mon['Monitor']['Id'], $zmBandwidth, $monitor['Monitor']['StreamReplayBuffer']); } $this->set('streamSrc', $streamSrc); } @@ -182,4 +182,4 @@ } } -?> \ No newline at end of file +?> diff --git a/web/app/Model/Monitor.php b/web/app/Model/Monitor.php index 9f050e2a0..f727283be 100644 --- a/web/app/Model/Monitor.php +++ b/web/app/Model/Monitor.php @@ -24,9 +24,9 @@ $ZM_MPEG_LIVE_FORMAT = $ZM_MPEG_LIVE_FORMAT; if ($ZM_WEB_STREAM_METHOD == 'mpeg' && $ZM_MPEG_LIVE_FORMAT) { - return "/cgi-bin/nph-zms?mode=mpeg&scale=100&maxfps=$ZM_WEB_VIDEO_MAXFPS&bitrate=$ZM_WEB_VIDEO_BITRATE&format=$ZM_MPEG_LIVE_FORMAT"; + return "/cgi-bin/nph-zms?mode=mpeg&scale=100&maxfps=$ZM_WEB_VIDEO_MAXFPS&bitrate=$ZM_WEB_VIDEO_BITRATE&format=$ZM_MPEG_LIVE_FORMAT&monitor=$id"; } else { - return "/cgi-bin/nph-zms?mode=jpeg&scale=100&maxfps=$ZM_WEB_VIDEO_MAXFPS&buffer=$buffer"; + return "/cgi-bin/nph-zms?mode=jpeg&scale=100&maxfps=$ZM_WEB_VIDEO_MAXFPS&buffer=$buffer&monitor=$id"; } } diff --git a/web/app/View/Helper/LiveStreamHelper.php b/web/app/View/Helper/LiveStreamHelper.php index ef8bf585d..627e82a2a 100755 --- a/web/app/View/Helper/LiveStreamHelper.php +++ b/web/app/View/Helper/LiveStreamHelper.php @@ -3,8 +3,8 @@ App::uses('AppHelper', 'View/Helper'); class LiveStreamHelper extends AppHelper { public function makeLiveStream($name, $src, $id, $width=0) { - $liveStream = "\"Live"; - return $liveStream; + $liveStream = "\"Live"; + return $src; } public function showNoImage($name, $src, $id, $width=0) { diff --git a/web/app/View/Monitors/index.ctp b/web/app/View/Monitors/index.ctp index e309444be..3e83a2a52 100755 --- a/web/app/View/Monitors/index.ctp +++ b/web/app/View/Monitors/index.ctp @@ -6,13 +6,17 @@
$mon): ?> -
+
LiveStream->makeLiveStream($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $mon['Monitor']['Width']); - else + if($daemonStatus && $mon['Monitor']['Function'] != "None" && $mon['Monitor']['Enabled']) { + echo $this->Html->image($streamSrc[$mon['Monitor']['Id']], array( + 'alt' => 'Live stream of ' . $mon['Monitor']['Name'], + 'id' => 'liveStream_' . $mon['Monitor']['Id'], + )); + } else { echo $this->LiveStream->showNoImage($mon['Monitor']['Name'], $streamSrc[$monitor], $mon['Monitor']['Id'], $width); + } ?>

Html->link($mon['Monitor']['Name'],array('controller' => 'monitors', 'action' => 'view', $mon['Monitor']['Id'])); ?>

@@ -27,4 +31,4 @@ Js->get('#monitors'); $this->Js->sortable(array('complete' => '$.post("/monitors/reorder", $("#monitors").sortable("serialize"))',)); -?> \ No newline at end of file +?> diff --git a/web/app/View/Monitors/view.ctp b/web/app/View/Monitors/view.ctp index 3e22f71a3..08facf8f3 100644 --- a/web/app/View/Monitors/view.ctp +++ b/web/app/View/Monitors/view.ctp @@ -2,7 +2,10 @@ LiveStream->makeLiveStream($monitor['Monitor']['Name'], $streamSrc, $monitor['Monitor']['Id']); + echo $this->Html->image($streamSrc, array( + 'alt' => 'Live stream of ' . $monitor['Monitor']['Name'], + 'id' => 'liveStream_' . $monitor['Monitor']['Id'] + )); else echo $this->LiveStream->showNoImage($monitor['Monitor']['Name'], $streamSrc, $monitor['Monitor']['Id']); ?>