config reshape

This commit is contained in:
legop3
2026-06-30 20:17:43 -04:00
parent 2eb6c00f9c
commit 31eacea7bc
21 changed files with 520 additions and 200 deletions
@@ -40,6 +40,14 @@ function normalizeVideoFilter(value) {
: VIDEO_SETTINGS_DEFAULTS.colorFilter;
}
function hasRoverAudioCapture(rover) {
// The browser asks for the separate "<rover>-audio" WHEP source only when
// roverd's media config says the microphone publisher is enabled and has a
// concrete publish URL. That keeps UI media setup aligned with the daemon
// config instead of probing for streams that should not exist.
return Boolean(rover?.media?.audioCapture?.enabled && rover?.media?.audioCapture?.publishUrl);
}
export default function RoverMediaPlayer({
roverId = null,
sessionInfo = null,
@@ -58,7 +66,7 @@ export default function RoverMediaPlayer({
? state.session.roster.find((item) => String(item.id) === String(effectiveRoverId)) || null
: null,
);
const hasAudio = Boolean(rosterEntry?.media?.audioPublishUrl);
const hasAudio = hasRoverAudioCapture(rosterEntry);
const autoVideoEnabled = videoMode ? videoMode === 'whep' : true;
const autoAudioEnabled = hasAudio;
const autoEntries = useMemo(() => {
@@ -15,6 +15,12 @@ import InfoColumn from './components/InfoColumn.jsx';
import { ROTATE_MS } from './constants.js';
import { formatDriverLabel } from './utils.js';
function hasRoverAudioCapture(rover) {
// Mini uses the same media contract as the full rover player: audio exists
// only when the nested microphone publisher block is enabled and publishable.
return Boolean(rover?.media?.audioCapture?.enabled && rover?.media?.audioCapture?.publishUrl);
}
export default function MiniSummaryContent() {
const { session } = useSession();
const spectatorReady = useSpectatorMode();
@@ -53,7 +59,7 @@ export default function MiniSummaryContent() {
const audioEntries = useMemo(
() =>
driverRoster.flatMap((rover) => {
if (!rover?.id || !rover.media?.audioPublishUrl) return [];
if (!rover?.id || !hasRoverAudioCapture(rover)) return [];
const id = String(rover.id);
return [{ type: 'rover', id: `${id}-audio`, key: `${id}-audio` }];
}),