addd HPG state
This commit is contained in:
@@ -21,6 +21,8 @@ import { ROOMS } from "_data/livekitRooms";
|
||||
|
||||
export const Audio = () => {
|
||||
const connection = usePilotConnectionStore();
|
||||
const [showSource, setShowSource] = useState(false);
|
||||
|
||||
const {
|
||||
isTalking,
|
||||
toggleTalking,
|
||||
@@ -31,9 +33,16 @@ export const Audio = () => {
|
||||
remoteParticipants,
|
||||
room,
|
||||
message,
|
||||
source,
|
||||
} = useAudioStore();
|
||||
const [selectedRoom, setSelectedRoom] = useState<string>("LST_01");
|
||||
|
||||
useEffect(() => {
|
||||
setShowSource(true);
|
||||
setTimeout(() => {
|
||||
setShowSource(false);
|
||||
}, 2000);
|
||||
}, [source, isTalking]);
|
||||
useEffect(() => {
|
||||
const joinRoom = async () => {
|
||||
if (connection.status != "connected") return;
|
||||
@@ -55,6 +64,9 @@ export const Audio = () => {
|
||||
{state === "error" && (
|
||||
<div className="h-4 flex items-center">{message}</div>
|
||||
)}
|
||||
{showSource && source && (
|
||||
<div className="h-4 flex items-center">{source}</div>
|
||||
)}
|
||||
<button
|
||||
onClick={() => {
|
||||
if (state === "connected") toggleTalking();
|
||||
|
||||
Reference in New Issue
Block a user