Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
webrtc-client
Advanced tools
A light wrapper around the WebRTC API. For an example server implementation see webrtc-handler.
var webrtc = require('webrtc-client')
getUserMedia({ audio: true, video: true }, function (stream) {
var video = document.querySelector('video')
var url = 'ws://localhost:8000'
var client = webrtc({ url: url, stream: stream })
client.on('stream add', function (remote, id) {
video.src = window.URL.createObjectURL(remote);
})
client.on('stream remove', function (remote, id) {
video.src = null
})
client.connect()
})
var webrtc = require('webrtc-client')
Returns a webrtc-client instance.
Websocket url of the signalling server.
Local stream to be sent to connected peers.
Log messages to the console.
Create a connection to the signalling server using the url given when the client was created.
The client will connect to peers advertised by the server through the peers
event.
The supplied obj
will be sent to the signalling server with a join
message.
This could contain application specific information for the server such as the room to join.
Close connection to the signalling server and any connected peers.
Fires when a new stream is received. cb
takes two arguments:
stream
- The remote stream received.id
- The id of the associated peer.Fires when a stream is removed. cb
takes two arguments:
stream
- The remote stream removed.id
- The id of the associated peer.FAQs
A light wrapper around the WebRTC API.
The npm package webrtc-client receives a total of 2 weekly downloads. As such, webrtc-client popularity was classified as not popular.
We found that webrtc-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.