Socket
Socket
Sign inDemoInstall

electron-webrtc

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-webrtc - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

data

2

package.json
{
"name": "electron-webrtc",
"version": "0.2.9",
"version": "0.2.10",
"description": "Use WebRTC in Node.js via a hidden Electron process",

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

@@ -18,2 +18,4 @@ 'use strict'

this._dataChannels = new Map()
this._offer = null
this._answer = null
this.iceConnectionState = 'new'

@@ -61,7 +63,26 @@ this.iceGatheringState = 'new'

}
send(id, {
type: 'icecandidate',
event: event,
iceGatheringState: pc.iceGatheringState
var offer, answer
function sendEvent () {
send(id, {
type: 'icecandidate',
event: event,
iceGatheringState: pc.iceGatheringState,
offer: offer ? offer.toJSON() : null,
answer: answer ? answer.toJSON() : null
})
}
pc.createOffer(function (o) {
offer = o
if (answer != null) sendEvent()
}, function () {
offer = false
if (answer != null) sendEvent()
})
pc.createAnswer(function (a) {
answer = a
if (offer != null) sendEvent()
}, function () {
answer = false
if (offer != null) sendEvent()
})
}

@@ -140,2 +161,8 @@ pc.oniceconnectionstatechange = function (e) {

this.iceGatheringState = message.iceGatheringState
if (message.offer) {
this._offer = Object.assign(this._offer || {}, message.offer)
}
if (message.answer) {
this._answer = Object.assign(this._answer || {}, message.answer)
}
break

@@ -167,6 +194,10 @@

createOffer (cb, errCb, options) {
if (this._offer) return cb(this._offer)
return this._callRemote(
'createOffer',
`onSuccess, onFailure, ${JSON.stringify(options)}`,
cb, errCb
(offer) => {
this._offer = offer
cb(offer)
}, errCb
)

@@ -176,6 +207,10 @@ }

createAnswer (cb, errCb, options) {
if (this._answer) return cb(this._answer)
return this._callRemote(
'createAnswer',
`onSuccess, onFailure, ${JSON.stringify(options)}`,
cb, errCb
(offer) => {
this._answer = offer
cb(offer)
}, errCb
)

@@ -182,0 +217,0 @@ }

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