From 71cd024fda7476583b7e5e1dfe078d1a5def1b2f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 19 Mar 2019 12:16:31 -0400 Subject: [PATCH] spacing updates. Use MP4 instead of H264/H265 in viewing codec dropdown --- db/zm_create.sql.in | 2 +- db/zm_update-1.33.4.sql | 2 +- web/skins/classic/views/event.php | 43 ++++++++++++++--------------- web/skins/classic/views/monitor.php | 3 +- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 3366a0b35..53a6a13af 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -499,7 +499,7 @@ CREATE TABLE `Monitors` ( `ReturnDelay` smallint(5) unsigned, `DefaultRate` smallint(5) unsigned NOT NULL default '100', `DefaultScale` smallint(5) unsigned NOT NULL default '100', - `DefaultCodec` enum('auto','H264','H265','MJPEG') NOT NULL default 'auto', + `DefaultCodec` enum('auto','MP4','MJPEG') NOT NULL default 'auto', `SignalCheckPoints` INT UNSIGNED NOT NULL default '0', `SignalCheckColour` varchar(32) NOT NULL default '#0000BE', `WebColour` varchar(32) NOT NULL default 'red', diff --git a/db/zm_update-1.33.4.sql b/db/zm_update-1.33.4.sql index 69fb27ff6..d9b498bc8 100644 --- a/db/zm_update-1.33.4.sql +++ b/db/zm_update-1.33.4.sql @@ -5,7 +5,7 @@ SET @s = (SELECT IF( AND column_name = 'DefaultCodec' ) > 0, "SELECT 'Column DefaultCodec already exists in Monitors'", - "ALTER TABLE Monitors ADD `DefaultCodec` enum('auto','H264','H265','MJPEG') NOT NULL default 'auto' AFTER `DefaultScale`" + "ALTER TABLE Monitors ADD `DefaultCodec` enum('auto','MP4','MJPEG') NOT NULL default 'auto' AFTER `DefaultScale`" )); PREPARE stmt FROM @s; diff --git a/web/skins/classic/views/event.php b/web/skins/classic/views/event.php index f02b099a6..a64069ab3 100644 --- a/web/skins/classic/views/event.php +++ b/web/skins/classic/views/event.php @@ -23,20 +23,20 @@ if ( !canView('Events') ) { return; } -$eid = validInt( $_REQUEST['eid'] ); +$eid = validInt($_REQUEST['eid']); $fid = !empty($_REQUEST['fid'])?validInt($_REQUEST['fid']):1; -$Event = new ZM\Event( $eid ); +$Event = new ZM\Event($eid); if ( $user['MonitorIds'] ) { - $monitor_ids = explode( ',', $user['MonitorIds'] ); - if ( count($monitor_ids) and ! in_array( $Event->MonitorId(), $monitor_ids ) ) { + $monitor_ids = explode(',', $user['MonitorIds']); + if ( count($monitor_ids) and ! in_array($Event->MonitorId(), $monitor_ids) ) { $view = 'error'; return; } } $Monitor = $Event->Monitor(); -if (isset($_REQUEST['rate'])) { +if ( isset($_REQUEST['rate']) ) { $rate = validInt($_REQUEST['rate']); } else if ( isset($_COOKIE['zmEventRate']) ) { $rate = $_COOKIE['zmEventRate']; @@ -44,40 +44,39 @@ if (isset($_REQUEST['rate'])) { $rate = reScale(RATE_BASE, $Monitor->DefaultRate(), ZM_WEB_DEFAULT_RATE); } -if (isset($_REQUEST['scale'])) { +if ( isset($_REQUEST['scale']) ) { $scale = validInt($_REQUEST['scale']); -} else if ( isset( $_COOKIE['zmEventScaleAuto'] ) ) { +} else if ( isset($_COOKIE['zmEventScaleAuto']) ) { // If we're using scale to fit use it on all monitors $scale = 'auto'; -} else if ( isset( $_COOKIE['zmEventScale'.$Event->MonitorId()] ) ) { +} else if ( isset($_COOKIE['zmEventScale'.$Event->MonitorId()]) ) { $scale = $_COOKIE['zmEventScale'.$Event->MonitorId()]; } else { $scale = reScale(SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE); } $codec = 'auto'; -if (isset($_REQUEST['codec'])) { +if ( isset($_REQUEST['codec']) ) { $codec = $_REQUEST['codec']; session_start(); $_SESSION['zmEventCodec'.$Event->MonitorId()] = $codec; session_write_close(); -} else if ( isset( $_SESSION['zmEventCodec'.$Event->MonitorId()] ) ) { +} else if ( isset($_SESSION['zmEventCodec'.$Event->MonitorId()]) ) { $codec = $_SESSION['zmEventCodec'.$Event->MonitorId()]; } else { $codec = $Monitor->DefaultCodec(); } $codecs = array( 'auto' => translate('Auto'), - 'H264' => translate('H264'), - 'H265' => translate('H265'), + 'MP4' => translate('MP4'), 'MJPEG' => translate('MJPEG'), ); $replayModes = array( - 'none' => translate('None'), - 'single' => translate('ReplaySingle'), - 'all' => translate('ReplayAll'), - 'gapless' => translate('ReplayGapless'), + 'none' => translate('None'), + 'single' => translate('ReplaySingle'), + 'all' => translate('ReplayAll'), + 'gapless' => translate('ReplayGapless'), ); if ( isset( $_REQUEST['streamMode'] ) ) @@ -106,7 +105,7 @@ if ( $Monitor->VideoWriter() == '2' ) { } parseSort(); -parseFilter( $_REQUEST['filter'] ); +parseFilter($_REQUEST['filter']); $filterQuery = $_REQUEST['filter']['query']; $connkey = generateConnKey(); @@ -115,7 +114,7 @@ $focusWindow = true; $popup = (isset($_REQUEST['popup']) && ($_REQUEST['popup'] == 1)); -xhtmlHeaders(__FILE__, translate('Event') ); +xhtmlHeaders(__FILE__, translate('Event')); ?>
@@ -168,15 +167,15 @@ if ( canEdit('Events') ) { } // end if Event->DefaultVideo ?>
-
-
-
'changeCodec(this);') ); ?>
+
+
+
'changeCodec(this);')); ?>
DefaultVideo() ) { +if ( ($codec == 'MP4' || $codec == 'auto' ) && $Event->DefaultVideo() ) { ?>