This commit is contained in:
legop3
2025-11-14 02:29:11 -05:00
parent 588c7aa571
commit 440325296c
10 changed files with 56 additions and 19 deletions
+1 -2
View File
@@ -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) {
+2 -2
View File
@@ -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 });