twilio / video-quickstart-ios

Twilio Video Quickstart for iOS
https://www.twilio.com/docs/api/video
MIT License
457 stars 177 forks source link

Regarding conference call Crash #572

Closed sachinTechugo closed 3 years ago

sachinTechugo commented 3 years ago

one to one video call is going well but i am facing issue when 3 persons are on call and one user disconnect , it will lead to other app crash i am sharing crash log

Assertion failure in -[TVIRemoteVideoTrack addRenderer:applyRotation:], /Users/distiller/project/TwilioVideo/TwilioVideo/Sources/Objective-C/Implementation/Media/TVIVideoTrack.mm:95 2020-11-27 11:33:45.056045+0530 NPNGCoachApp[936:43429] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: adapter.videoRenderer != renderer

I am writing these line of code when call disconnect can anyone help me

self.localVideoTrack?.removeRenderer(self.localView) self.firstRemoteView.invalidateRenderer() self.secondRemoteView.invalidateRenderer() self.localView.invalidateRenderer() self.localView.removeFromSuperview() self.firstRemoteView.removeFromSuperview() self.secondRemoteView.removeFromSuperview() self.remoteParticpantArr.removeAll() self.room?.disconnect() self.camera?.stopCapture() self.localVideoTrack = nil self.localAudioTrack = nil self.camera = nil self.room = nil

ceaglest commented 3 years ago

Hi @sachinTechugo,

Thanks for writing in. This assertion is not very clear to the developer but I can explain -

Assertion failure in -[TVIRemoteVideoTrack addRenderer:applyRotation:], /Users/distiller/project/TwilioVideo/TwilioVideo/Sources/Objective-C/Implementation/Media/TVIVideoTrack.mm:95 2020-11-27 11:33:45.056045+0530 NPNGCoachApp[936:43429] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: adapter.videoRenderer != renderer

This means that you've already added the TVIVideoRenderer to the TVIRemoteVideoTrack once. The assertion happens when you try to add the renderer a second time. Could you modify your code to ensure that -[TVIRemoteVideoTrack addRenderer:] is only called one time?

Best, Chris

ceaglest commented 3 years ago

Hi @sachinTechugo,

Just checking, did you manage to resolve the assertion?

Best, Chris