0
votes

I want to create an android application that broadcasts stream to multiple users. Im using publisher token for both broadcaster and subscribers as i want to see the stream from all the subscribers that have subscribed to the main stream. Since all the subscribers are also publishing the stream simultaneously.The error that i faced is that, when a new subscriber joins the session, the new subscriber subscribes to another subscriber(user)'s steam rather than the main stream i want them to. Can you tell me , how do i make sure that everyone in the session subscribes to a particular stream from a particular person?

1
Welcome to Stack Overflow! Please edit your question to show the code you have so far. You should include at least an outline (but preferably a minimal reproducible example) of the code that you are having problems with, then we can try to help with the specific problem. You should also read How to Ask.Toby Speight

1 Answers

0
votes

If I understand, you want to create one publisher and multiple subscribers. For all the connections that are just receiving the stream, you just have to connect to the session, and subscribe when you receive the onStreamCreated event. You can create a different token for each publisher or subscriber, no need to reuse. If you want to change the person that is broadcasting, unpublish from the first one, and start publishing from a different one. That will cause onStreamCreated events to be sent, and all subscribers will start receiving the new stream. I hope this helps.