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

Is there a way for user data transmission? #25

Open
zeroone-ved opened this issue Nov 2, 2023 · 2 comments
Open

Is there a way for user data transmission? #25

zeroone-ved opened this issue Nov 2, 2023 · 2 comments

Comments

@zeroone-ved
Copy link

I want to transfer some basic user data(eg. alias, description) after entering the room, is there a way to do that, or what should I do?
Data might be changed during the room lifecycle(user also might enter or leave the room), everyone should be notified with the newest data.

@adrenak
Copy link
Owner

adrenak commented Nov 2, 2023

Hi @zeroone-ved there's no API for this currently, but this would be a great enhancement. Currently UniVoice only has APIs related to audio and chat members:

public event Action OnCreatedChatroom;
public event Action<Exception> OnChatroomCreationFailed;
public event Action OnClosedChatroom;

public event Action<short> OnJoinedChatroom;
public event Action<Exception> OnChatroomJoinFailed;
public event Action OnLeftChatroom; 

public event Action<short> OnPeerJoinedChatroom;
public event Action<short> OnPeerLeftChatroom;

public event Action<short, ChatroomAudioSegment> OnAudioReceived;
public event Action<short, ChatroomAudioSegment> OnAudioSent;

Data like what you've described will currently have to be transmitted via the underlying network you're using.

@zeroone-ved
Copy link
Author

Hi @adrenak I've just posted a commit to make synchronization between peers available. I also extend the interface of IChatroomNetwork, which might cause errors in the 3rd implementation, so that I leave it in my local.

Maybe I'll create another pull request after all is ready, or someone could just do it simply like this:

public interface IChatroomNetwork : IDisposable {
    event Action<short, string> OnCommonDataReceived;
    event Action<short, string> OnCommonDataSent;

    void SendCommonData(short peerID, string data);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants