Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-webrtc

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-webrtc - npm Package Compare versions

Comparing version 2.2.3 to 2.3.0

26

lib/connection.js

@@ -12,4 +12,10 @@ var events = require('events');

// ontrack supported at recent browser versions. [deprecated]onaddstream supported at older browser versions.
if(peerConnection.addTrack) {
peerConnection.ontrack = onAddTrack;
} else {
peerConnection.onaddstream = onAddStream;
}
peerConnection.onicecandidate = onIceCandidate;
peerConnection.onaddstream = onAddStream;
peerConnection.onconnectionstatechange = onConnectionStateChange;

@@ -40,2 +46,9 @@ peerConnection.oniceconnectionstatechange = onIceConnectionStateChange;

function onAddTrack(event) {
if(event.streams) {
remoteStream = event.streams[0];
connection.emit('remote-stream', event.streams[0]);
}
}
function onConnectionStateChange() {

@@ -63,3 +76,12 @@ connection.emit('connection-state-changed', peerConnection.connectionState);

localStream = stream;
peerConnection.addStream(stream);
// ontrack supported at recent browser versions. [deprecated]onaddstream supported at older browser versions.
if(peerConnection.addTrack) {
stream.getTracks().forEach(function(track) {
peerConnection.addTrack(track, stream);
});
} else {
peerConnection.addStream(stream);
}
return stream;

@@ -66,0 +88,0 @@ }

@@ -0,0 +0,0 @@ var webRtcAdapter = require('webrtc-adapter');

@@ -0,0 +0,0 @@ var events = require('events');

@@ -0,0 +0,0 @@ function UserMedia() {

2

package.json
{
"name": "simple-webrtc",
"version": "2.2.3",
"version": "2.3.0",
"description": "A simple WebRTC and MediaRecorder wrapper.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -0,0 +0,0 @@ # simple-webrtc

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc