Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native Conference Issue: in android phone, stream from ios is not showing #6466

Closed
Nardeep opened this issue Jul 5, 2024 · 18 comments · Fixed by ant-media/WebRTC-React-Native-SDK#24
Assignees

Comments

@Nardeep
Copy link

Nardeep commented Jul 5, 2024

Short description

In Android phone stream from iOS phone is not showing randomly , if its stuck once in android then it remains same every time join same room

Environment

  • SDK: React native SDK 1.0.8
  • Java version: 11
  • Ant Media Server version: Enterprise Edition 2.9.0 20240405_1758

Steps to reproduce

  1. Start the room from android
  2. Join from iOS
  3. Some time its worked in first time
  4. Leave room from iOS
  5. Join Again then iOS stream is not showing in android phone

Expected behavior

Audio and video in room should work properly from iOS to android and android to iOS.

Actual behavior

Some time it's showing blank or black screen . Sometime only video showing without audio.

Logs

In Ios when newTrackAvailable callback , then we got below in track and its working :
{"stream": {"_reactTag": "AB6449B1-1E7B-4E88-9E67-B48F6DA76405", "_tracks": [[MediaStreamTrack]], "active": true, "id": "ARDAMS"}, "streamId": "6687da309976363d4aad6b99", "track": {"_constraints": {}, "_enabled": true, "_muted": false, "_peerConnectionId": 4, "_readyState": "live", "_settings": {}, "id": "ARDAMSv6606971a42e13a14fe22655b", "kind": "video", "label": "", "remote": true}, "trackId": "ARDAMSv6606971a42e13a14fe22655b"}

in android when newTrackAvailable callback , then we got below in track and its not showing video:
{"stream": {"_reactTag": "5044ccf8-84b8-43d2-8fb0-5b0ff45437bc", "_tracks": [[MediaStreamTrack], [MediaStreamTrack], [MediaStreamTrack], [MediaStreamTrack]], "active": true, "id": "ARDAMS"}, "streamId": "6687dee59976363d4aad7586", "track": {"_constraints": {}, "_enabled": true, "_muted": true, "_peerConnectionId": 10, "_readyState": "live", "_settings": {}, "id": "ARDAMSa65ccc7e0b8f6425a57f7a30e", "kind": "audio", "label": "", "remote": true}, "trackId": undefined}

@yashtandon113 @mustafaboleken Please look into this and help us to resolve this

@burak-58 burak-58 moved this to 📋 Backlog in Ant Media Server Jul 8, 2024
@burak-58 burak-58 moved this from 📋 Backlog to Next Sprint in Ant Media Server Jul 8, 2024
@Nardeep
Copy link
Author

Nardeep commented Jul 9, 2024

hi @burak-58 ,

We are facing this issue in multiple scenarios. For example, when we restart both Android and iOS devices, most of the time, both Android and iOS users join the conference room and are visible. However, when we cancel the first room and then create a second room without closing the app, this issue occurs randomly. Sometimes the Android user is not visible to other users, but the local view is visible, and sometimes the iOS user is not visible. When we check on the Ant Media console, both users are in the conference room.

Here is our handleDisconnect function:
const handleDisconnect = useCallback(() => {
if (adaptor) {
if (adaptor?.localStream?.current) {
adaptor?.localStream?.current
?.getTracks()
?.forEach((track) => track.stop());

}

adaptor.stop(user?._id);
console.log(
  adaptor?.localStream?.current?.id,
  "(adaptor.localStream?.current.id",
  user?._id
);

InCallManager.stop();

adaptor.stop(roomId);

removeRemoteVideo();
setIsPlaying(false);
setIsPublishing(false);

}
}, [adaptor, roomId]);

@mustafaboleken
Copy link
Contributor

Hi @Nardeep

It looks like after you stop tracks, it cannot be re initialize properly. I'm already working on a similar case right now. I will also let you know whenever it's ready to test.

@Nardeep
Copy link
Author

Nardeep commented Jul 10, 2024

@mustafaboleken
We appreciate your efforts in addressing this issue. Could you please prioritize this matter and provide a solution as soon as possible? Our client is escalating the issue, and if it is not resolved promptly, we risk losing them. Your immediate attention to this matter would be greatly appreciated.

@mustafaboleken mustafaboleken moved this from Next Sprint to 🏗 In progress in Ant Media Server Jul 10, 2024
@mustafaboleken mustafaboleken self-assigned this Jul 10, 2024
@Sahilthakur2
Copy link

@mustafaboleken

I'm also encountering the same issue. When creating a second room without closing the app, users sometimes can't see each other in the conference room on both Android and iOS. The Ant Media console shows both users in the room, but the local view is visible while the remote view is not.

Looking forward to a resolution or any guidance on this.

@mustafaboleken
Copy link
Contributor

