-
Notifications
You must be signed in to change notification settings - Fork 1
Avatar support + remove krisp #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
acebe00
1d7fc38
020ce9c
092ca50
2c8ae8f
f37dc8a
9a83863
f017f68
3334c19
331eaf0
ca49ccb
04c3f9f
6ac671f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1620" | ||
version = "1.7"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES" | ||
buildArchitectures = "Automatic"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B5B5E3B12D124AE00099C9BE" | ||
BuildableName = "VoiceAssistant.app" | ||
BlueprintName = "VoiceAssistant" | ||
ReferencedContainer = "container:VoiceAssistant.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
shouldAutocreateTestPlan = "YES"> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B5B5E3B12D124AE00099C9BE" | ||
BuildableName = "VoiceAssistant.app" | ||
BlueprintName = "VoiceAssistant" | ||
ReferencedContainer = "container:VoiceAssistant.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B5B5E3B12D124AE00099C9BE" | ||
BuildableName = "VoiceAssistant.app" | ||
BlueprintName = "VoiceAssistant" | ||
ReferencedContainer = "container:VoiceAssistant.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import LiveKit | ||
import LiveKitComponents | ||
import SwiftUI | ||
|
||
struct AgentView: View { | ||
@EnvironmentObject private var room: Room | ||
@EnvironmentObject private var participant: Participant | ||
|
||
private var worker: RemoteParticipant? { | ||
room.remoteParticipants.values.first { $0.kind == .agent && $0.attributes["lk.publish_on_behalf"] == participant.identity?.stringValue } | ||
} | ||
|
||
private var cameraTrack: VideoTrack? { | ||
return participant.firstCameraVideoTrack ?? worker?.firstCameraVideoTrack | ||
} | ||
|
||
private var micTrack: AudioTrack? { | ||
return participant.firstAudioTrack ?? worker?.firstAudioTrack | ||
} | ||
|
||
var body: some View { | ||
ZStack { | ||
if let cameraTrack, !cameraTrack.isMuted { | ||
SwiftUIVideoView(cameraTrack) | ||
.clipShape(RoundedRectangle(cornerRadius: 8)) | ||
} else { | ||
AgentBarAudioVisualizer(audioTrack: micTrack, agentState: participant.agentState, barColor: .primary, barCount: 5) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see some opportunity to merge it with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah participantview needs to be updated to handle agent state. ideally once we make the necessary framework updates this whole sample app becomes quite simple |
||
} | ||
} | ||
.id("\(participant.identity?.stringValue ?? "none")-\(cameraTrack?.sid?.stringValue ?? "none")-\(micTrack?.sid?.stringValue ?? "none")") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,13 @@ struct ChatView: View { | |
} | ||
.listStyle(.plain) | ||
.scrollIndicators(.hidden) | ||
.mask( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 nice |
||
LinearGradient( | ||
gradient: Gradient(colors: [.clear, .black, .black]), | ||
startPoint: .top, | ||
endPoint: .init(x: 0.5, y: 0.2) | ||
) | ||
) | ||
} | ||
.animation(.default, value: viewModel.messages) | ||
.alert("Error while connecting to Chat", isPresented: .constant(viewModel.error != nil)) { | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we move it to Room extension for a clearer picture?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would need to move to a new Participant extension if anything, but our focus should be on just solving this in the SDK automatically.