-1

I'm developing a mobile application which implements peer to peer video chat using twilio (we are allowing only 2 participants in a given room)

The project is written in c# using Xamarin, so a binding is needed for the twilio sdk. I'm using this one as a base: https://github.com/dkornev/TwilioXamarinBindings , but I've built my own binding using the last version of the twilio sdk available now, which is the v4.2.0 (from here: https://bintray.com/twilio/releases/video-android/4.2.0)

Then, I've used the quickstart project provided by twilio: https://github.com/twilio/video-quickstart-android as the base for our project. I've added some animations to the VideoViews-translation and/or scaling, but that´s all.

The problem is that we've tested the video chat and there is a very noticeable delay in the remote video. The video is like 10 seconds behind, at all times, and even worse, it appears to be played in slow-motion (with time jumps every now and then).

The application is working fine when tested in android 5/5.1 though.

Any clue on how to resolve this will be greatly appreciated!

UPDATE: -This delay can be observed using previous versions of twilio (even with v3.x.x)

-I've took off verything from the logic and the view and left only the connection logic + the VideoView for the remote video alone No change so far.

Could it be related to the video codecs somehow?

UPDATE2 This video delay is happening in emulator with android 9 and in a physical phone with android 9 (which has hw support for H.264). The video can be seen nice, without any delay in emulator with android 5, and physical phones with android 5.1 and 7

Guillermo Gerard
  • 808
  • 10
  • 21

1 Answers1

0

After far more than a week struggling with this issue, I've finally found what's happening (that doesn't mean that I know how to resolve the issue [yet]): We are using Layer to provide messaging functionality and Twilio for voice/video chat. Well, the video delay is caused by the interaction between those two libraries. The delay in the video appears merely by instantiating the LayerClient. We don't need to register the client listeners (there are 3 of them: authentication, connection, sync), we do not need even to call the connect method to see this happening. I'll update this answer if I found any permanent solution or at least a workaround

Guillermo Gerard
  • 808
  • 10
  • 21
  • do you might to share some working sample code in xamarin form with twilio? – Min Hong Tan Nov 02 '20 at 09:37
  • Hi @MinHongTan, I'm not using Forms in this project, it's just a Xamarin Android app. – Guillermo Gerard Nov 02 '20 at 13:35
  • thanks for the reply. do you convert it from android sample to Xamarin android? because i'm a newbie in Xamarin. – Min Hong Tan Nov 04 '20 at 05:42
  • do you able to share some code for your android? because i don't see any example for android. – Min Hong Tan Nov 04 '20 at 05:53
  • Ok, so you just have to add your twilio video binding dll (I'm assuming you know what is a java binding in xamarin) and then you can write a xamarin test app following the official android example: https://github.com/twilio/video-quickstart-android As you may (o may not...) know, once you add the dll to your project, you can translate the java code to c# easily, it is [almost] a copy-paste task – Guillermo Gerard Nov 04 '20 at 13:15
  • Thanks Guillermo Gerard! I managed to code twilio in xamarin android. Alnost copy and paste. May i know is it the same for ios? – Min Hong Tan Nov 10 '20 at 11:43
  • I'm glad to hear that. No, it's not the same, for iOS you have this take a look at this example: https://github.com/twilio/video-quickstart-ios – Guillermo Gerard Nov 10 '20 at 12:30
  • i'm using free apple id, i'm able to develop and deploy normal apps to ios device. but when i include twilio video. it show error "Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile". is it because apple free id? – Min Hong Tan Nov 20 '20 at 00:48
  • Hi @MinHongTan , It sounds like a problem in your xamarin/visual studio/Xcode setup. Check another posts about this matter, like: https://stackoverflow.com/questions/42906973/xamarin-the-executable-was-signed-with-invalid-entitlements – Guillermo Gerard Nov 20 '20 at 13:27
  • already found this solution. but no luck. not sure any other possibility – Min Hong Tan Nov 24 '20 at 13:59
  • i believe is provision profile issue. i'm using free account. will try to subscribe apple developer id. twilio call can wakelock and show incoming call from background? – Min Hong Tan Dec 10 '20 at 09:58