1

Description

in my application I am publishing and unpublishing the audio and video tracks when user mute / unmute audio and enable / disable the camera. After 2 three continues tap the application is getting crashed.

I tried to disable the mic button interaction until the audio is not published, as we get callback in localParticipantDidPublishAudioTrack but for un-publish there is no callback. That logic is also crashing. How can I fix this crash

Also please suggest what will be the side effect if I will enable/disable the audio track instead of publish / unpublish. Also what is the recommended approach for both audio and video

Steps to Reproduce

While on the call try monkey tap on mute button and from the code inside publish & unpublish the audio track on each respective tap

Code


@IBAction func micControlAction(_ sender: Any) {
        //Toggle mic
        guard let participant = callViewModel.getCallParticipant(type: .patient) else { return }
        if let audioTrack = participant.audioTrack as? LocalAudioTrack {
            if audioTrack.isEnabled {
                (participant.participant as? LocalParticipant)?.unpublishAudioTrack(audioTrack)
            }
            else {
                (participant.participant as? LocalParticipant)?.publishAudioTrack(audioTrack)
            }
            audioTrack.isEnabled = !audioTrack.isEnabled
            //This will call the observer and the UI will gets updated according to the need
            participant.micEnabled.property = audioTrack.isEnabled
      }
 }

Expected behavior: The user should be able to mute / unmute the mic without any delay.

Actual behavior: Application crashes 100% of time

Logs

libc++abi.dylib: Pure virtual function called!
Pure virtual function called!

Versions

  • Video iOS SDK 4.6.0 via CocoaPods
  • Xcode 13.1
  • iOS Version 13.6.1
  • iOS Device iPad Air
James Z
  • 12,209
  • 10
  • 24
  • 44
Naresh
  • 869
  • 8
  • 17

1 Answers1

1

Based on suggestion on this link, it seems that TwillioVideo 4.6.0 SDK is having issue and reverting to TwillioVideo SDK to version 4.4.0 works fine.

The crash log when using version 4.6.0:

Thread 31 name:
Thread 31 Crashed:
0   libsystem_kernel.dylib          0x00000001ba0e39c4 __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001f3333434 pthread_kill + 268 (pthread.c:1609)
2   libsystem_c.dylib               0x000000018e562f64 abort + 164 (abort.c:118)
3   libc++abi.dylib                 0x000000019bd89bc4 abort_message + 132 (abort_message.cpp:78)
4   libc++abi.dylib                 0x000000019bd89594 __cxa_pure_virtual + 24 (cxa_virtual.cpp:16)
5   TwilioVideo                     0x0000000105686668 0x104fe4000 + 6956648
6   TwilioVideo                     0x000000010568646c 0x104fe4000 + 6956140
7   TwilioVideo                     0x0000000105420e0c 0x104fe4000 + 4443660
8   TwilioVideo                     0x0000000105420db4 0x104fe4000 + 4443572
9   TwilioVideo                     0x0000000105499924 0x104fe4000 + 4938020
10  TwilioVideo                     0x0000000105499188 0x104fe4000 + 4936072
11  TwilioVideo                     0x0000000105498128 0x104fe4000 + 4931880
12  TwilioVideo                     0x0000000105499568 0x104fe4000 + 4937064
13  libsystem_pthread.dylib         0x00000001f332da60 _pthread_start + 148 (pthread.c:890)
14  libsystem_pthread.dylib         0x00000001f332cf5c thread_start + 8
Anmol Suneja
  • 97
  • 11