add Substream indicator in Live Grid

node-20
Moe 2023-08-04 13:00:39 -07:00
parent 441c3242f2
commit 49ed119244
2 changed files with 12 additions and 0 deletions

View File

@ -7491,6 +7491,7 @@ module.exports = function(s,config,lang){
streamBlockHudControlsHtml: `<span title="${lang['Currently viewing']}" class="label label-default">
<span class="viewers"></span>
</span>
<span class="badge btn-success text-white substream-is-on" style="display:none">${lang['Substream']}</span>
<a class="btn btn-sm badge btn-primary run-monitor-detection-trigger-marker">${lang['Add Marker']}</a>
<a class="btn btn-sm badge btn-warning run-monitor-detection-trigger-test">${lang['Test Object Event']}</a>
<a class="btn btn-sm badge btn-warning run-monitor-detection-trigger-test-motion">${lang['Test Motion Event']}</a>

View File

@ -987,6 +987,14 @@ function addMarkAsEventToAllOpenMonitors(){
}
})
}
function showHideSubstreamActiveIcon(monitorId, show){
try{
var liveBlock = liveGridElements[monitorId].monitorItem
liveBlock.find('.substream-is-on')[show ? 'show' : 'hide']()
}catch(err){
}
}
$(document).ready(function(e){
liveGrid
.on('dblclick','.stream-block',function(){
@ -1193,6 +1201,7 @@ $(document).ready(function(e){
break;
case'substream_start':
loadedMonitors[d.mid].subStreamChannel = d.channel
showHideSubstreamActiveIcon(d.mid,true)
setTimeout(() => {
resetMonitorCanvas(d.mid,true,d.channel)
},3000)
@ -1200,6 +1209,7 @@ $(document).ready(function(e){
case'substream_end':
loadedMonitors[d.mid].subStreamChannel = null
resetMonitorCanvas(d.mid,true,null)
showHideSubstreamActiveIcon(d.mid,false)
break;
case'monitor_watch_on':
var monitorId = d.mid || d.id
@ -1216,6 +1226,7 @@ $(document).ready(function(e){
drawLiveGridBlock(loadedMonitors[monitorId],subStreamChannel,monitorsPerRow,monitorHeight)
saveLiveGridBlockOpenState(monitorId,$user.ke,1)
}
showHideSubstreamActiveIcon(monitorId,!!subStreamChannel)
break;
case'mode_jpeg_off':
window.jpegModeOn = false