Node.js WebRTC client

后端 未结 8 1236
既然无缘
既然无缘 2020-11-30 23:50

I am looking for a webrtc implementation for node.js
to transmit data from a nodeJS client to another webRTC peer.

So in my case the nodejs appl

相关标签:
8条回答
  • 2020-12-01 00:27

    You might want to use this implementation : https://github.com/andyet/SimpleWebRTC

    I have used it for my projects and it was very easy to integrate.

    0 讨论(0)
  • 2020-12-01 00:35

    Update: the solution below doesn't actually supply video to the server. I'm not sure what the best (Node) solution for that is. In C++, try libJingle.

    It sounds like webrtc.io will allow you to create a node application that is a peer. See the github project here: https://github.com/webRTC/webRTC.io.

    There doesn't appear to be super-active development on the project at the moment, but there are 100 forks of it, and the node module is being downloaded 500 times a month right now, so it seems like people care.

    Example code from the project -- client side

    <video id="local" autoplay="autoplay"></video>
    <video id="remote" autoplay="autoplay"></video>
    
    <script src="/webrtc.io.js"></script>
    <script>
    
      // note: make sure hostname available to all connecting clients
      // (ie. probably not `localhost`)
      rtc.connect('ws://yourserveraddress:8001');
    
      rtc.createStream({"video": true, "audio":false}, function(stream){
        // get local stream for manipulation
        rtc.attachStream(stream, 'local');
      });
    
      rtc.on('add remote stream', function(stream){
        // show the remote video
        rtc.attachStream(stream, 'remote');
      });
    
      // more rtc callbacks are available
    </script>
    

    Server side

    var webRTC = require('webrtc.io').listen(8001);
    
    0 讨论(0)
  • 2020-12-01 00:39

    There is one more WebRTC wrapper for node https://github.com/vmolsa/webrtc-native.

    Supports data channel as well as media streams.

    Has support for linux, mac and windows.

    WebRTC codebase is synced frequently.

    Update: There's a light datachannel only implementation, supports linux/mac/windows http://www.meshcommander.com/webrtc

    0 讨论(0)
  • 2020-12-01 00:42

    It is possible to establish a WebRTC data connection from node.js to browser with the serverless-webrtc package which uses the wrtc package as WebRTC implementation.

    Unfortunately, when I try using wrtc module with signalling libraries like PeerJS or EasyRTC, the connection is not establish (the error message is "ICE failed"). If anyone has had any success with using any high-level libraries on top of wrtc, I would be grateful for the information.

    0 讨论(0)
  • 2020-12-01 00:42

    This solution provides video streaming from native to web. i.e. no need for browser to capture video, and it broadcast video to client browser. There is a websocket example that works just fine.

    Your challenge actually is to build and link webrtc.node, and it is all explained in the above link.

    0 讨论(0)
  • 2020-12-01 00:44

    How about simple-peer and rtc-everywhere?

    https://github.com/feross/simple-peer

    https://github.com/contra/rtc-everywhere

    0 讨论(0)
提交回复
热议问题