Giter Site home page Giter Site logo

lazorfuzz / liowebrtc Goto Github PK

View Code? Open in Web Editor NEW
163.0 163.0 10.0 1012 KB

An event-based WebRTC library that makes it easy to embed real-time peer to peer communication into UI components.

License: MIT License

JavaScript 90.42% HTML 8.46% Shell 0.91% Dockerfile 0.22%
electronjs javascript javascript-library liowebrtc p2p-chat p2p-cloud p2p-everything p2p-network p2p-transfer peer-communication react reactjs webrtc

liowebrtc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

liowebrtc's Issues

Hello!!, I'm using [liowbrtc]. [REDUX] has difficulty applying.

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.๐Ÿ˜ข
)

New user doesn't get mediastreams of peers that joined before him

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.

Signaling server README link

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

Can this library combine with react native?

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?

Peer.Nick Always Undefined

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:

image

If I call `Object.keys()` on Peer, I get

image

As you can see, nick is missing, even though it's there when you log the object in its entirety.

onReceivedPeerData Only Uses Initial State Value, Not Current State

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.