@leofcoin/peernet 0.11.18 → 0.11.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -322,7 +322,7 @@ class Peer {
322
322
  * @params {Object} options
323
323
  * @params {string} options.channelName - this peerid : otherpeer id
324
324
  */
325
- constructor(options = {}) {
325
+ constructor(options = {}) {
326
326
  this._in = this._in.bind(this);
327
327
  this.offerOptions = options.offerOptions;
328
328
  this.initiator = options.initiator;
@@ -403,6 +403,7 @@ constructor(options = {}) {
403
403
  }];
404
404
 
405
405
  this.#connection = new wrtc.RTCPeerConnection();
406
+
406
407
  this.#connection.onicecandidate = ({ candidate }) => {
407
408
  if (candidate) {
408
409
  this.address = candidate.address;
@@ -449,6 +450,13 @@ constructor(options = {}) {
449
450
  await this.#connection.setLocalDescription(offer);
450
451
 
451
452
  this._sendMessage({'sdp': this.#connection.localDescription});
453
+
454
+ this.#connection.onnegotiationneeded = async () => {
455
+ const offer = await this.#connection.createOffer();
456
+ await this.#connection.setLocalDescription(offer);
457
+
458
+ this._sendMessage({'sdp': this.#connection.localDescription});
459
+ };
452
460
  }
453
461
  // }
454
462
 
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
  var PubSub__default = /*#__PURE__*/_interopDefaultLegacy(PubSub);
11
11
  var Koa__default = /*#__PURE__*/_interopDefaultLegacy(Koa);
12
12
 
13
- var version = "0.11.17";
13
+ var version = "0.11.18";
14
14
 
15
15
  var api$1 = {
16
16
  version: ({send}) => send({client: '@peernet/api/http', version}),
@@ -320,7 +320,7 @@ class Peer {
320
320
  * @params {Object} options
321
321
  * @params {string} options.channelName - this peerid : otherpeer id
322
322
  */
323
- constructor(options = {}) {
323
+ constructor(options = {}) {
324
324
  this._in = this._in.bind(this);
325
325
  this.offerOptions = options.offerOptions;
326
326
  this.initiator = options.initiator;
@@ -401,6 +401,7 @@ constructor(options = {}) {
401
401
  }];
402
402
 
403
403
  this.#connection = new wrtc.RTCPeerConnection();
404
+
404
405
  this.#connection.onicecandidate = ({ candidate }) => {
405
406
  if (candidate) {
406
407
  this.address = candidate.address;
@@ -447,6 +448,13 @@ constructor(options = {}) {
447
448
  await this.#connection.setLocalDescription(offer);
448
449
 
449
450
  this._sendMessage({'sdp': this.#connection.localDescription});
451
+
452
+ this.#connection.onnegotiationneeded = async () => {
453
+ const offer = await this.#connection.createOffer();
454
+ await this.#connection.setLocalDescription(offer);
455
+
456
+ this._sendMessage({'sdp': this.#connection.localDescription});
457
+ };
450
458
  }
451
459
  // }
452
460
 
@@ -1795,7 +1803,7 @@ class Peernet {
1795
1803
  protocol: 'peernet-v0.1.0', host: '127.0.0.1', port: options.port
1796
1804
  });
1797
1805
  } else {
1798
- const http = await Promise.resolve().then(function () { return require('./http-6c848a1e.js'); });
1806
+ const http = await Promise.resolve().then(function () { return require('./http-7f0fcdaf.js'); });
1799
1807
  if (environment !== 'browser') http.default(options);
1800
1808
  }
1801
1809
 
@@ -276,7 +276,7 @@ class Peer {
276
276
  * @params {Object} options
277
277
  * @params {string} options.channelName - this peerid : otherpeer id
278
278
  */
279
- constructor(options = {}) {
279
+ constructor(options = {}) {
280
280
  this._in = this._in.bind(this);
281
281
  this.offerOptions = options.offerOptions;
282
282
  this.initiator = options.initiator;
@@ -357,6 +357,7 @@ constructor(options = {}) {
357
357
  }];
358
358
 
359
359
  this.#connection = new wrtc.RTCPeerConnection();
360
+
360
361
  this.#connection.onicecandidate = ({ candidate }) => {
361
362
  if (candidate) {
362
363
  this.address = candidate.address;
@@ -403,6 +404,13 @@ constructor(options = {}) {
403
404
  await this.#connection.setLocalDescription(offer);
404
405
 
405
406
  this._sendMessage({'sdp': this.#connection.localDescription});
407
+
408
+ this.#connection.onnegotiationneeded = async () => {
409
+ const offer = await this.#connection.createOffer();
410
+ await this.#connection.setLocalDescription(offer);
411
+
412
+ this._sendMessage({'sdp': this.#connection.localDescription});
413
+ };
406
414
  }
407
415
  // }
408
416
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "0.11.18",
3
+ "version": "0.11.19",
4
4
  "description": "",
5
5
  "main": "dist/commonjs/peernet.js",
6
6
  "module": "dist/module/peernet.js",