1
0
Fork 0

Correctly close RTMPS server too

This commit is contained in:
Chocobozzz 2021-11-05 11:40:49 +01:00
parent df1db951c5
commit 5037e0e474
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 14 additions and 3 deletions

View file

@ -386,7 +386,9 @@ live:
rtmps: rtmps:
enabled: false enabled: false
port: 1936 port: 1936
# Absolute path
key_file: '' key_file: ''
# Absolute path
cert_file: '' cert_file: ''
# Allow to transcode the live streaming in multiple live resolutions # Allow to transcode the live streaming in multiple live resolutions

View file

@ -150,10 +150,19 @@ class LiveManager {
stop () { stop () {
this.running = false this.running = false
if (this.rtmpServer) {
logger.info('Stopping RTMP server.', lTags()) logger.info('Stopping RTMP server.', lTags())
this.rtmpServer.close() this.rtmpServer.close()
this.rtmpServer = undefined this.rtmpServer = undefined
}
if (this.rtmpsServer) {
logger.info('Stopping RTMPS server.', lTags())
this.rtmpsServer.close()
this.rtmpsServer = undefined
}
// Sessions is an object // Sessions is an object
this.getContext().sessions.forEach((session: any) => { this.getContext().sessions.forEach((session: any) => {