-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add a React example to the subscriber - how to use event listener with subscriber #38
Comments
Hi @orgar
Are you referring to < video-subscriber >? What events do you want to listen to? Hmmmm... no one has asked for this before. Just wanted to know when it was subscribed or unsubscribed. Could probably make it to where you can pass in an array with the events you'd like to listen to. How does that sound?
What kind of events are you trying to listen to? < video-subscribers > is intended just to be the place where all the session subscribers show up and leave. There aren't any events to listen for. You could listen for "streamCreated" and "streamDestroyed" on the session to know if a subscriber was added or removed.
Can you tell us what happened? Make sure that you are listening for a "streamCreated" event.
Not sure what you mean by activate. Also are you referring to < video-subscribers > or < video-subscriber >? |
I need to subscribe and show the video:
|
Why couldn't you use < video-publisher > ? That's the closest thing to OTPublisher. Right now, you can listen for
Do you mean the Publisher events?
Are you placing the < video-subscriber > without having a stream for it?
Can you be more specific in what you mean by "partially works" and "fails"?
If you are using < video-subscriber >, it's because you want more control over where your subscriber elements show up and behave, so you are then responsible for adding and removing them from the DOM.
Currently, for < video-subscriber >, you can listen for
Do you mean, how do you listen for Web Component events in React? Web Component events work the same regardless of framework/library. You get a reference to the Web Component and then you attach an event listener. Each framework/library may have its own implementations and can sometimes change, so we leave that up to the developer. Currently, in React, you can do something like:
I don't understand what this means? Can you use < video-subscriber > in React? Yes. Does it suit your specific use case? I don't know. So far, you've just asked about listening for specific events which we can add with the
< video-subscribers > is meant to be the easier way of having all subscribers show up in a place without worrying about listening for Let me know what you think. |
Hi,
I want to add to my subscriber event listeners.
How can I activate the subscriber with react
The text was updated successfully, but these errors were encountered: