@auxilium/datalynk-client 1.1.7 → 1.1.8

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.
package/dist/index.js CHANGED
@@ -3245,20 +3245,23 @@ class Superuser {
3245
3245
  } });
3246
3246
  }
3247
3247
  }
3248
- const version = "1.1.7";
3248
+ const version = "1.1.8";
3249
3249
  class WebRtc {
3250
3250
  constructor(api) {
3251
3251
  __publicField(this, "ice");
3252
- var _a, _b, _c;
3252
+ var _a, _b, _c, _d;
3253
3253
  this.api = api;
3254
- this.ice = clean({
3255
- urls: [(_a = this.api.options.webrtc) == null ? void 0 : _a.url],
3256
- username: (_b = this.api.options.webrtc) == null ? void 0 : _b.username,
3257
- credential: (_c = this.api.options.webrtc) == null ? void 0 : _c.password
3258
- });
3254
+ this.ice = [
3255
+ { urls: ["stun:" + ((_a = this.api.options.webrtc) == null ? void 0 : _a.url)] },
3256
+ clean({
3257
+ urls: ["turn:" + ((_b = this.api.options.webrtc) == null ? void 0 : _b.url)],
3258
+ username: (_c = this.api.options.webrtc) == null ? void 0 : _c.username,
3259
+ credential: (_d = this.api.options.webrtc) == null ? void 0 : _d.password
3260
+ })
3261
+ ];
3259
3262
  }
3260
3263
  async answer(offer, stream) {
3261
- const rtc = new RTCPeerConnection({ iceServers: [this.ice] });
3264
+ const rtc = new RTCPeerConnection({ iceServers: this.ice });
3262
3265
  stream.getTracks().forEach((track) => rtc.addTrack(track, stream));
3263
3266
  await rtc.setRemoteDescription(new RTCSessionDescription(offer));
3264
3267
  const answer = await rtc.createAnswer();
@@ -3272,7 +3275,7 @@ class WebRtc {
3272
3275
  return rtc;
3273
3276
  }
3274
3277
  async offer(stream) {
3275
- const rtc = new RTCPeerConnection({ iceServers: [this.ice] });
3278
+ const rtc = new RTCPeerConnection({ iceServers: this.ice });
3276
3279
  stream.getTracks().forEach((track) => rtc.addTrack(track, stream));
3277
3280
  await rtc.setLocalDescription(await rtc.createOffer());
3278
3281
  await new Promise((res) => {
@@ -3286,7 +3289,6 @@ class WebRtc {
3286
3289
  /**
3287
3290
  * Create a new WebRTC connection to a room
3288
3291
  * @param {string} id Room ID
3289
- * @param {(peer) => any} onConnect Callback when peers connect
3290
3292
  * @param {boolean} audio Stream local audio to room/peers
3291
3293
  * @param {boolean} video Stream local video to room/peers
3292
3294
  * @returns {Promise<WebRTCSession>} Connection session
@@ -3420,7 +3422,7 @@ const _Api = class _Api {
3420
3422
  saveSession: true,
3421
3423
  serviceWorker: "/service.worker.mjs",
3422
3424
  webrtc: {
3423
- url: "turn:scarborough.auxilium.world:3478",
3425
+ url: "scarborough.auxilium.world:3478",
3424
3426
  username: "auxilium-webrtc",
3425
3427
  password: "UU3qkD95Tg54eF"
3426
3428
  },
package/dist/index.mjs CHANGED
@@ -3243,20 +3243,23 @@ class Superuser {
3243
3243
  } });
3244
3244
  }
3245
3245
  }
3246
- const version = "1.1.7";
3246
+ const version = "1.1.8";
3247
3247
  class WebRtc {
3248
3248
  constructor(api) {
3249
3249
  __publicField(this, "ice");
3250
- var _a, _b, _c;
3250
+ var _a, _b, _c, _d;
3251
3251
  this.api = api;
3252
- this.ice = clean({
3253
- urls: [(_a = this.api.options.webrtc) == null ? void 0 : _a.url],
3254
- username: (_b = this.api.options.webrtc) == null ? void 0 : _b.username,
3255
- credential: (_c = this.api.options.webrtc) == null ? void 0 : _c.password
3256
- });
3252
+ this.ice = [
3253
+ { urls: ["stun:" + ((_a = this.api.options.webrtc) == null ? void 0 : _a.url)] },
3254
+ clean({
3255
+ urls: ["turn:" + ((_b = this.api.options.webrtc) == null ? void 0 : _b.url)],
3256
+ username: (_c = this.api.options.webrtc) == null ? void 0 : _c.username,
3257
+ credential: (_d = this.api.options.webrtc) == null ? void 0 : _d.password
3258
+ })
3259
+ ];
3257
3260
  }
3258
3261
  async answer(offer, stream) {
3259
- const rtc = new RTCPeerConnection({ iceServers: [this.ice] });
3262
+ const rtc = new RTCPeerConnection({ iceServers: this.ice });
3260
3263
  stream.getTracks().forEach((track) => rtc.addTrack(track, stream));
3261
3264
  await rtc.setRemoteDescription(new RTCSessionDescription(offer));
3262
3265
  const answer = await rtc.createAnswer();
@@ -3270,7 +3273,7 @@ class WebRtc {
3270
3273
  return rtc;
3271
3274
  }
3272
3275
  async offer(stream) {
3273
- const rtc = new RTCPeerConnection({ iceServers: [this.ice] });
3276
+ const rtc = new RTCPeerConnection({ iceServers: this.ice });
3274
3277
  stream.getTracks().forEach((track) => rtc.addTrack(track, stream));
3275
3278
  await rtc.setLocalDescription(await rtc.createOffer());
3276
3279
  await new Promise((res) => {
@@ -3284,7 +3287,6 @@ class WebRtc {
3284
3287
  /**
3285
3288
  * Create a new WebRTC connection to a room
3286
3289
  * @param {string} id Room ID
3287
- * @param {(peer) => any} onConnect Callback when peers connect
3288
3290
  * @param {boolean} audio Stream local audio to room/peers
3289
3291
  * @param {boolean} video Stream local video to room/peers
3290
3292
  * @returns {Promise<WebRTCSession>} Connection session
@@ -3418,7 +3420,7 @@ const _Api = class _Api {
3418
3420
  saveSession: true,
3419
3421
  serviceWorker: "/service.worker.mjs",
3420
3422
  webrtc: {
3421
- url: "turn:scarborough.auxilium.world:3478",
3423
+ url: "scarborough.auxilium.world:3478",
3422
3424
  username: "auxilium-webrtc",
3423
3425
  password: "UU3qkD95Tg54eF"
3424
3426
  },
package/dist/webrtc.d.ts CHANGED
@@ -34,14 +34,13 @@ export declare class WebRtc {
34
34
  urls: string[];
35
35
  username?: string;
36
36
  credential?: string;
37
- };
37
+ }[];
38
38
  constructor(api: Api);
39
39
  private answer;
40
40
  private offer;
41
41
  /**
42
42
  * Create a new WebRTC connection to a room
43
43
  * @param {string} id Room ID
44
- * @param {(peer) => any} onConnect Callback when peers connect
45
44
  * @param {boolean} audio Stream local audio to room/peers
46
45
  * @param {boolean} video Stream local video to room/peers
47
46
  * @returns {Promise<WebRTCSession>} Connection session
@@ -1 +1 @@
1
- {"version":3,"file":"webrtc.d.ts","sourceRoot":"","sources":["../src/webr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",
4
4
  "repository": "https://gitlab.auxiliumgroup.com/auxilium/datalynk/datalynk-client",
5
- "version": "1.1.7",
5
+ "version": "1.1.8",
6
6
  "author": "Zak Timson <zaktimson@gmail.com>",
7
7
  "private": false,
8
8
  "main": "./dist/index.cjs",