logger.info('Running RTMP server on port %d', config.rtmp.port)
this.rtmpServer = new NodeRtmpServer(config)
+ this.rtmpServer.tcpServer.on('error', err => {
+ logger.error('Cannot run RTMP server.', { err })
+ })
+
this.rtmpServer.run()
}
private isDurationConstraintValid (streamingStartTime: number) {
const maxDuration = CONFIG.LIVE.MAX_DURATION
// No limit
- if (maxDuration === null) return true
+ if (maxDuration < 0) return true
const now = new Date().getTime()
const max = streamingStartTime + maxDuration
await federateVideoIfNeeded(video, false)
+ PeerTubeSocket.Instance.sendVideoViewsUpdate(video)
+
// Only keep not expired watchers
const newWatchers = watchers.filter(w => w > notBefore)
this.watchersPerVideo.set(videoId, newWatchers)