tweak auto-closing of Substreams+
parent
3f23502214
commit
c945d53d9f
|
@ -1515,17 +1515,14 @@ module.exports = function(s,config,lang){
|
|||
case'watch_off'://live streamers - leave
|
||||
if(cn.monitorsCurrentlyWatching){delete(cn.monitorsCurrentlyWatching[e.id])}
|
||||
setActiveViewer(e.ke,e.id,cn.id,false)
|
||||
s.debugLog('closeing')
|
||||
let currentCount = getActiveViewerCount(e.ke,e.id)
|
||||
s.debugLog(currentCount,currentCount === 0,!!s.group[e.ke].activeMonitors[e.id].subStreamProcess)
|
||||
clearTimeout(s.group[e.ke].activeMonitors[e.id].noViewerCountDisableSubstream)
|
||||
if(currentCount === 0 && s.group[e.ke].activeMonitors[e.id].subStreamProcessActivated){
|
||||
s.group[e.ke].activeMonitors[e.id].noViewerCountDisableSubstream = setTimeout(async () => {
|
||||
s.group[e.ke].activeMonitors[e.id].noViewerCountDisableSubstream = setTimeout(async () => {
|
||||
let currentCount = getActiveViewerCount(e.ke,e.id)
|
||||
if(currentCount === 0 && s.group[e.ke].activeMonitors[e.id].subStreamProcess){
|
||||
s.group[e.ke].activeMonitors[e.id].allowDestroySubstream = true
|
||||
await destroySubstreamProcess(s.group[e.ke].activeMonitors[e.id])
|
||||
s.debugLog('closed')
|
||||
},10000)
|
||||
}
|
||||
}
|
||||
},10000)
|
||||
break;
|
||||
case'restart'://restart monitor
|
||||
s.sendMonitorStatus({
|
||||
|
|
|
@ -232,7 +232,6 @@ module.exports = (s,config,lang) => {
|
|||
substreamConfig.input.type = !substreamConfig.input.fulladdress ? monitorConfig.type : substreamConfig.input.type || monitorConfig.details.rtsp_transport
|
||||
substreamConfig.input.fulladdress = substreamConfig.input.fulladdress || s.buildMonitorUrl(monitorConfig)
|
||||
substreamConfig.input.rtsp_transport = substreamConfig.input.rtsp_transport || monitorConfig.details.rtsp_transport
|
||||
activeMonitor.subStreamProcessActivated = true
|
||||
const {
|
||||
inputAndConnectionFields,
|
||||
outputFields,
|
||||
|
|
|
@ -606,11 +606,7 @@ function closeAllLiveGridPlayers(rememberClose){
|
|||
$.each(watchedOn,function(n,groupOfMons){
|
||||
$.each(groupOfMons,function(monitorId,monitor){
|
||||
if(monitor === 1){
|
||||
if(rememberClose){
|
||||
mainSocket.f({f:'monitor',ff:'watch_off',id: monitorId})
|
||||
}else{
|
||||
closeLiveGridPlayer(monitorId,true)
|
||||
}
|
||||
mainSocket.f({f:'monitor',ff:'watch_off',id: monitorId})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -926,6 +922,9 @@ $(document).ready(function(e){
|
|||
ff: 'watch_off',
|
||||
id: monitor.mid
|
||||
})
|
||||
setTimeout(function(){
|
||||
saveLiveGridBlockOpenState(monitorId,$user.ke,0)
|
||||
},1000)
|
||||
})
|
||||
})
|
||||
liveGrid
|
||||
|
|
Loading…
Reference in New Issue