mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
connecting to video....
This commit is contained in:
@@ -5,14 +5,16 @@ import React from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import { useSessionSelector } from '../../../context/SessionContext.jsx';
|
||||
import { useTelemetryFrame } from '../../../context/TelemetryContext.jsx';
|
||||
import { useOvercurrentLimiter } from '../../../controls/index.js';
|
||||
import { OVERCURRENT_LABELS } from './constants.js';
|
||||
|
||||
function OvercurrentOverlay({ roverId = null, sensors, overcurrentLimiter = null, compact = false }) {
|
||||
const assignedRoverId = useSessionSelector((state) => state.session?.assignment?.roverId ?? null);
|
||||
const effectiveRoverId = roverId ?? assignedRoverId;
|
||||
const frame = useTelemetryFrame(effectiveRoverId);
|
||||
const internalLimiter = useOvercurrentLimiter(effectiveRoverId);
|
||||
const resolvedSensors = sensors ?? frame?.sensors ?? null;
|
||||
const resolvedOvercurrentLimiter = overcurrentLimiter ?? null;
|
||||
const resolvedOvercurrentLimiter = overcurrentLimiter ?? internalLimiter ?? null;
|
||||
const wheelOvercurrents = resolvedSensors?.wheelOvercurrents || null;
|
||||
const overcurrentMotors = useMemo(
|
||||
() =>
|
||||
|
||||
@@ -534,6 +534,10 @@ export default function RoverMediaPlayer({
|
||||
: audioDetail
|
||||
? `${audioStatus} (${audioDetail})`
|
||||
: audioStatus;
|
||||
const showConnectingOverlay =
|
||||
!usingSnapshot &&
|
||||
!resolvedSessionInfo?.error &&
|
||||
['idle', 'new', 'connecting'].includes(status);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -560,6 +564,13 @@ export default function RoverMediaPlayer({
|
||||
className="h-full w-full object-contain"
|
||||
/>
|
||||
)}
|
||||
{showConnectingOverlay ? (
|
||||
<div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-black/45">
|
||||
<div className="rounded border border-slate-500/70 bg-black/70 px-3 py-1 text-sm font-semibold text-slate-100">
|
||||
Connecting to video....
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
<audio ref={audioRef} autoPlay hidden />
|
||||
<div className="pointer-events-none absolute left-1 top-1 z-20 font-medium text-slate-100 text-[0.65rem]">
|
||||
<div className="flex flex-col gap-0.5 leading-none">
|
||||
|
||||
Reference in New Issue
Block a user