mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
guh
This commit is contained in:
@@ -23,8 +23,7 @@ function canView(socket) {
|
||||
app.post('/mediamtx/auth', (req, res) => {
|
||||
const body = req.body || {};
|
||||
const path = (body.path || '').replace(/^\//, '');
|
||||
const params = new URLSearchParams(body.query || '');
|
||||
const sessionId = params.get('session');
|
||||
const sessionId = body.user;
|
||||
const roverId = path;
|
||||
|
||||
if (!sessionId || !roverId) {
|
||||
|
||||
@@ -37,8 +37,8 @@ io.on('connection', (socket) => {
|
||||
throw new Error('Not authorized for video');
|
||||
}
|
||||
const sessionId = videoSessions.createSession(socket, roverId);
|
||||
const url = `${mediaConfig.whepBaseUrl.replace(/\/$/, '')}/${roverId}?session=${sessionId}`;
|
||||
cb({ url });
|
||||
const url = `${mediaConfig.whepBaseUrl.replace(/\/$/, '')}/${roverId}`;
|
||||
cb({ url, token: sessionId });
|
||||
} catch (err) {
|
||||
logger.warn('video request failed: %s', err.message);
|
||||
cb({ error: err.message });
|
||||
|
||||
Reference in New Issue
Block a user