Open mirusu400 opened 3 years ago
you want to use the toURL method on the stream object so try something like this.state.publishers.stream
@CodeHownd I found the problem
stream
on state.publishers
, but not publisher
.publisher
on state.publisher
, but not stream
.Also, I fount that setOnStreamListener is internally important function using callback, so changing these callbacks are much dangerous.
Anyway, how can I get both stream
and publisher
on these method and save into state.publishers
? is there any way to get them?
so the publishers key in the state object should have a value that is a list of { publisher: publisher, stream: stream, }. objects. We want to append a new entry to the list so we take the stream we get from the onStreamListener and make an object with the publisher of that stream and append it in that listener callback. Hope this helps
@mirusu400 @CodeHownd can u provide the reacthook way, i did
const [publishers, setPublisher] = React.useState()
videoRoom.setOnStreamListener((stream) => {
setPublisher(...publishers,
{
publisher: publisher,
stream: stream,
})
});
But can not see the video, please help
Hello. I'm trying to build these package and examples in my environment, but it doesn't work, it just shows white screen. I've trying to fix it out, I've trace it and in my console log,
this.state.publishers.publisher
always printnull
, so I changed like this:after changing this, the publishers doesn't have null and now they have proper objects, but after this I got another error on render:
How can I fix these? Can you give me a advice?
Also, here is my environment: