Skip to content

Commit 430f187

Browse files
Apply suggestions from code review
Co-authored-by: Luciano Almeida <[email protected]>
1 parent 25c9dad commit 430f187

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

articles/communication-services/quickstarts/voice-video-calling/includes/custom-teams-endpoint/voice-video-calling-cte-ios.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,16 @@ The `startCall` method is set as the action that is performed when the Start Cal
295295

296296
```Swift
297297
let startTeamsCallOptions = StartTeamsCallOptions()
298-
if(sendingVideo)
299-
{
300-
if (self.localVideoStream == nil) {
298+
if sendingVideo {
299+
if self.localVideoStream == nil {
301300
self.localVideoStream = [LocalVideoStream]()
302301
}
303302
let videoOptions = VideoOptions(localVideoStreams: localVideoStream!)
304303
startTeamsCallOptions.videoOptions = videoOptions
305304
}
306-
let callees:[CommunicationIdentifier] = [CommunicationUserIdentifier(self.callee)]
305+
let callees: [CommunicationIdentifier] = [CommunicationUserIdentifier(self.callee)]
307306
self.teamsCallAgent?.startCall(participants: callees, options: startTeamsCallOptions) { (call, error) in
308-
setTeamsCallAndObserver(teamsCall: call, error: error)
307+
// Handle call object if successful or an error.
309308
}
310309
```
311310
## Join a Teams meeting
@@ -316,7 +315,7 @@ The `join` method allows user to join a teams meeting.
316315
let joinTeamsCallOptions = JoinTeamsCallOptions()
317316
if sendingVideo
318317
{
319-
if (self.localVideoStream == nil) {
318+
if self.localVideoStream == nil {
320319
self.localVideoStream = [LocalVideoStream]()
321320
}
322321
let videoOptions = VideoOptions(localVideoStreams: localVideoStream!)
@@ -334,7 +333,7 @@ if isMuted
334333
let teamsMeetingLinkLocator = TeamsMeetingLinkLocator(meetingLink: "https://meeting_link")
335334

336335
self.teamsCallAgent?.join(with: teamsMeetingLinkLocator, options: joinTeamsCallOptions) { (call, error) in
337-
setTeamsCallAndObserver(teamsCall: call, error: error)
336+
// Handle call object if successful or an error.
338337
}
339338
```
340339

@@ -420,25 +419,30 @@ func answerIncomingCall() {
420419
return
421420
}
422421

423-
if localVideoStream == nil {
424-
localVideoStream = [LocalVideoStream]()
422+
if self.localVideoStreams == nil {
423+
self.localVideoStreams = [LocalVideoStream]()
425424
}
426425

427426
if sendingVideo
428427
{
429-
let camera = deviceManager.cameras.first
430-
localVideoStream!.append(LocalVideoStream(camera: camera!))
431-
let videoOptions = VideoOptions(localVideoStreams: localVideoStream!)
428+
guard let camera = deviceManager.cameras.first else {
429+
// Handle failure
430+
return
431+
}
432+
self.localVideoStreams?.append( LocalVideoStream(camera: camera))
433+
let videoOptions = VideoOptions(localVideoStreams: localVideosStreams!)
432434
options.videoOptions = videoOptions
433435
}
434436

435437
teamsIncomingCall.accept(options: options) { (call, error) in
436-
setTeamsCallAndObserver(call: call, error: error)
438+
// Handle call object if successful or an error.
437439
}
438440
}
439441

440-
func declineIncomingCall(){
441-
self.teamsIncomingCall?.reject { (error) in }
442+
func declineIncomingCall() {
443+
self.teamsIncomingCall?.reject { (error) in
444+
// Handle if rejection was successfully or not.
445+
}
442446
}
443447
```
444448

0 commit comments

Comments
 (0)