Calculate scale to pass to getStreamSrc for thumbnail still and stream
parent
2d05fbda8d
commit
fe5e005d8e
|
@ -284,16 +284,16 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
|
|||
<?php
|
||||
}
|
||||
$imgHTML='';
|
||||
if ( ZM_WEB_LIST_THUMBS && $monitor['Status'] == 'Connected' && $running ) {
|
||||
if ( ZM_WEB_LIST_THUMBS && ($monitor['Status'] == 'Connected') && $running ) {
|
||||
$options = array();
|
||||
$ratio_factor = $Monitor->Height() / $Monitor->Width();
|
||||
$options['width'] = ZM_WEB_LIST_THUMB_WIDTH;
|
||||
$options['height'] = ZM_WEB_LIST_THUMB_HEIGHT ? ZM_WEB_LIST_THUMB_HEIGHT : ZM_WEB_LIST_THUMB_WIDTH*$ratio_factor;
|
||||
$options['scale'] = intval(ZM_WEB_LIST_THUMB_WIDTH / $Monitor->Width());
|
||||
$options['scale'] = intval(100*ZM_WEB_LIST_THUMB_WIDTH / $Monitor->Width());
|
||||
$options['mode'] = 'single';
|
||||
|
||||
$stillSrc = $Monitor->getStreamSrc($options);
|
||||
$streamSrc = $Monitor->getStreamSrc(array('scale'=>$scale));
|
||||
$streamSrc = $Monitor->getStreamSrc(array('scale'=>$options['scale']*5));
|
||||
|
||||
$thmbWidth = ( $options['width'] ) ? 'width:'.$options['width'].'px;' : '';
|
||||
$thmbHeight = ( $options['height'] ) ? 'height:'.$options['height'].'px;' : '';
|
||||
|
|
Loading…
Reference in New Issue