Open berto6544-collab opened 1 year ago
For 3 months I've been having a problem connecting to the RTMP server through my phone and OBS. Is anyone else having this same problem?
const nodeMediaServerConfig = { rtmp: { port: 53253, chunk_size: 60000, gop_cache: true, ping: 30, ping_timeout: 60 }, http: { port: 54253, mediaroot: '../public_html/public/assets/img/livestream', allow_origin: '*' }, https: { port: 54254, key:'./privatekey.pem', mediaroot: '../public_html/public/assets/img/livestream', cert:'./cert.pem'
}
};
const nms = new NodeMediaServer(nodeMediaServerConfig); nms.run();
nms.on('preConnect', (id, args) => { console.log('[NodeEvent on preConnect]', id=${id} args=${JSON.stringify(args)}); });
id=${id} args=${JSON.stringify(args)}
nms.on('postConnect', (id, args) => { console.log('[NodeEvent on postConnect]', id=${id} args=${JSON.stringify(args)}); });
nms.on('doneConnect', (id, args) => { console.log('[NodeEvent on doneConnect]', id=${id} args=${JSON.stringify(args)}); });
nms.on('prePublish',(id, StreamPath, args) => { console.log( '[NodeEvent on prePublish]', id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)} );
id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}
var streammKey = StreamPath.replace("/live/","")
var streamId = Math.random().toString(36).substring(2, 15);
});
nms.on('postPublish', (id, StreamPath, args) => { console.log( '[NodeEvent on postPublish]', id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)} );
nms.on('donePublish', (id, StreamPath, args) => { console.log( '[NodeEvent on donePublish]', id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)} );
nms.on('prePlay', (id, StreamPath, args) => { console.log( '[NodeEvent on prePlay]', id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)} ); });
nms.on('postPlay', (id, StreamPath, args) => { console.log( '[NodeEvent on postPlay]', id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)} ); });
nms.on('donePlay', (id, StreamPath, args) => { console.log( '[NodeEvent on donePlay]', id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)} ); });
this is my code but it seems that its not working.
I can view it fine on http, but NOT on https
http
https
For 3 months I've been having a problem connecting to the RTMP server through my phone and OBS. Is anyone else having this same problem?
const nodeMediaServerConfig = { rtmp: { port: 53253, chunk_size: 60000, gop_cache: true, ping: 30, ping_timeout: 60 }, http: { port: 54253, mediaroot: '../public_html/public/assets/img/livestream', allow_origin: '*' }, https: { port: 54254, key:'./privatekey.pem', mediaroot: '../public_html/public/assets/img/livestream', cert:'./cert.pem'
}
};
const nms = new NodeMediaServer(nodeMediaServerConfig); nms.run();
nms.on('preConnect', (id, args) => { console.log('[NodeEvent on preConnect]',
id=${id} args=${JSON.stringify(args)}
); });nms.on('postConnect', (id, args) => { console.log('[NodeEvent on postConnect]',
id=${id} args=${JSON.stringify(args)}
); });nms.on('doneConnect', (id, args) => { console.log('[NodeEvent on doneConnect]',
id=${id} args=${JSON.stringify(args)}
); });nms.on('prePublish',(id, StreamPath, args) => { console.log( '[NodeEvent on prePublish]',
id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}
);var streammKey = StreamPath.replace("/live/","")
var streamId = Math.random().toString(36).substring(2, 15);
});
nms.on('postPublish', (id, StreamPath, args) => { console.log( '[NodeEvent on postPublish]',
id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}
);var streammKey = StreamPath.replace("/live/","")
});
nms.on('donePublish', (id, StreamPath, args) => { console.log( '[NodeEvent on donePublish]',
id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}
);var streammKey = StreamPath.replace("/live/","")
});
nms.on('prePlay', (id, StreamPath, args) => { console.log( '[NodeEvent on prePlay]',
id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}
); });nms.on('postPlay', (id, StreamPath, args) => { console.log( '[NodeEvent on postPlay]',
id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}
); });nms.on('donePlay', (id, StreamPath, args) => { console.log( '[NodeEvent on donePlay]',
id=${id} StreamPath=${StreamPath} args=${JSON.stringify(args)}
); });this is my code but it seems that its not working.