ConnectyCube / connectycube-flutter-sdk-releases

ConnectyCube Flutter SDK Releases
7 stars 1 forks source link

Deprecated method is needed for AudioCalls #90

Closed pedrostick3 closed 1 year ago

pedrostick3 commented 1 year ago

Platform (use [x]) [x] Android [] iOS [] macOS [] Windows [] Web

Device info Manufacture: Google Model: Pixel 4 OS version: Android API 30

Describe the bug: After updating to the latest library version connectycube_sdk: ^2.5.0 noticed that you had deprecate method callSession.onPublishersReceived but in my point of view, is still needed for AudioCalls ( CallType.AUDIO_CALL ) since your new method callSession.onRemoteStreamTrackReceived does not trigger on AudioCalls.

Steps to Reproduce:

  1. Create a call session ConferenceClient.instance.createCallSession(userId, callType: CallType.AUDIO_CALL) .
  2. With Mobile1, Enter in AudioCall using method callSession.joinDialog().
  3. With Mobile2, Enter in the same AudioCall using method callSession.joinDialog().
  4. On Mobile1, method callSession.onRemoteStreamTrackReceived does not trigger. (but you can see that your deprecated method callSession.onPublishersReceived triggers properly).

Logs:

N/A

Actual result: Everytime someone joins a audio call, method callSession.onRemoteStreamTrackReceived does not trigger.

Expected behavior: Everytime someone joins a audio call, method callSession.onRemoteStreamTrackReceived trigger properly.

Additional info My temporary solution for AudioCalls is to continue to use these 2 methods:

callSession?.onPublishersReceived = _onPublishersReceived; // <-- This callSession method is deprecated
callSession?.onSubscribedOnPublisher = _onSubscribedOnPublisher;

Please fix/undeprecate and contact me when you got news :)

TatankaConCube commented 1 year ago

onPublishersReceived is marked as deprecated to pay attention to developers that it shouldn't be used for subscription on publishers and can be used for other app's needs, please read the deprecation message.

pedrostick3 commented 1 year ago

Yes but as you say in the deprecation message:

'onPublishersReceived' is deprecated and shouldn't be used. The subscription on publisher now doing automatically by the SDK. Don't use it for subscription on publisher instead use for managing the publishers in your app.
Try replacing the use of the deprecated member with the replacement.

The subscription on publisher now doing automatically by the SDK.

And is not doing that automatically for AudioCalls.

TatankaConCube commented 1 year ago

not doing that automatically for AudioCalls.

will check it on my side

TatankaConCube commented 1 year ago

version 2.5.1 was published, please try it and close the ticket if your issue was resolved

pedrostick3 commented 1 year ago

In new version 2.5.1 it still don't trigger your new method callSession.onRemoteStreamTrackReceived and now does not work with the deprecated method too as I wrote on the "Additional info" part of this issue.

I don't know if you understood. Just to clarify, now nothing works. Not even my "solution" that I wrote in the "Additional info" part of this issue.

TatankaConCube commented 1 year ago

you are a little bit confused, the callback onRemoteStreamTrackReceived is designed for rendering video (and audio for Web) tracks on UI. If you need to update UI when someone subscribes to your user or your user subscribes to someone you should use callbacks onSubscribedOnPublisher and onSubscriberAttached and use the callback onPublisherLeft for removing the subscribed user from UI.

could you please describe what functionality you expect from the onRemoteStreamTrackReceived callback for audio calls?

now nothing works

what it means, could you please describe it in more detail?

pedrostick3 commented 1 year ago

Okay so this is worst that i figure it out... I've tested both in version 2.5.0 and 2.5.1 and now, not even the VideoCall works.

What I've tested for VideoCall and AudioCall:

  1. With Mobile1, I enter a VideoCall (or AudioCall).
  2. With Mobile2, I enter in the Mobile1 VideoCall (or AudioCall).
  3. Mobile1 and Mobile2 are alone in VideoCall (or AudioCall).

The weird thing is that i rolled back from 2.5.1 to 2.5.0 (using flutter clean and flutter pub cache clean) and now the problem continues in both versions 2.5.0 and 2.5.1.

TatankaConCube commented 1 year ago

Can you reproduce it in our Conference calls sample? If so, please collect and provide full logs from both devices without any cutting and filtering.

pedrostick3 commented 1 year ago

Using the sample code project that you referenced, everything does the same that is:

User1 - Logs: User1.txt

User2 - Logs: User2.txt

TatankaConCube commented 1 year ago

when did you start to reproduce this problem? was this feature work before and when stopped?

pedrostick3 commented 1 year ago

In package version connectycube_sdk: ^2.5.0 everything was functional and when you released the connectycube_sdk: ^2.5.1 that issue appeared.

But when i roll back the version to connectycube_sdk: 2.5.0, everything continues broken. It seems that is not related with Flutter... instead it seems to be related with backend or something like that (of course this is just my point of view).

TatankaConCube commented 1 year ago

could you try to reproduce the issue now?

pedrostick3 commented 1 year ago

I've tested with your Conference calls sample and with my APP and now joining a call is possible. That's great!!

But now we're back to square one, where joining an AudioCall does not trigger onRemoteStreamTrackReceived callback. Since the onPublishersReceived callback is deprecated, it will be removed in the future afterwards but without that callback I cannot join users in UI (for Mobile AudioCalls).

My point of view is, since onPublishersReceived callback is deprecated and onRemoteStreamTrackReceived callback joins users automatically in VideoCall UI (and AudioCall for Web), why onRemoteStreamTrackReceived callback doesn't do that automatically for AudioCall for the remaining platforms (Android, iOS, Linux, MacOS, Windows) too?

pedrostick3 commented 1 year ago

I've tested now with onPublishersReceived deprecated callback commented and, leaving the onSubscribedOnPublisher uncommented, it worked. So now it works without the onPublishersReceived deprecated callback.

I think that was what you were trying to explain maybe, and if was so, I'm trully sorry for the miss understanding.

May I close this Issue then?

TatankaConCube commented 1 year ago

The callback onPublishersReceived won't be deleted in the future, as I said before we marked it as deprecated only to pay attention of developers that it shouldn't be used for the subscription to publishers and you still can use it according to your needs except the subscription to publishers.

The callback onRemoteStreamTrackReceived was created for rendering the video tracks on UI only. Since the Web platform requires rendering audio to the separated audioElement we are calling it for the audio track for the Web too. Other platforms don't require rendering audio stream cause it is managed inside the flutter_webrtc plugin.

TatankaConCube commented 1 year ago

May I close this Issue then?

close it if your issue was resolved