Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ nms.on('donePlay', (id, StreamPath, args) => {
```js
......
nms.run();

nms.check('viewerConnect', async (args) => { // Same double as PreConnect
console.log('[NodeCheck on viewerConnect]', `args=${JSON.stringify(args)}`);
connect = await function(args) { return ? };

return connect ? true : false;
});

nms.check('preConnect', async (args) => {
console.log('[NodeCheck on preConnect]', `args=${JSON.stringify(args)}`);
connect = await function(args) { return ? };
Expand Down
1 change: 1 addition & 0 deletions node_flv_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class NodeFlvSession {
this.isStarting = true;
Logger.log(`[${this.TAG} connect] id=${this.id} ip=${this.ip} args=${JSON.stringify(urlInfo.query)}`);
context.nodeEvent.emit("preConnect", this.id, this.connectCmdObj);

if (!this.isStarting) {
this.stop();
return;
Expand Down
6 changes: 3 additions & 3 deletions node_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ class NodeHttpServer {
let socket = session instanceof NodeFlvSession || session instanceof NodeHlsSession ? session.req.socket : session.socket;
context.stat.inbytes += socket.bytesRead;
context.stat.outbytes += socket.bytesWritten;
if (session.req) {
context.hlsSessions.delete(session.req.params.key);
}
// if (session.req) {
// context.hlsSessions.delete(session.req.params.key);
// }
}
});
}
Expand Down
8 changes: 1 addition & 7 deletions node_media_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ class NodeMediaServer {
}

async run() {
await Logger.setLogFile({
path: this.config.logging.file_path || '../logs',
output: this.config.logging.file_output || 'NONE'
});

Logger.setLogType(this.config.logging.shell_output || this.config.logType || 'NORMAL');

Logger.setLogType(this.config.logType);
Logger.log(`Node Media Server v${Package.version}`);

if (this.config.rtmp) {
Expand Down
3 changes: 2 additions & 1 deletion node_rtmp_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,8 @@ class NodeRtmpSession {
if (typeof invokeMessage.streamName !== "string") {
return;
}
this.publishStreamPath = "/" + this.appname + "/" + invokeMessage.streamName.split("?")[0];
// this.publishStreamPath = "/" + this.appname + "/" + invokeMessage.streamName.split("?")[0];
this.publishStreamPath = this.appname;
this.publishArgs = QueryString.parse(invokeMessage.streamName.split("?")[1]);
this.publishStreamId = this.parserPacket.header.stream_id;
context.nodeEvent.emit("prePublish", this.id, this.publishStreamPath, this.publishArgs);
Expand Down