mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
low voltage anode...
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
|||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||||
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
|
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
|
||||||
<title>Multi Roomba Rover</title>
|
<title>Multi Roomba Rover</title>
|
||||||
<script type="module" crossorigin src="/assets/index-C46PGsPy.js"></script>
|
<script type="module" crossorigin src="/assets/index-DcIs3Dc0.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-BxUpjkzh.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-BxUpjkzh.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -86,10 +86,11 @@ io.on('connection', (socket) => {
|
|||||||
throw new Error('video source required');
|
throw new Error('video source required');
|
||||||
}
|
}
|
||||||
if (target.type === 'rover') {
|
if (target.type === 'rover') {
|
||||||
if (!roverManager.rovers.has(target.id)) {
|
const baseId = target.id.endsWith('-audio') ? target.id.slice(0, -6) : target.id;
|
||||||
|
if (!roverManager.rovers.has(baseId)) {
|
||||||
throw new Error('Rover offline');
|
throw new Error('Rover offline');
|
||||||
}
|
}
|
||||||
if (!canViewRover(socket, target.id)) {
|
if (!canViewRover(socket, baseId)) {
|
||||||
throw new Error('Not authorized for video');
|
throw new Error('Not authorized for video');
|
||||||
}
|
}
|
||||||
} else if (target.type === 'room') {
|
} else if (target.type === 'room') {
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ function normalizeEntry(entry) {
|
|||||||
if (typeof entry === 'object') {
|
if (typeof entry === 'object') {
|
||||||
if (entry.type && entry.id) {
|
if (entry.type && entry.id) {
|
||||||
const id = String(entry.id);
|
const id = String(entry.id);
|
||||||
const audioId = entry.audioId ? String(entry.audioId) : null;
|
|
||||||
let key = entry.key;
|
let key = entry.key;
|
||||||
if (!key) {
|
if (!key) {
|
||||||
key = entry.type === 'room' ? `room:${id}` : id;
|
key = entry.type === 'room' ? `room:${id}` : id;
|
||||||
@@ -22,7 +21,6 @@ function normalizeEntry(entry) {
|
|||||||
type: entry.type,
|
type: entry.type,
|
||||||
id,
|
id,
|
||||||
key,
|
key,
|
||||||
audioId,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (entry.roverId) {
|
if (entry.roverId) {
|
||||||
@@ -111,17 +109,7 @@ export function useVideoRequests(sourceList = []) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clearRetry(entry.key);
|
clearRetry(entry.key);
|
||||||
setSources((prev) => {
|
setSources((prev) => ({ ...prev, [entry.key]: resp }));
|
||||||
const next = { ...prev, [entry.key]: resp };
|
|
||||||
if (entry.audioId && resp.url && resp.token) {
|
|
||||||
const audioUrl = resp.url.replace(
|
|
||||||
`/${encodeURIComponent(entry.id)}/whep`,
|
|
||||||
`/${encodeURIComponent(entry.audioId)}/whep`,
|
|
||||||
);
|
|
||||||
next[entry.audioId] = { url: audioUrl, token: resp.token };
|
|
||||||
}
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.info('video:request ok', { entry, url: resp.url });
|
console.info('video:request ok', { entry, url: resp.url });
|
||||||
});
|
});
|
||||||
@@ -146,9 +134,6 @@ export function useVideoRequests(sourceList = []) {
|
|||||||
if (sources[entry.key]) {
|
if (sources[entry.key]) {
|
||||||
next[entry.key] = sources[entry.key];
|
next[entry.key] = sources[entry.key];
|
||||||
}
|
}
|
||||||
if (entry.audioId && sources[entry.audioId]) {
|
|
||||||
next[entry.audioId] = sources[entry.audioId];
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return next;
|
return next;
|
||||||
}, [normalizedKey, sources, normalizedEntries]);
|
}, [normalizedKey, sources, normalizedEntries]);
|
||||||
|
|||||||
Reference in New Issue
Block a user