lazorfuzz / liowebrtc Goto Github PK
View Code? Open in Web Editor NEWAn event-based WebRTC library that makes it easy to embed real-time peer to peer communication into UI components.
License: MIT License
An event-based WebRTC library that makes it easy to embed real-time peer to peer communication into UI components.
License: MIT License
Hello!!, I'm using [liowbrtc]. [REDUX] has difficulty applying.
The problem with that is that it will be in the attachStream event. [RemoteVideosEl] part.
this redux app container code (mapDispatchToProps)
rtc.on('videoAdded', (stream, peer) => {
dispatch({
type : ADD_MEDIA ,
peer,
stream : rtc.attachStream(stream, rtc.config.remoteVideosEl[peer.id])
});
})
this react videoDetail component code.. remoteVideosEl not working..
componentDidMount() {
this.webrtc = this.props.webrtc;
this.webrtc.config.localVideoEl = this.localVid;
this.webrtc.config.remoteVideosEl = this.remoteVideos;
this.webrtc.startLocalVideo();
}
What's wrong with my code?
(
When I asked the question, I turned the translator around and asked the question. I'm sorry the sentence isn't smooth. I turned the translator.๐ข
)
I tested with your video-chat demo and signalbuddy.
this.webrtc.getPeers() and this.webrtc.getClients() return empty for new user
the peers are there in this.webrtc.webrtc.peers but without corresponding streams
if I call this.webrtc.startLocalVideo() on each peer when new peer joins, it gets the videos but his own stream stops for the peers.
If I call props.webrtc.shout('chat', chatMsg); from UseEffect, it will log that I sent the message fine but the message is never received.
react-liowebrtc
maybe this should use 'this.config or config'?
https://github.com/lazorfuzz/liowebrtc/blob/master/src/liowebrtc.js#L110
if the above is okay
config overrides with ?
https://github.com/lazorfuzz/liowebrtc/blob/master/src/webrtc.js#L20
In the README file you state that the user should provide their own signaling server in order not to use the default lio.app signaling server.
This is understandable, but a typical user (e.g. a react-liowebrtc user) may not know how to best do that. Please can you consider providing a link to an existing HOW-TO on the web or similar, or a link to an npm package that can provide server-side signaling functionality?
Thanks,
Sebastian
I'm a newbie with react native and web developt, I want to create a chat app and google led me here. I have no idea (before I read it) about webrtc and this library. I just want to know if I follow the tutorial, can I apply it to a react native app? If not, is there any idea for my app?
The peer.nick
value always returns undefined, even though it's present in the Peer object. For instance, I pass a nickname to the Liowebrtc component as shown below:
<LioWebRTC
options={{ debug: true,
dataOnly: true,
nick: "Pippin" }}
onReady={join}
onCreatedPeer={handleCreatedPeer}
onReceivedPeerData={handlePeerData} >
If I print the peer
object to console in handleCreatedPeer
, I can see peer has a nick with value "Pippin." However, trying to call peer.nick
or peer["nick"]
always produces undefined.
For instance,
console.log("Peer id: ", peer.id); // valid value
console.log("Peer nick: ", peer.nick); // undefined
console.log("Peer one: ", peer.oneway); // valid value
even though:
If I call `Object.keys()` on Peer, I get
As you can see, nick
is missing, even though it's there when you log the object in its entirety.
Somehow, the function passed to onReceivedPeerData
only ever uses the initial value for a state variable, never its current state. Here's a bare minimum example: https://stackoverflow.com/questions/71447566/react-state-variables-not-updating-in-function
Note: I added an extra button that calls the same function inside the LioWebRTC wrapper, and the current state does print for that, so it seems like it's something to do with LioWebRTC itself. How is that even possible for it not to use the current state?
https://github.com/lazorfuzz/liowebrtc/blob/master/src/webrtc.js#L15
somewhere in universe they block google
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.