Skip to content

Commit

Permalink
Add Local Session Info Access
Browse files Browse the repository at this point in the history
  • Loading branch information
TekuConcept authored and datagutt committed Jul 7, 2019
1 parent 3f71f07 commit 8d45f2a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions node_media_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ class NodeMediaServer {
getSession(id) {
return context.sessions.get(id);
}

getSessionInfo() {
let info = {
rtmp: 0,
http: 0,
ws: 0
};
for (let session of context.sessions.values()) {
info.rtmp += session.TAG === 'rtmp' ? 1 : 0;
info.http += session.TAG === 'http-flv' ? 1 : 0;
info.ws += session.TAG === 'websocket-flv' ? 1 : 0;
}
return info;
}
}

module.exports = NodeMediaServer

0 comments on commit 8d45f2a

Please sign in to comment.