srtrelay
srtrelay copied to clipboard
add an on_publish_done directive
To match the on_publish support it would be good to also send done messages. This would also match rtmp and would be a way to tag a stream as offline.
nginx-rtmp docs https://github.com/arut/nginx-rtmp-module/wiki/Directives#on_publish_done
I think the API is a bit problematic because it doesn't allow you to reliably know whether a stream is active or not. If either the relay or the api endpoint is restarted you can't really track the state anymore. It may be convenient but it's not really a good solution to the problem.
I think a better solution would be to poll the srtrelay api or nginx-rtmp api for that matter to see the currently active streams.
We are already using the api to get active streams but the same page we have for auth also tracks "live" status. It's something we had and I noticed all the keys that were authenticated showed as live. Looking at the nginx rtmp options I saw we were using the done directive.