@@ -137,7 +137,14 @@ class VideoCallViewController: UIViewController, DirectCallDataSource {
137
137
}
138
138
return
139
139
}
140
- self . mirrorLocalVideoView ( )
140
+ DispatchQueue . main. async { [ weak self] in
141
+ guard let self = self else { return }
142
+ switch oppositeCamera. position {
143
+ case . front: self . mirrorLocalVideoView ( isEnabled: true )
144
+ case . back: self . mirrorLocalVideoView ( isEnabled: false )
145
+ default : return
146
+ }
147
+ }
141
148
}
142
149
}
143
150
@@ -194,7 +201,7 @@ extension VideoCallViewController {
194
201
self . localVideoView? . embed ( localSBVideoView)
195
202
self . view? . embed ( remoteSBVideoView)
196
203
197
- self . mirrorLocalVideoView ( )
204
+ self . mirrorLocalVideoView ( isEnabled : true )
198
205
}
199
206
200
207
func resizeLocalVideoView( ) {
@@ -215,9 +222,12 @@ extension VideoCallViewController {
215
222
} )
216
223
}
217
224
218
- func mirrorLocalVideoView( ) {
225
+ func mirrorLocalVideoView( isEnabled : Bool ) {
219
226
guard let localSBView = self . localVideoView? . subviews. first else { return }
220
- localSBView. transform = CGAffineTransform ( scaleX: - 1.0 , y: 1.0 )
227
+ switch isEnabled {
228
+ case true : localSBView. transform = CGAffineTransform ( scaleX: - 1.0 , y: 1.0 )
229
+ case false : localSBView. transform = CGAffineTransform ( scaleX: 1.0 , y: 1.0 )
230
+ }
221
231
}
222
232
223
233
// SendBirdCalls: Start / Stop Video
0 commit comments