feat(backend): add SIMPLE_STREAMING WebRTC control-path streaming
This commit is contained in:
@@ -4,6 +4,7 @@ import { z } from 'zod';
|
||||
|
||||
import { db } from '../db/client';
|
||||
import { deviceCommands, deviceLinks, devices } from '../db/schema';
|
||||
import { simpleStreamingEnabled } from '../media/config';
|
||||
import { requireAuth } from '../middleware/auth';
|
||||
import { requireDeviceAuth } from '../middleware/device-auth';
|
||||
import { dispatchCommandById } from '../realtime/gateway';
|
||||
@@ -47,6 +48,13 @@ router.post('/', requireAuth, async (req, res) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (simpleStreamingEnabled && parsed.data.commandType === 'start_stream') {
|
||||
res.status(409).json({
|
||||
message: 'start_stream commands are disabled while SIMPLE_STREAMING is enabled; use /streams/request instead',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (parsed.data.sourceDeviceId === parsed.data.targetDeviceId) {
|
||||
res.status(400).json({ message: 'sourceDeviceId and targetDeviceId must differ' });
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user