Update src/components/control-tray/ControlTray.tsx
Browse files
src/components/control-tray/ControlTray.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import cn from "classnames";
|
|
| 4 |
import React, { memo, RefObject, useEffect, useState, useCallback, useRef } from "react";
|
| 5 |
import { useLiveAPIContext } from "../../contexts/LiveAPIContext";
|
| 6 |
import { AudioRecorder } from "../../lib/audio-recorder";
|
| 7 |
-
import Logo from '../logo/Logo';
|
| 8 |
-
import {
|
| 9 |
|
| 10 |
const SvgSwitchCameraIcon = () => <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="w-[22px] h-[22px]"><path d="M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5"/><path d="M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5"/><path d="m17 12-3-3 3-3"/><path d="m7 12 3 3-3 3"/></svg>;
|
| 11 |
|
|
@@ -190,16 +190,16 @@ const ControlTray: React.FC<ControlTrayProps> = ({ videoRef, onVideoStreamChange
|
|
| 190 |
setIsSwitchingCamera(false);
|
| 191 |
}
|
| 192 |
};
|
|
|
|
|
|
|
| 193 |
|
| 194 |
return (
|
| 195 |
<footer id="footer-controls" className="footer-controls-html-like">
|
| 196 |
<canvas style={{ display: "none" }} ref={renderCanvasRef} />
|
| 197 |
<div id="mic-button" className="control-button mic-button-color" onClick={handleMicToggle}>
|
| 198 |
-
{isAppMicActive ? <
|
| 199 |
</div>
|
| 200 |
-
|
| 201 |
-
{/* --- 👇 تغییر اصلی اینجاست 👇 --- */}
|
| 202 |
-
{/* اگر دوربین فعال است، لوگو را در وسط نمایش بده */}
|
| 203 |
{isAppCamActive && (
|
| 204 |
<div id="small-logo-footer-container" className="small-logo-footer-html-like">
|
| 205 |
<Logo
|
|
@@ -207,7 +207,7 @@ const ControlTray: React.FC<ControlTrayProps> = ({ videoRef, onVideoStreamChange
|
|
| 207 |
isActive={true}
|
| 208 |
isAi={false}
|
| 209 |
speakingVolume={volume}
|
| 210 |
-
isUserSpeaking={
|
| 211 |
/>
|
| 212 |
</div>
|
| 213 |
)}
|
|
|
|
| 4 |
import React, { memo, RefObject, useEffect, useState, useCallback, useRef } from "react";
|
| 5 |
import { useLiveAPIContext } from "../../contexts/LiveAPIContext";
|
| 6 |
import { AudioRecorder } from "../../lib/audio-recorder";
|
| 7 |
+
import Logo from '../logo/Logo';
|
| 8 |
+
import { PauseIconWithSurroundPulse, microphoneIcon, cameraIcon, stopCamIcon, pauseIcon } from '../icons';
|
| 9 |
|
| 10 |
const SvgSwitchCameraIcon = () => <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="w-[22px] h-[22px]"><path d="M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5"/><path d="M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5"/><path d="m17 12-3-3 3-3"/><path d="m7 12 3 3-3 3"/></svg>;
|
| 11 |
|
|
|
|
| 190 |
setIsSwitchingCamera(false);
|
| 191 |
}
|
| 192 |
};
|
| 193 |
+
|
| 194 |
+
const isSpeaking = onUserSpeakingChange.length > 0 && userVolume > 0.01;
|
| 195 |
|
| 196 |
return (
|
| 197 |
<footer id="footer-controls" className="footer-controls-html-like">
|
| 198 |
<canvas style={{ display: "none" }} ref={renderCanvasRef} />
|
| 199 |
<div id="mic-button" className="control-button mic-button-color" onClick={handleMicToggle}>
|
| 200 |
+
{isAppMicActive ? <PauseIconWithSurroundPulse userVolume={userVolume} /> : microphoneIcon}
|
| 201 |
</div>
|
| 202 |
+
|
|
|
|
|
|
|
| 203 |
{isAppCamActive && (
|
| 204 |
<div id="small-logo-footer-container" className="small-logo-footer-html-like">
|
| 205 |
<Logo
|
|
|
|
| 207 |
isActive={true}
|
| 208 |
isAi={false}
|
| 209 |
speakingVolume={volume}
|
| 210 |
+
isUserSpeaking={isSpeaking}
|
| 211 |
/>
|
| 212 |
</div>
|
| 213 |
)}
|