illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.89k stars 1.51k forks source link

add update event while publishing #567

Open tolew1 opened 1 year ago

tolew1 commented 1 year ago

Can someone provide insight on how to add an onUpdateevent while the RTMP stream is publishing? One of the features I heavily utilized with nginx-rtmp was the onUpdateevent. You can set it to run a GET or POST command every x seconds. Which the time can be set as a parameter in the config. This is useful if you need to control your streams such as being able to interrupt them to set time limits on how long someone can stream.

https://github.com/arut/nginx-rtmp-module/wiki/Directives#on_update

I'm not familiar enough with node and this to add the event but I'm assuming it would need to be setInterval task that runs and emits an onUpdateevent which would be checked like the other events so you can take action.

Any help would be appreciated. @illuspas

tolew1 commented 1 year ago

Is there anyone that would know if this is possible? @illuspas