mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
whipwhep
This commit is contained in:
File diff suppressed because one or more lines are too long
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-6qqVBdnk.js"></script>
|
<script type="module" crossorigin src="/assets/index-BjEIiAR_.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-WqYsCIRI.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-WqYsCIRI.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -845,7 +845,6 @@ io.on('connection', (socket) => {
|
|||||||
videoSessions.revokeWhere(
|
videoSessions.revokeWhere(
|
||||||
(info) => info?.socketId === socket.id && info?.sourceType === 'roverMic' && info?.sourceId === pathId,
|
(info) => info?.socketId === socket.id && info?.sourceType === 'roverMic' && info?.sourceId === pathId,
|
||||||
);
|
);
|
||||||
startMicWhipRelay(normalized, socket.id);
|
|
||||||
const token = videoSessions.createSession(socket, { type: 'roverMic', id: pathId });
|
const token = videoSessions.createSession(socket, { type: 'roverMic', id: pathId });
|
||||||
const whipUrl = buildWhipUrl(pathId);
|
const whipUrl = buildWhipUrl(pathId);
|
||||||
cb({ success: true, roverId: normalized, pathId, token, whipUrl });
|
cb({ success: true, roverId: normalized, pathId, token, whipUrl });
|
||||||
@@ -854,6 +853,17 @@ io.on('connection', (socket) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on('audio:micWhipReady', ({ roverId } = {}, cb = () => {}) => {
|
||||||
|
try {
|
||||||
|
const normalized = String(roverId || '').trim();
|
||||||
|
ensureAudioForwardPermission(socket, normalized);
|
||||||
|
startMicWhipRelay(normalized, socket.id);
|
||||||
|
cb({ success: true, roverId: normalized });
|
||||||
|
} catch (err) {
|
||||||
|
cb({ error: err.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
socket.on('audio:micWhipStop', ({ roverId } = {}, cb = () => {}) => {
|
socket.on('audio:micWhipStop', ({ roverId } = {}, cb = () => {}) => {
|
||||||
try {
|
try {
|
||||||
const normalized = String(roverId || '').trim();
|
const normalized = String(roverId || '').trim();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default function VipPanel() {
|
|||||||
stopMicForward,
|
stopMicForward,
|
||||||
sendMicChunk,
|
sendMicChunk,
|
||||||
startMicWhip,
|
startMicWhip,
|
||||||
|
readyMicWhip,
|
||||||
stopMicWhip,
|
stopMicWhip,
|
||||||
} = useSession();
|
} = useSession();
|
||||||
const { value: identity, save: saveIdentity } = useSettingsNamespace('identity', { cookieUserId: '' });
|
const { value: identity, save: saveIdentity } = useSettingsNamespace('identity', { cookieUserId: '' });
|
||||||
@@ -60,6 +61,7 @@ export default function VipPanel() {
|
|||||||
stopMicForward={stopMicForward}
|
stopMicForward={stopMicForward}
|
||||||
sendMicChunk={sendMicChunk}
|
sendMicChunk={sendMicChunk}
|
||||||
startMicWhip={startMicWhip}
|
startMicWhip={startMicWhip}
|
||||||
|
readyMicWhip={readyMicWhip}
|
||||||
stopMicWhip={stopMicWhip}
|
stopMicWhip={stopMicWhip}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ export default function VipAudioForwardingCard({
|
|||||||
stopMicForward,
|
stopMicForward,
|
||||||
sendMicChunk,
|
sendMicChunk,
|
||||||
startMicWhip,
|
startMicWhip,
|
||||||
|
readyMicWhip,
|
||||||
stopMicWhip,
|
stopMicWhip,
|
||||||
}) {
|
}) {
|
||||||
const { state: controlState } = useControlSystem();
|
const { state: controlState } = useControlSystem();
|
||||||
@@ -367,6 +368,7 @@ export default function VipAudioForwardingCard({
|
|||||||
}
|
}
|
||||||
const answerSdp = await response.text();
|
const answerSdp = await response.text();
|
||||||
await pc.setRemoteDescription({ type: 'answer', sdp: answerSdp });
|
await pc.setRemoteDescription({ type: 'answer', sdp: answerSdp });
|
||||||
|
await readyMicWhip?.(target);
|
||||||
setMicState('live');
|
setMicState('live');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
try {
|
try {
|
||||||
@@ -381,7 +383,7 @@ export default function VipAudioForwardingCard({
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[startMicWhip, startSocketBridge, stopMicWhip],
|
[readyMicWhip, startMicWhip, startSocketBridge, stopMicWhip],
|
||||||
);
|
);
|
||||||
|
|
||||||
const startMicCapture = useCallback(
|
const startMicCapture = useCallback(
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ const SessionContext = createContext({
|
|||||||
stopMicForward: async () => {},
|
stopMicForward: async () => {},
|
||||||
sendMicChunk: async () => {},
|
sendMicChunk: async () => {},
|
||||||
startMicWhip: async () => {},
|
startMicWhip: async () => {},
|
||||||
|
readyMicWhip: async () => {},
|
||||||
stopMicWhip: async () => {},
|
stopMicWhip: async () => {},
|
||||||
setAudioLevels: async () => {},
|
setAudioLevels: async () => {},
|
||||||
llmControl: async () => {},
|
llmControl: async () => {},
|
||||||
@@ -164,6 +165,7 @@ export function SessionProvider({ children }) {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
startMicWhip: (roverId) => emitWithAck('audio:micWhipStart', { roverId }),
|
startMicWhip: (roverId) => emitWithAck('audio:micWhipStart', { roverId }),
|
||||||
|
readyMicWhip: (roverId) => emitWithAck('audio:micWhipReady', { roverId }),
|
||||||
stopMicWhip: (roverId) => emitWithAck('audio:micWhipStop', { roverId }),
|
stopMicWhip: (roverId) => emitWithAck('audio:micWhipStop', { roverId }),
|
||||||
setAudioLevels: (levels = {}) => emitWithAck('audioLevels:set', levels),
|
setAudioLevels: (levels = {}) => emitWithAck('audioLevels:set', levels),
|
||||||
llmControl: (action, controls = {}) =>
|
llmControl: (action, controls = {}) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user