INNER CODE UNIT · JavaScript
initConnState
riclolsen/json-scada · src/camera-onvif/index.js:353
function initConnState(conn) {
conn.cam = null
conn.input = null
conn.stream = null
conn.snapshotUri = null
conn.retryTimer = null
conn.snapshotTimer = null
conn.stopRequested = false
conn.invalidConfig = false
conn.runtime = { ffmpegRestarts: 0, lastSnapshotTime: null }
if (!Array.isArray(conn.endpointURLs) || conn.endpointURLs.length === 0) {
Log.log(`${conn.name} - Connection has no endpoint URLs!`, Log.levelError)
conn.invalidConfig = true
return
}
// http/https URLs address ONVIF device services, any other URL scheme
// (rtsp, rtmp, udp, srt, ...) is used as a direct ffmpeg stream input