mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 01:50:47 -04:00
pete
This commit is contained in:
@@ -5,6 +5,7 @@ const { loadConfig } = require('../../helpers/configLoader');
|
||||
|
||||
const config = loadConfig();
|
||||
const mediaConfig = config.media || {};
|
||||
const PTZ_STREAM_PATH = 'ptz-camera';
|
||||
|
||||
function getPathPrefix() {
|
||||
const base = mediaConfig.whepBaseUrl;
|
||||
@@ -37,6 +38,14 @@ function extractStreamInfo(path) {
|
||||
const remaining = segments.slice(start, end);
|
||||
if (remaining.length === 1) {
|
||||
const rawId = remaining[0] || '';
|
||||
/*
|
||||
PTZ is intentionally published as a flat MediaMTX path so WHEP requests
|
||||
line up with the real stream name. Treat that one reserved path as PTZ
|
||||
before falling back to the normal one-segment rover parsing rules.
|
||||
*/
|
||||
if (rawId === PTZ_STREAM_PATH) {
|
||||
return { type: 'ptz', id: rawId };
|
||||
}
|
||||
if (rawId.endsWith('-fwd')) {
|
||||
return { type: 'rover', id: rawId, baseId: rawId.slice(0, -4) };
|
||||
}
|
||||
@@ -81,6 +90,10 @@ function extractStreamInfoFromBody(body = {}) {
|
||||
extractSrtStreamId(body.query);
|
||||
if (!srtId) return null;
|
||||
|
||||
if (srtId === PTZ_STREAM_PATH) {
|
||||
return { type: 'ptz', id: srtId };
|
||||
}
|
||||
|
||||
if (srtId.endsWith('-fwd')) {
|
||||
return { type: 'rover', id: srtId, baseId: srtId.slice(0, -4) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user