Skip to content

Commit 358c4f0

Browse files
committed
feat: rename camera -> cameraTrack, microphone -> microphoneTrack
1 parent b5b79a4 commit 358c4f0

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

packages/react/src/hooks/useAgent.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ type AgentStateAvailable = AgentInstanceCommon & {
5656
/** Is the agent ready for user interaction? */
5757
isAvailable: true;
5858

59-
camera: TrackReference | null;
60-
microphone: TrackReference | null;
59+
cameraTrack: TrackReference | null;
60+
microphoneTrack: TrackReference | null;
6161
};
6262

6363
type AgentStateUnAvailable = AgentInstanceCommon & {
@@ -67,8 +67,8 @@ type AgentStateUnAvailable = AgentInstanceCommon & {
6767
/** Is the agent ready for user interaction? */
6868
isAvailable: false;
6969

70-
camera: null;
71-
microphone: null;
70+
cameraTrack: null;
71+
microphoneTrack: null;
7272
};
7373

7474
type AgentStateFailed = AgentInstanceCommon & {
@@ -78,8 +78,8 @@ type AgentStateFailed = AgentInstanceCommon & {
7878
/** Is the agent ready for user interaction? */
7979
isAvailable: false;
8080

81-
camera: null;
82-
microphone: null;
81+
cameraTrack: null;
82+
microphoneTrack: null;
8383
};
8484

8585
type AgentActions = {
@@ -397,8 +397,8 @@ export function useAgent(conversation: ConversationStub, _name?: string): AgentI
397397
...generateDerivedStateValues(state),
398398
failureReasons: null,
399399

400-
camera: videoTrack,
401-
microphone: audioTrack,
400+
cameraTrack: videoTrack,
401+
microphoneTrack: audioTrack,
402402
};
403403

404404
case 'unset':
@@ -412,8 +412,8 @@ export function useAgent(conversation: ConversationStub, _name?: string): AgentI
412412
failureReasons: null,
413413

414414
// Clear inner values if no longer connected
415-
camera: null,
416-
microphone: null,
415+
cameraTrack: null,
416+
microphoneTrack: null,
417417
};
418418

419419
case 'failed':
@@ -425,8 +425,8 @@ export function useAgent(conversation: ConversationStub, _name?: string): AgentI
425425
failureReasons,
426426

427427
// Clear inner values if no longer connected
428-
camera: null,
429-
microphone: null,
428+
cameraTrack: null,
429+
microphoneTrack: null,
430430
};
431431
}
432432
}, [

packages/react/src/hooks/useConversationWith.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ type ConversationStateConnecting = ConversationStateCommon & {
7474
isReconnecting: false;
7575

7676
local: {
77-
camera: TrackReferencePlaceholder;
78-
microphone: TrackReferencePlaceholder;
77+
cameraTrack: TrackReferencePlaceholder;
78+
microphoneTrack: TrackReferencePlaceholder;
7979
};
8080
};
8181

@@ -85,8 +85,8 @@ type ConversationStateConnected = ConversationStateCommon & {
8585
isReconnecting: boolean;
8686

8787
local: {
88-
camera: TrackReferenceOrPlaceholder,
89-
microphone: TrackReferenceOrPlaceholder,
88+
cameraTrack: TrackReferenceOrPlaceholder,
89+
microphoneTrack: TrackReferenceOrPlaceholder,
9090
};
9191
};
9292

@@ -96,8 +96,8 @@ type ConversationStateDisconnected = ConversationStateCommon & {
9696
isReconnecting: false;
9797

9898
local: {
99-
camera: TrackReferencePlaceholder;
100-
microphone: TrackReferencePlaceholder;
99+
cameraTrack: TrackReferencePlaceholder;
100+
microphoneTrack: TrackReferencePlaceholder;
101101
};
102102
};
103103

@@ -214,8 +214,8 @@ export function useConversationWith(agentToDispatch: string | RoomAgentDispatch
214214
...generateDerivedConnectionStateValues(ConnectionState.Connecting),
215215

216216
local: {
217-
camera: { participant: localParticipant, source: Track.Source.Camera },
218-
microphone: { participant: localParticipant, source: Track.Source.Microphone },
217+
cameraTrack: { participant: localParticipant, source: Track.Source.Camera },
218+
microphoneTrack: { participant: localParticipant, source: Track.Source.Microphone },
219219
},
220220
};
221221

@@ -229,8 +229,8 @@ export function useConversationWith(agentToDispatch: string | RoomAgentDispatch
229229
...generateDerivedConnectionStateValues(roomConnectionState),
230230

231231
local: {
232-
camera: localCamera ?? { participant: localParticipant, source: Track.Source.Camera },
233-
microphone: localMicrophone ?? { participant: localParticipant, source: Track.Source.Microphone },
232+
cameraTrack: localCamera ?? { participant: localParticipant, source: Track.Source.Camera },
233+
microphoneTrack: localMicrophone ?? { participant: localParticipant, source: Track.Source.Microphone },
234234
},
235235
};
236236

@@ -242,8 +242,8 @@ export function useConversationWith(agentToDispatch: string | RoomAgentDispatch
242242
...generateDerivedConnectionStateValues(ConnectionState.Disconnected),
243243

244244
local: {
245-
camera: { participant: localParticipant, source: Track.Source.Camera },
246-
microphone: { participant: localParticipant, source: Track.Source.Microphone },
245+
cameraTrack: { participant: localParticipant, source: Track.Source.Camera },
246+
microphoneTrack: { participant: localParticipant, source: Track.Source.Microphone },
247247
},
248248
};
249249
}

0 commit comments

Comments
 (0)