Hi @Nardeep and @Sahilthakur2

I had a solution for the reuse problem and most likely it will be ready today for test. I will share it ASAP and I will ask for a quick review from you.

@Sahilthakur2
Copy link

Hi @mustafaboleken ,

Thank you for the update. I'm glad to hear that a solution is in progress. I'll be ready to test it as soon as it's available. Please let me know if there are any specific aspects you would like me to focus on during the review.

@Nardeep
Copy link
Author

Nardeep commented Jul 15, 2024

hi @mustafaboleken , Could you please provide an update on its status?

@mustafaboleken
Copy link
Contributor

mustafaboleken commented Jul 15, 2024

Hi @Nardeep and @Sahilthakur2

Because I couldn't finalize it on Friday, I worked on it this morning and you can test it right now. There are a couple of new ways to update the track assignments and request the updated assignment list. Take a look at them, then we can discuss the implementation details.

ant-media/WebRTC-React-Native-SDK#24

@Sahilthakur2
Copy link

Hi @mustafaboleken

Thank you for the update. Could you please provide some guidance on how I can test this on my side? Any specific steps or requirements would be greatly appreciated.

Thanks,

@Sahilthakur2
Copy link

Hi @mustafaboleken
Do we need to patch these changes in our code or are you releasing the new version of the library?

@burak-58 burak-58 moved this from 🏗 In progress to After sprint in Ant Media Server Jul 15, 2024
@mustafaboleken
Copy link
Contributor

Hi @Sahilthakur2

Let me tell you the steps:

  • Clone the SDK and run npm install
  • Open the example folder and run npm install again.
  • Edit Conference.tsx file and change websocket URL with your server credentials.
  • You can install it and test it.

If it works for you and there is no issue, our team will review the code and release a new version.

@Sahilthakur2
Copy link

Hi @mustafaboleken

I am still encountering an issue. I have tested the implementation on four Android devices. It works fine on three of them, but on the fourth device, the stream is not visible to others, and the trackId is returning null.

Could you please provide some guidance on how to resolve this?

@Sahilthakur2
Copy link

Hi @mustafaboleken

We are encountering issues with the new implementation. Sometimes, when we call adapter.publish, we do not receive the publish_started callback. As a result, remote users are not added to list.

This inconsistency is causing significant disruptions in the user experience. Could you please provide some guidance on how to troubleshoot and resolve this issue?

@mustafaboleken
Copy link
Contributor

Hi @Sahilthakur2

Thanks for checking the implementation. Can you please share the logs with me? So, I can take a look what is wrong.

@Sahilthakur2
Copy link

hi @mustafaboleken
When we test on 2-3 devices, it works fine for the first two times. However, after that, on some devices, I can only see my local view while all other remote streams are blank. When I log the remove track, I get the following output:

{
"stream": {
"_reactTag": "78cbc684-7e85-4725-9b88-5fbf34f6638e",
"_tracks": [Array],
"active": true,
"id": "ARDAMS"
},
"streamId": "66964c039c5d9e6efcd28d09",
"track": {
"_constraints": [Object],
"_enabled": true,
"_muted": false,
"_peerConnectionId": 1,
"_readyState": "live",
"_settings": [Object],
"id": "ARDAMSv65ccc7e0b8f6425a57f7a30e",
"kind": "video",
"label": "",
"remote": true
},
"trackId": undefined
}
As seen in the log, the trackId is undefined, which might be contributing to the issue.

Could you please provide guidance on why this might be happening and any potential solutions?

Thank you!

@burak-58 burak-58 moved this from After sprint to 🏗 In progress in Ant Media Server Jul 23, 2024
@mustafaboleken
Copy link
Contributor

Hi @Sahilthakur2

Thanks for the review. I will take a look this issue.

@mustafaboleken
Copy link
Contributor

Hi @Sahilthakur2

I couldn't reproduce it, unfortunately. Can you please tell me the device model and software version?

@burak-58 burak-58 moved this from 🏗 In progress to After sprint in Ant Media Server Aug 5, 2024
@mekya mekya moved this from After sprint to 🏗 In progress in Ant Media Server Aug 12, 2024
@mekya
Copy link
Contributor

mekya commented Aug 12, 2024

We don't get update from the user to confirm the things fully.

On the other hand, development has already resolved some tissue.
@burak-58 please review and merge the PR.

@mekya mekya moved this from 🏗 In progress to After sprint in Ant Media Server Aug 12, 2024
@github-project-automation github-project-automation bot moved this from After sprint to ✅ Done in Ant Media Server Nov 27, 2024
@mustafaboleken mustafaboleken moved this from ✅ Done to After sprint in Ant Media Server Nov 27, 2024
@burak-58 burak-58 moved this from After sprint to ✅ Done in Ant Media Server Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants