QuickBlox / quickblox-flutter-sdk

quickblox-flutter-sdk
Other
8 stars 0 forks source link

seems that there is an issue with audio voice not transferring during audio/video calls between Android and iOS in flutter #79

Open anilthummar opened 2 months ago

anilthummar commented 2 months ago

@vdovbnya-qb

It seems that there is an issue with audio voice not transferring during audio/video calls between Android and iOS when using the QuickBlox library in Flutter. This problem occurs approximately 1 to 2 times out of 12 calls.

Can you please help me with the same, I have used the quickblox_sdk: ^0.12.8 version.

await QB.chat .connect(SharedPrefs.getQuickBloxId() ?? 0, "${SharedPrefs.getMobileNumber()}") .whenComplete(() { _initWebRTC(context, sessionType, isFromNotification: isFromNotification); });

  `Future<void> _initWebRTC(BuildContext context, int sessionType,
  {bool isFromNotification = false}) async {
try {
  await QB.webrtc.init().whenComplete(() {
    _subscribeEvents(context, isFromNotification: isFromNotification);
    if (SharedPrefs.getReceiverQuickBloxId() !=
            SharedPrefs.getQuickBloxId() &&
        isFromNotification == false) {
      _createCall(sessionType, context).whenComplete(() async {});
    }
  });
} catch (e) {
  debugPrint(">>>>>>>>>>>>>  ERROR :- _initWebRTC exception");
}

}`

Future<void> _createCall(int sessionType, BuildContext context) async { try { QBRTCSession? session = await QB.webrtc .call([SharedPrefs.getReceiverQuickBloxId() ?? 0], sessionType); _sessionId = session?.id; initiatorId = session?.initiatorId; opponentsIds = session?.opponentsIds; await SharedPrefs.setSessionId("$_sessionId"); } catch (e) { debugPrint(">>>>>>>>>>>>> ERROR :- create Call exception >>>>>>>>>> "); } }

Thank you.

hiteshgarg123 commented 1 month ago

Hello @anilthummar, I hope you are doing well.

In order to understand your issue better, we need you to try out the following steps:

Please perform the above steps and let me know the results.

Best regards,

Hitesh Garg Product Manager QuickBlox

anilthummar commented 1 month ago

Hello @anilthummar, I hope you are doing well.

In order to understand your issue better, we need you to try out the following steps:

Please perform the above steps and let me know the results.

Best regards,

Hitesh Garg Product Manager QuickBlox

@hiteshgarg123 Thank you so much for the given solution, I have tried with update lib but it's not and I will try with videocall_webrtc_sample and let you know so far.

anilthummar commented 1 month ago

@hiteshgarg123 i have added the below port then it is working fine with the data transfer

servers.add(_buildIceServer("stun:stun.relay.metered.ca:80", "", ""));

hiteshgarg123 commented 1 month ago

@anilthummar I'm glad that you identified and resolved the issue. I hope you are aware of the location in the code to put the above STUN server URL. I'm still going to put the code sample below for you.

QBIceServer iceServer = QBIceServer();
iceServer.url = "stun:stun.relay.metered.ca:80";
iceServer.userName = "";
iceServer.password = "";

try {
  await QB.rtcConfig.setIceServers([iceServer]);
} on PlatformException catch (e) {
  // Something happened
} 

Regarding the actual issue, we know that our TURN servers are a little old and they sometimes behave oddly. We are planning to update our servers soon which will resolve the issue permanently.

Best regards,

Hitesh Garg Product Manager QuickBlox

anilthummar commented 1 month ago

@hiteshgarg123 Thank you so much for your feedback, I am waiting for your change in SDK and please let us know for same so I can add that bugs fixed issue coded in my app and fixed that one.Thank you for your feedback. I am awaiting the change in the SDK. Please inform me so I can update the bug fixes in my app.

Anil Thummar Android/Flutter Developer

anilthummar commented 1 month ago

@hiteshgarg123 can we know the last issue in QB for data transfer related?

hiteshgarg123 commented 1 month ago

Hello @anilthummar

I did not quite understand the question, could you please elaborate on it and provide some additional details? Also, if it is unrelated to this specific issue, please consider opening a new one.

Best regards,

Hitesh Garg Product Manager QuickBlox

anilthummar commented 1 month ago

@hiteshgarg123 I have reviewed your code sample demo and noticed an issue with data transfer (voice) after a call is connected between Android and iOS, regardless of the internet provider used. I discovered that the problem is related to the STUN server. I have written the following code in the QB class, and it works fine. Can you please fix this issue in your QuickBlox Flutter SDK?

So I want your side for this issue fixed without adding other servers like below. its possible.

List<QBIceServer> servers = []; servers.add(_buildIceServer("stun:stun.relay.metered.ca:80", "", "")); servers.add(_buildIceServer("turn:global.relay.metered.ca:80","sfsdfsdfsdf", "ddgd34534gwsdf")); await QB.rtcConfig.setIceServers(servers);

hiteshgarg123 commented 1 month ago

Hello @anilthummar,

As I communicated earlier, we are aware about the underlying issue and we have already placed the fix on our roadmap. We will be addressing this issue in the coming months.

We will notify you as soon as we deploy this fix, Thank you for your patience!

Best regards,

Hitesh Garg Product Manager QuickBlox

anilthummar commented 1 month ago

@hiteshgarg123 , Thank you so much for your feedback, I am waiting for your update, Thank you so much.