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

No Way to know when stream is unpublished #22

Open
NDRugbyGit opened this issue Mar 27, 2024 · 1 comment
Open

No Way to know when stream is unpublished #22

NDRugbyGit opened this issue Mar 27, 2024 · 1 comment
Assignees

Comments

@NDRugbyGit
Copy link

I am looking to get the state of the stream I am subscribed to, such as Active or Inactive. However, there does not seem to be any way to do so. iSubscribing does not change to false when the stream stops broadcasting while McSubscriber is subscribed. OnSubscribing only fires when the stream is published, not when it is unpublished.

The Use Case:
The unity app subscribes to a stream published from OBS WebRTC. The app displays the stream. The stream is stopped from OBS, the app does stuff because the stream ended (remove a game object, display a message, etc).

Here are some steps to illustrate what I am seeing:

  1. Unity App subscribes to a stream that is not yet published. isSubscribing is false, onSubscribing has not fired.
  2. The stream is published from OBS. isSubscribing is now True. onSubscribing fires.
  3. The app can now take action based on the stream being published.
  4. The stream is unpublished from OBS. isSubscribing is still true. onSubscribing does not fire.
  5. I can also republish the stream here and it will go back to step 2.

So given all that, how can we tell in Unity if the Stream is published or not?

@Yousif-CS
Copy link
Collaborator

Hey @NDRugbyGit, thanks for reporting this. I have added OnActive and OnInactive events to the subscriber in the v1.2.0-beta.0 release. You can pull this tag into your project by appending the #v1.2.0-beta.0 to the git url when passing it to your package manager

@Yousif-CS Yousif-CS self-assigned this May 28, 2024
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