Skip to content

Commit 4172567

Browse files
authored
Test feedback (#30)
First little part: - tappable area - avatar padding - simulator warning
1 parent f43d29d commit 4172567

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ If your agent publishes a [virtual avatar](https://docs.livekit.io/agents/integr
6161

6262
In a production environment, you will be responsible for developing a solution to [generate tokens for your users](https://docs.livekit.io/home/server/generating-tokens/) which is integrated with your authentication solution. You should disable your sandbox token server and modify `TokenService.swift` to use your own token server.
6363

64+
## Running on Simulator
65+
66+
To use this template with video (or screen sharing) input, you need to run the app on a physical device. Testing on the Simulator will still support voice and text modes, as well as virtual avatars.
67+
6468
## Submitting to the App Store
6569

6670
`LiveKitWebRTC.xcframework` binary framework, which is part of the LiveKit Swift SDK, does not contain DSYMs. Submitting the app to the App Store will result in a following warning:

VoiceAgent/ControlBar/ControlBar.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct ControlBar: View {
7777

7878
@ViewBuilder
7979
private func audioControls() -> some View {
80-
HStack(spacing: 2 * .grid) {
80+
HStack(spacing: .zero) {
8181
Spacer()
8282
AsyncButton(action: viewModel.toggleMicrophone) {
8383
HStack(spacing: .grid) {
@@ -89,6 +89,8 @@ struct ControlBar: View {
8989
.id(viewModel.audioTrack?.id)
9090
}
9191
.frame(height: Constants.buttonHeight)
92+
.padding(.horizontal, 2 * .grid)
93+
.contentShape(Rectangle())
9294
}
9395
#if os(macOS)
9496
separator()
@@ -102,12 +104,14 @@ struct ControlBar: View {
102104

103105
@ViewBuilder
104106
private func videoControls() -> some View {
105-
HStack(spacing: 2 * .grid) {
107+
HStack(spacing: .zero) {
106108
Spacer()
107109
AsyncButton(action: viewModel.toggleCamera) {
108110
Image(systemName: viewModel.isCameraEnabled ? "video.fill" : "video.slash.fill")
109111
.transition(.symbolEffect)
110112
.frame(height: Constants.buttonHeight)
113+
.padding(.horizontal, 2 * .grid)
114+
.contentShape(Rectangle())
111115
}
112116
#if os(macOS)
113117
separator()
@@ -125,6 +129,7 @@ struct ControlBar: View {
125129
AsyncButton(action: viewModel.toggleScreenShare) {
126130
Image(systemName: "arrow.up.square.fill")
127131
.frame(width: Constants.buttonWidth, height: Constants.buttonHeight)
132+
.contentShape(Rectangle())
128133
}
129134
.buttonStyle(
130135
ControlBarButtonStyle(
@@ -142,6 +147,7 @@ struct ControlBar: View {
142147
AsyncButton(action: viewModel.toggleTextInput) {
143148
Image(systemName: "ellipsis.message.fill")
144149
.frame(width: Constants.buttonWidth, height: Constants.buttonHeight)
150+
.contentShape(Rectangle())
145151
}
146152
.buttonStyle(
147153
ControlBarButtonStyle(
@@ -159,6 +165,7 @@ struct ControlBar: View {
159165
AsyncButton(action: viewModel.disconnect) {
160166
Image(systemName: "phone.down.fill")
161167
.frame(width: Constants.buttonWidth, height: Constants.buttonHeight)
168+
.contentShape(Rectangle())
162169
}
163170
.buttonStyle(
164171
ControlBarButtonStyle(

VoiceAgent/ControlBar/Devices/AudioDeviceSelector.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct AudioDeviceSelector: View {
2323
Image(systemName: "chevron.down")
2424
.frame(height: 11 * .grid)
2525
.font(.system(size: 12, weight: .semibold))
26+
.contentShape(Rectangle())
2627
}
2728
}
2829
}

VoiceAgent/ControlBar/Devices/VideoDeviceSelector.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct VideoDeviceSelector: View {
2424
Image(systemName: "chevron.down")
2525
.frame(height: 11 * .grid)
2626
.font(.system(size: 12, weight: .semibold))
27+
.contentShape(Rectangle())
2728
}
2829
}
2930
}

VoiceAgent/Localizable.xcstrings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"en" : {
3030
"stringUnit" : {
3131
"state" : "translated",
32-
"value" : "Running on Simulator, functionality may be limited."
32+
"value" : "Running on Simulator, camera and screen sharing will be unavailable."
3333
}
3434
}
3535
}

VoiceAgent/Participant/AgentParticipantView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct AgentParticipantView: View {
1616
SwiftUIVideoView(avatarCameraTrack)
1717
.clipShape(RoundedRectangle(cornerRadius: .cornerRadiusPerPlatform))
1818
.aspectRatio(avatarCameraTrack.aspectRatio, contentMode: .fit)
19+
.padding(.horizontal, avatarCameraTrack.aspectRatio == 1 ? 4 * .grid : .zero)
1920
.shadow(radius: 20, y: 10)
2021
.mask(
2122
GeometryReader { proxy in

0 commit comments

Comments
 (0)