mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-24 14:36:09 -04:00
When there isn't an event for the given moment, play the previous one. If still no events found, popup live
This commit is contained in:
@@ -706,12 +706,26 @@ function showOneMonitor(monId) {
|
||||
createPopup(url, 'zmWatch', 'watch', monitorWidth[monId], monitorHeight[monId] );
|
||||
} else {
|
||||
for ( var i=0, len=eId.length; i<len; i++ ) {
|
||||
if ( eMonId[i] == monId && currentTimeSecs >= eStartSecs[i] && currentTimeSecs <= eEndSecs[i] ) {
|
||||
if ( eMonId[i] != monId )
|
||||
continue;
|
||||
|
||||
if ( currentTimeSecs >= eStartSecs[i] && currentTimeSecs <= eEndSecs[i] ) {
|
||||
url="?view=event&eid=" + eId[i] + '&fid=' + parseInt(Math.max(1, Math.min(eventFrames[i], eventFrames[i] * (currentTimeSecs - eStartSecs[i]) / (eEndSecs[i] - eStartSecs[i] + 1) ) ));
|
||||
break;
|
||||
} else if ( currentTimeSecs <= eStartSecs[i] ) {
|
||||
if ( i ) {
|
||||
// Didn't find an exact event, so go with the one before.
|
||||
url="?view=event&eid=" + eId[i] + '&fid=' + parseInt(Math.max(1, Math.min(eventFrames[i], eventFrames[i] * (currentTimeSecs - eStartSecs[i]) / (eEndSecs[i] - eStartSecs[i] + 1) ) ));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
createPopup(url, 'zmEvent', 'event', monitorWidth[monId], monitorHeight[monId]);
|
||||
if ( url ) {
|
||||
createPopup(url, 'zmEvent', 'event', monitorWidth[monId], monitorHeight[monId]);
|
||||
} else {
|
||||
url="?view=watch&mid=" + monId.toString();
|
||||
createPopup(url, 'zmWatch', 'watch', monitorWidth[monId], monitorHeight[monId] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user