@sawport/peers-caller 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -113,6 +113,13 @@ export declare class CallSocket {
113
113
  * Check call status
114
114
  */
115
115
  checkCallStatus(roomId: string): Promise<any>;
116
+ /**
117
+ * Get ICE servers from backend
118
+ */
119
+ getIceServers(roomId: string): Promise<{
120
+ iceServers?: RTCIceServer[];
121
+ error?: string;
122
+ }>;
116
123
  /**
117
124
  * Handle disconnection scenarios
118
125
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CallSocket.d.ts","sourceRoot":"","sources":["../../src/core/CallSocket.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEzE,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,oBAAoB,CAAK;gBAG/B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,UAAU,SAAqB;IAOjC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwD9B;;OAEG;IACH,UAAU,IAAI,IAAI;IASlB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,eAAe,EAClC,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACtC,IAAI;IAaP;;OAEG;IACG,gBAAgB,CAAC,CAAC,SAAS,MAAM,eAAe,EACpD,KAAK,EAAE,CAAC,EACR,IAA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MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAOF;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAQxD;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAInD;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAC3C,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;QAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAIF;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAsB3B;;OAEG;IACH,iBAAiB;;;;;;CAQlB"}
@@ -148,6 +148,10 @@ export declare class PeersCaller extends BaseStore<CallStore> {
148
148
  * Handle errors with proper categorization
149
149
  */
150
150
  private handleError;
151
+ /**
152
+ * Fetch ICE servers from the backend
153
+ */
154
+ private fetchIceServers;
151
155
  /**
152
156
  * Forward WebRTC signaling data to the server
153
157
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PeersCaller.d.ts","sourceRoot":"","sources":["../../src/core/PeersCaller.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EAGpB,eAAe,EACf,aAAa,EACb,kBAAkB,EAGnB,MAAM,UAAU,CAAC;AAElB,qBAAa,WAAY,SAAQ,SAAS,CAAC,SAAS,CAAC;IACnD,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,gBAAgB,CAAgC;IACxD,OAAO,CAAC,Y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AG;IA6BnB;;OAEG;IACH,OAAO,IAAI,IAAI;IAyBf;;OAEG;YACW,0BAA0B;IAyBxC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgI5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAmB9B;;OAEG;YACW,uBAAuB;IA6ErC;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAiCpD;;OAEG;YACW,WAAW;IAgCzB;;OAEG;YACW,YAAY;IAgC1B;;OAEG;YACW,eAAe;IAmC7B;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAQpC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAa7B;;OAEG;YACW,eAAe;IAgC7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAM5B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAU/B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;YACW,eAAe;IAiC7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAqC9B"}
@@ -35,7 +35,7 @@ typeof wt == "undefined" ? globalThis.process = {
35
35
  setTimeout(() => n(...e), 0);
36
36
  });
37
37
  typeof globalThis == "undefined" && (globalThis.global = globalThis);
38
- var Oo = Object.defineProperty, ko = (n, e, t) => e in n ? Oo(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Be = (n, e, t) => ko(n, typeof e != "symbol" ? e + "" : e, t), Ie = (n, e, t) => new Promise((o, l) => {
38
+ var Oo = Object.defineProperty, ko = (n, e, t) => e in n ? Oo(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Be = (n, e, t) => ko(n, typeof e != "symbol" ? e + "" : e, t), Ae = (n, e, t) => new Promise((o, l) => {
39
39
  var c = (f) => {
40
40
  try {
41
41
  a(t.next(f));
@@ -59,7 +59,7 @@ class Bo {
59
59
  * Connect to the WebSocket server
60
60
  */
61
61
  connect() {
62
- return Ie(this, null, function* () {
62
+ return Ae(this, null, function* () {
63
63
  return this.socket && this.socket.connected ? Promise.resolve() : (this.socket && (this.socket.removeAllListeners(), this.socket.disconnect(), this.socket = null), new Promise((e, t) => {
64
64
  try {
65
65
  this.socket = Ao(this.serverUrl, {
@@ -116,7 +116,7 @@ class Bo {
116
116
  * Emit a signaling event and wait for response
117
117
  */
118
118
  emitWithResponse(e, t, o = 1e4) {
119
- return Ie(this, null, function* () {
119
+ return Ae(this, null, function* () {
120
120
  if (!this.isConnected())
121
121
  throw new Error("Socket not connected");
122
122
  return console.log(`[CallSocket] Emitting ${e} with response:`, t), new Promise((l, c) => {
@@ -148,7 +148,7 @@ class Bo {
148
148
  * Start a new call
149
149
  */
150
150
  startCall(e) {
151
- return Ie(this, null, function* () {
151
+ return Ae(this, null, function* () {
152
152
  return this.emitWithResponse("call.start", { roomId: e });
153
153
  });
154
154
  }
@@ -156,7 +156,7 @@ class Bo {
156
156
  * Join a call room for signaling
157
157
  */
158
158
  joinRoom(e) {
159
- return Ie(this, null, function* () {
159
+ return Ae(this, null, function* () {
160
160
  return this.emitWithResponse("call.join", { roomId: e });
161
161
  });
162
162
  }
@@ -164,7 +164,7 @@ class Bo {
164
164
  * Leave a call
165
165
  */
166
166
  leaveCall(e) {
167
- return Ie(this, null, function* () {
167
+ return Ae(this, null, function* () {
168
168
  return this.emitWithResponse("call.leave", { roomId: e });
169
169
  });
170
170
  }
@@ -202,7 +202,7 @@ class Bo {
202
202
  * End call for all participants
203
203
  */
204
204
  endCallForAll(e) {
205
- return Ie(this, null, function* () {
205
+ return Ae(this, null, function* () {
206
206
  this.emit("call.end", { roomId: e });
207
207
  });
208
208
  }
@@ -210,7 +210,7 @@ class Bo {
210
210
  * Start recording
211
211
  */
212
212
  startRecording(e, t) {
213
- return Ie(this, null, function* () {
213
+ return Ae(this, null, function* () {
214
214
  return this.emitWithResponse("call.recording.start", {
215
215
  roomId: e,
216
216
  recordingId: t
@@ -227,7 +227,7 @@ class Bo {
227
227
  * End recording
228
228
  */
229
229
  endRecording(e, t) {
230
- return Ie(this, null, function* () {
230
+ return Ae(this, null, function* () {
231
231
  return this.emitWithResponse("call.recording.end", {
232
232
  roomId: e,
233
233
  recordingId: t
@@ -248,10 +248,18 @@ class Bo {
248
248
  * Check call status
249
249
  */
250
250
  checkCallStatus(e) {
251
- return Ie(this, null, function* () {
251
+ return Ae(this, null, function* () {
252
252
  return this.emitWithResponse("call.status", { roomId: e });
253
253
  });
254
254
  }
255
+ /**
256
+ * Get ICE servers from backend
257
+ */
258
+ getIceServers(e) {
259
+ return Ae(this, null, function* () {
260
+ return this.emitWithResponse("call.ice-servers", { roomId: e });
261
+ });
262
+ }
255
263
  /**
256
264
  * Handle disconnection scenarios
257
265
  */
@@ -950,7 +958,7 @@ function Ye() {
950
958
  if (typeof s == "string")
951
959
  return me(s, r);
952
960
  if (M.isView(s))
953
- return pe(s);
961
+ return ge(s);
954
962
  if (s == null)
955
963
  throw new TypeError(
956
964
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
@@ -1009,7 +1017,7 @@ function Ye() {
1009
1017
  i[m] = s[m] & 255;
1010
1018
  return i;
1011
1019
  }
1012
- function pe(s) {
1020
+ function ge(s) {
1013
1021
  if (Pe(s, g)) {
1014
1022
  const r = new g(s);
1015
1023
  return ie(r.buffer, r.byteOffset, r.byteLength);
@@ -1607,13 +1615,13 @@ function Ye() {
1607
1615
  }, k.prototype.writeFloatBE = function(r, i, m) {
1608
1616
  return Oe(this, r, i, !1, m);
1609
1617
  };
1610
- function Te(s, r, i, m, T) {
1618
+ function Ie(s, r, i, m, T) {
1611
1619
  return r = +r, i = i >>> 0, T || Fe(s, r, i, 8), _.write(s, r, i, m, 52, 8), i + 8;
1612
1620
  }
1613
1621
  k.prototype.writeDoubleLE = function(r, i, m) {
1614
- return Te(this, r, i, !0, m);
1622
+ return Ie(this, r, i, !0, m);
1615
1623
  }, k.prototype.writeDoubleBE = function(r, i, m) {
1616
- return Te(this, r, i, !1, m);
1624
+ return Ie(this, r, i, !1, m);
1617
1625
  }, k.prototype.copy = function(r, i, m, T) {
1618
1626
  if (!k.isBuffer(r)) throw new TypeError("argument should be a Buffer");
1619
1627
  if (m || (m = 0), !T && T !== 0 && (T = this.length), i >= r.length && (i = r.length), i || (i = 0), T > 0 && T < m && (T = m), T === m || r.length === 0 || this.length === 0) return 0;
@@ -2585,7 +2593,7 @@ function oo() {
2585
2593
  "%URIErrorPrototype%": ["URIError", "prototype"],
2586
2594
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
2587
2595
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
2588
- }, ce = Xe(), pe = /* @__PURE__ */ io(), ie = ce.call(J, Array.prototype.concat), _e = ce.call(F, Array.prototype.splice), he = ce.call(J, String.prototype.replace), L = ce.call(J, String.prototype.slice), $ = ce.call(J, RegExp.prototype.exec), z = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Y = /\\(\\)?/g, B = function(G) {
2596
+ }, ce = Xe(), ge = /* @__PURE__ */ io(), ie = ce.call(J, Array.prototype.concat), _e = ce.call(F, Array.prototype.splice), he = ce.call(J, String.prototype.replace), L = ce.call(J, String.prototype.slice), $ = ce.call(J, RegExp.prototype.exec), z = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Y = /\\(\\)?/g, B = function(G) {
2589
2597
  var V = L(G, 0, 1), d = L(G, -1);
2590
2598
  if (V === "%" && d !== "%")
2591
2599
  throw new E("invalid intrinsic syntax, expected closing `%`");
@@ -2597,7 +2605,7 @@ function oo() {
2597
2605
  }), p;
2598
2606
  }, O = function(G, V) {
2599
2607
  var d = G, p;
2600
- if (pe(me, d) && (p = me[d], d = "%" + p[0] + "%"), pe(ee, d)) {
2608
+ if (ge(me, d) && (p = me[d], d = "%" + p[0] + "%"), ge(ee, d)) {
2601
2609
  var x = ee[d];
2602
2610
  if (x === k && (x = le(d)), typeof x == "undefined" && !V)
2603
2611
  throw new a("intrinsic " + G + " exists, but is not available. Please file an issue!");
@@ -2622,7 +2630,7 @@ function oo() {
2622
2630
  var ye = d[q], oe = L(ye, 0, 1), ue = L(ye, -1);
2623
2631
  if ((oe === '"' || oe === "'" || oe === "`" || ue === '"' || ue === "'" || ue === "`") && oe !== ue)
2624
2632
  throw new E("property names with quotes must have matching quotes");
2625
- if ((ye === "constructor" || !ve) && (X = !0), p += "." + ye, H = "%" + p + "%", pe(ee, H))
2633
+ if ((ye === "constructor" || !ve) && (X = !0), p += "." + ye, H = "%" + p + "%", ge(ee, H))
2626
2634
  K = ee[H];
2627
2635
  else if (K != null) {
2628
2636
  if (!(ye in K)) {
@@ -2634,7 +2642,7 @@ function oo() {
2634
2642
  var Ce = b(K, ye);
2635
2643
  ve = !!Ce, ve && "get" in Ce && !("originalValue" in Ce.get) ? K = Ce.get : K = K[ye];
2636
2644
  } else
2637
- ve = pe(K, ye), K = K[ye];
2645
+ ve = ge(K, ye), K = K[ye];
2638
2646
  ve && !X && (ee[H] = K);
2639
2647
  }
2640
2648
  }
@@ -3167,10 +3175,10 @@ function ba() {
3167
3175
  return f(q) === "[object WeakSet]";
3168
3176
  }
3169
3177
  ce.working = typeof WeakSet != "undefined" && ce(/* @__PURE__ */ new WeakSet());
3170
- function pe(q) {
3178
+ function ge(q) {
3171
3179
  return ce(q);
3172
3180
  }
3173
- n.isWeakSet = pe;
3181
+ n.isWeakSet = ge;
3174
3182
  function ie(q) {
3175
3183
  return f(q) === "[object ArrayBuffer]";
3176
3184
  }
@@ -3452,7 +3460,7 @@ function so() {
3452
3460
  }
3453
3461
  function y(L, $, z, Y, B) {
3454
3462
  for (var O = [], D = 0, G = $.length; D < G; ++D)
3455
- pe($, String(D)) ? O.push(I(
3463
+ ge($, String(D)) ? O.push(I(
3456
3464
  L,
3457
3465
  $,
3458
3466
  z,
@@ -3473,7 +3481,7 @@ function so() {
3473
3481
  }
3474
3482
  function I(L, $, z, Y, B, O) {
3475
3483
  var D, G, V;
3476
- if (V = Object.getOwnPropertyDescriptor($, B) || { value: $[B] }, V.get ? V.set ? G = L.stylize("[Getter/Setter]", "special") : G = L.stylize("[Getter]", "special") : V.set && (G = L.stylize("[Setter]", "special")), pe(Y, B) || (D = "[" + B + "]"), G || (L.seen.indexOf(V.value) < 0 ? (P(z) ? G = A(L, V.value, null) : G = A(L, V.value, z - 1), G.indexOf(`
3484
+ if (V = Object.getOwnPropertyDescriptor($, B) || { value: $[B] }, V.get ? V.set ? G = L.stylize("[Getter/Setter]", "special") : G = L.stylize("[Getter]", "special") : V.set && (G = L.stylize("[Setter]", "special")), ge(Y, B) || (D = "[" + B + "]"), G || (L.seen.indexOf(V.value) < 0 ? (P(z) ? G = A(L, V.value, null) : G = A(L, V.value, z - 1), G.indexOf(`
3477
3485
  `) > -1 && (O ? G = G.split(`
3478
3486
  `).map(function(d) {
3479
3487
  return " " + d;
@@ -3593,7 +3601,7 @@ function so() {
3593
3601
  L[z[Y]] = $[z[Y]];
3594
3602
  return L;
3595
3603
  };
3596
- function pe(L, $) {
3604
+ function ge(L, $) {
3597
3605
  return Object.prototype.hasOwnProperty.call(L, $);
3598
3606
  }
3599
3607
  var ie = typeof Symbol != "undefined" ? Symbol("util.promisify.custom") : void 0;
@@ -4129,9 +4137,9 @@ function uo() {
4129
4137
  }
4130
4138
  }
4131
4139
  function ce(B, O, D, G) {
4132
- D || pe(B, O), O.pendingcb--, G(), $(B, O);
4140
+ D || ge(B, O), O.pendingcb--, G(), $(B, O);
4133
4141
  }
4134
- function pe(B, O) {
4142
+ function ge(B, O) {
4135
4143
  O.length === 0 && O.needDrain && (O.needDrain = !1, B.emit("drain"));
4136
4144
  }
4137
4145
  function ie(B, O) {
@@ -4733,14 +4741,14 @@ function fo() {
4733
4741
  var x = p.decoder.end();
4734
4742
  x && x.length && (p.buffer.push(x), p.length += p.objectMode ? 1 : x.length);
4735
4743
  }
4736
- p.ended = !0, p.sync ? ce(d) : (p.needReadable = !1, p.emittedReadable || (p.emittedReadable = !0, pe(d)));
4744
+ p.ended = !0, p.sync ? ce(d) : (p.needReadable = !1, p.emittedReadable || (p.emittedReadable = !0, ge(d)));
4737
4745
  }
4738
4746
  }
4739
4747
  function ce(d) {
4740
4748
  var p = d._readableState;
4741
- u("emitReadable", p.needReadable, p.emittedReadable), p.needReadable = !1, p.emittedReadable || (u("emitReadable", p.flowing), p.emittedReadable = !0, n.nextTick(pe, d));
4749
+ u("emitReadable", p.needReadable, p.emittedReadable), p.needReadable = !1, p.emittedReadable || (u("emitReadable", p.flowing), p.emittedReadable = !0, n.nextTick(ge, d));
4742
4750
  }
4743
- function pe(d) {
4751
+ function ge(d) {
4744
4752
  var p = d._readableState;
4745
4753
  u("emitReadable_", p.destroyed, p.length, p.ended), !p.destroyed && (p.length || p.ended) && (d.emit("readable"), p.emittedReadable = !1), p.needReadable = !p.flowing && !p.ended && p.length <= p.highWaterMark, B(d);
4746
4754
  }
@@ -4773,8 +4781,8 @@ function fo() {
4773
4781
  H.pipesCount += 1, u("pipe count=%d opts=%j", H.pipesCount, p);
4774
4782
  var K = (!p || p.end !== !1) && d !== n.stdout && d !== n.stderr, X = K ? q : Oe;
4775
4783
  H.endEmitted ? n.nextTick(X) : x.once("end", X), d.on("unpipe", Q);
4776
- function Q(Te, Se) {
4777
- u("onunpipe"), Te === x && Se && Se.hasUnpiped === !1 && (Se.hasUnpiped = !0, oe());
4784
+ function Q(Ie, Se) {
4785
+ u("onunpipe"), Ie === x && Se && Se.hasUnpiped === !1 && (Se.hasUnpiped = !0, oe());
4778
4786
  }
4779
4787
  function q() {
4780
4788
  u("onend"), d.end();
@@ -4786,13 +4794,13 @@ function fo() {
4786
4794
  u("cleanup"), d.removeListener("close", De), d.removeListener("finish", Fe), d.removeListener("drain", ve), d.removeListener("error", Ce), d.removeListener("unpipe", Q), x.removeListener("end", q), x.removeListener("end", Oe), x.removeListener("data", ue), ye = !0, H.awaitDrain && (!d._writableState || d._writableState.needDrain) && ve();
4787
4795
  }
4788
4796
  x.on("data", ue);
4789
- function ue(Te) {
4797
+ function ue(Ie) {
4790
4798
  u("ondata");
4791
- var Se = d.write(Te);
4799
+ var Se = d.write(Ie);
4792
4800
  u("dest.write", Se), Se === !1 && ((H.pipesCount === 1 && H.pipes === d || H.pipesCount > 1 && V(H.pipes, d) !== -1) && !ye && (u("false write response, pause", H.awaitDrain), H.awaitDrain++), x.pause());
4793
4801
  }
4794
- function Ce(Te) {
4795
- u("onerror", Te), Oe(), d.removeListener("error", Ce), t(d, "error") === 0 && v(d, Te);
4802
+ function Ce(Ie) {
4803
+ u("onerror", Ie), Oe(), d.removeListener("error", Ce), t(d, "error") === 0 && v(d, Ie);
4796
4804
  }
4797
4805
  M(d, "error", Ce);
4798
4806
  function De() {
@@ -6926,7 +6934,7 @@ var gs = Object.defineProperty, ys = Object.defineProperties, ms = Object.getOwn
6926
6934
  for (var t of Yi(e))
6927
6935
  bs.call(e, t) && Zr(n, t, e[t]);
6928
6936
  return n;
6929
- }, _s = (n, e) => ys(n, ms(e)), Re = (n, e, t) => Zr(n, typeof e != "symbol" ? e + "" : e, t), ge = (n, e, t) => new Promise((o, l) => {
6937
+ }, _s = (n, e) => ys(n, ms(e)), Re = (n, e, t) => Zr(n, typeof e != "symbol" ? e + "" : e, t), pe = (n, e, t) => new Promise((o, l) => {
6930
6938
  var c = (f) => {
6931
6939
  try {
6932
6940
  a(t.next(f));
@@ -6971,13 +6979,13 @@ class Ss extends yo {
6971
6979
  * Initialize the PeersCaller and establish WebSocket connection
6972
6980
  */
6973
6981
  initialize() {
6974
- return ge(this, null, function* () {
6982
+ return pe(this, null, function* () {
6975
6983
  try {
6976
6984
  if (console.log("[PeersCaller] Initializing..."), this.isInitialized) {
6977
6985
  console.warn("[PeersCaller] Already initialized");
6978
6986
  return;
6979
6987
  }
6980
- yield this.socket.connect(), this.setupSocketListeners(), yield this.initializeLocalParticipant(), this.isInitialized = !0, this.state.setCallStatus("idle"), console.log(
6988
+ yield this.socket.connect(), yield this.fetchIceServers(), this.setupSocketListeners(), yield this.initializeLocalParticipant(), this.isInitialized = !0, this.state.setCallStatus("idle"), console.log(
6981
6989
  "[PeersCaller] Initialization completed successfully (ready to start/join call)"
6982
6990
  );
6983
6991
  } catch (e) {
@@ -6989,7 +6997,7 @@ class Ss extends yo {
6989
6997
  * Start a new call
6990
6998
  */
6991
6999
  startCall() {
6992
- return ge(this, arguments, function* (e = this.config.mediaConfig) {
7000
+ return pe(this, arguments, function* (e = this.config.mediaConfig) {
6993
7001
  var t, o;
6994
7002
  try {
6995
7003
  if (console.log("[PeersCaller] Starting call..."), this.isInitialized || (yield this.initialize()), this.localParticipant && !this.localParticipant.getCurrentStream()) {
@@ -7019,7 +7027,7 @@ class Ss extends yo {
7019
7027
  * Join an existing call
7020
7028
  */
7021
7029
  joinCall() {
7022
- return ge(this, arguments, function* (e = this.config.mediaConfig) {
7030
+ return pe(this, arguments, function* (e = this.config.mediaConfig) {
7023
7031
  try {
7024
7032
  console.log("[PeersCaller] Joining call..."), this.isInitialized || (yield this.initialize());
7025
7033
  const t = yield this.checkCallStatus();
@@ -7054,7 +7062,7 @@ class Ss extends yo {
7054
7062
  * This sends a request to the server to end the call for all participants
7055
7063
  */
7056
7064
  endCall() {
7057
- return ge(this, null, function* () {
7065
+ return pe(this, null, function* () {
7058
7066
  try {
7059
7067
  console.log("[PeersCaller] Ending call..."), this.recorder && this.state.isRecording && (yield this.stopRecording());
7060
7068
  try {
@@ -7075,7 +7083,7 @@ class Ss extends yo {
7075
7083
  * Leave the call gracefully (with server acknowledgement)
7076
7084
  */
7077
7085
  leaveCall() {
7078
- return ge(this, null, function* () {
7086
+ return pe(this, null, function* () {
7079
7087
  try {
7080
7088
  console.log("[PeersCaller] Leaving call..."), console.log("[PeersCaller] Leaving call for room:", this.config.roomId);
7081
7089
  const e = yield this.socket.leaveCall(this.config.roomId);
@@ -7106,7 +7114,7 @@ class Ss extends yo {
7106
7114
  * Start screen sharing
7107
7115
  */
7108
7116
  startScreenShare() {
7109
- return ge(this, null, function* () {
7117
+ return pe(this, null, function* () {
7110
7118
  try {
7111
7119
  if (!this.localParticipant)
7112
7120
  throw new Error("Local participant not initialized");
@@ -7123,7 +7131,7 @@ class Ss extends yo {
7123
7131
  * Stop screen sharing
7124
7132
  */
7125
7133
  stopScreenShare() {
7126
- return ge(this, null, function* () {
7134
+ return pe(this, null, function* () {
7127
7135
  try {
7128
7136
  if (!this.localParticipant)
7129
7137
  throw new Error("Local participant not initialized");
@@ -7137,7 +7145,7 @@ class Ss extends yo {
7137
7145
  * Start recording the call
7138
7146
  */
7139
7147
  startRecording(e, t) {
7140
- return ge(this, null, function* () {
7148
+ return pe(this, null, function* () {
7141
7149
  var o;
7142
7150
  try {
7143
7151
  if (console.log("[PeersCaller] Starting recording..."), this.state.isRecording) {
@@ -7185,7 +7193,7 @@ class Ss extends yo {
7185
7193
  * Stop recording
7186
7194
  */
7187
7195
  stopRecording() {
7188
- return ge(this, null, function* () {
7196
+ return pe(this, null, function* () {
7189
7197
  try {
7190
7198
  if (console.log("[PeersCaller] Stopping recording..."), !this.recorder || !this.state.isRecording) {
7191
7199
  console.warn("[PeersCaller] No active recording to stop");
@@ -7254,7 +7262,7 @@ class Ss extends yo {
7254
7262
  * Initialize local participant
7255
7263
  */
7256
7264
  initializeLocalParticipant() {
7257
- return ge(this, null, function* () {
7265
+ return pe(this, null, function* () {
7258
7266
  this.localParticipant = new Vi(
7259
7267
  this.config.userId,
7260
7268
  {
@@ -7368,7 +7376,7 @@ class Ss extends yo {
7368
7376
  * Handle participant joined
7369
7377
  */
7370
7378
  handleParticipantJoined(e) {
7371
- return ge(this, null, function* () {
7379
+ return pe(this, null, function* () {
7372
7380
  var t, o;
7373
7381
  try {
7374
7382
  if (e === this.config.userId || this.participants.has(e))
@@ -7436,7 +7444,7 @@ class Ss extends yo {
7436
7444
  * Check call status for the conversation
7437
7445
  */
7438
7446
  checkCallStatus() {
7439
- return ge(this, null, function* () {
7447
+ return pe(this, null, function* () {
7440
7448
  try {
7441
7449
  if (console.log("[PeersCaller] Checking call status..."), !this.socket.isConnected())
7442
7450
  throw new Error("Socket not connected");
@@ -7457,7 +7465,7 @@ class Ss extends yo {
7457
7465
  * Handle WebRTC offer
7458
7466
  */
7459
7467
  handleOffer(e, t) {
7460
- return ge(this, null, function* () {
7468
+ return pe(this, null, function* () {
7461
7469
  try {
7462
7470
  if (!this.localParticipant) {
7463
7471
  console.warn(
@@ -7481,7 +7489,7 @@ class Ss extends yo {
7481
7489
  * Handle WebRTC answer
7482
7490
  */
7483
7491
  handleAnswer(e, t) {
7484
- return ge(this, null, function* () {
7492
+ return pe(this, null, function* () {
7485
7493
  try {
7486
7494
  if (!this.localParticipant) {
7487
7495
  console.warn(
@@ -7505,7 +7513,7 @@ class Ss extends yo {
7505
7513
  * Handle ICE candidate
7506
7514
  */
7507
7515
  handleCandidate(e, t) {
7508
- return ge(this, null, function* () {
7516
+ return pe(this, null, function* () {
7509
7517
  try {
7510
7518
  if (!this.localParticipant) {
7511
7519
  console.warn(
@@ -7548,7 +7556,7 @@ class Ss extends yo {
7548
7556
  * Handle call ended notification from server
7549
7557
  */
7550
7558
  handleCallEnded(e) {
7551
- return ge(this, null, function* () {
7559
+ return pe(this, null, function* () {
7552
7560
  var t, o;
7553
7561
  console.log(
7554
7562
  `[PeersCaller] Call ended by ${e.endedBy}, reason: ${e.reason}`
@@ -7589,6 +7597,31 @@ class Ss extends yo {
7589
7597
  var o, l;
7590
7598
  console.error(`[PeersCaller] ${e}: ${t}`), this.state.setError(e, t), (l = (o = this.callbacks).onError) == null || l.call(o, e, t);
7591
7599
  }
7600
+ /**
7601
+ * Fetch ICE servers from the backend
7602
+ */
7603
+ fetchIceServers() {
7604
+ return pe(this, null, function* () {
7605
+ try {
7606
+ console.log("[PeersCaller] Fetching ICE servers from backend...");
7607
+ const e = yield this.socket.getIceServers(this.roomId);
7608
+ if (e.error) {
7609
+ console.warn(
7610
+ "[PeersCaller] Failed to fetch ICE servers from backend:",
7611
+ e.error
7612
+ ), console.log("[PeersCaller] Using default ICE servers");
7613
+ return;
7614
+ }
7615
+ e.iceServers && e.iceServers.length > 0 ? (this.iceServers = e.iceServers, console.log(
7616
+ `[PeersCaller] Successfully fetched ${e.iceServers.length} ICE servers from backend for room ${this.roomId}`
7617
+ )) : console.log(
7618
+ "[PeersCaller] No ICE servers received from backend, using defaults"
7619
+ );
7620
+ } catch (e) {
7621
+ console.warn("[PeersCaller] Error fetching ICE servers:", e), console.log("[PeersCaller] Using default ICE servers");
7622
+ }
7623
+ });
7624
+ }
7592
7625
  /**
7593
7626
  * Forward WebRTC signaling data to the server
7594
7627
  */
@@ -7622,7 +7655,7 @@ class Ss extends yo {
7622
7655
  }
7623
7656
  }
7624
7657
  }
7625
- var Ae = (n, e, t) => new Promise((o, l) => {
7658
+ var Te = (n, e, t) => new Promise((o, l) => {
7626
7659
  var c = (f) => {
7627
7660
  try {
7628
7661
  a(t.next(f));
@@ -7641,7 +7674,7 @@ var Ae = (n, e, t) => new Promise((o, l) => {
7641
7674
  function qs(n) {
7642
7675
  const [e, t] = Ne(null), [o, l] = Ne(!1), c = Io(!1), E = we.getState(), a = Object.values(
7643
7676
  we((g) => g.participants)
7644
- ), f = we((g) => g.localParticipant), u = we((g) => g.callStatus === "connected"), w = we((g) => g.isRecording), A = we((g) => g.error), C = be(() => Ae(null, null, function* () {
7677
+ ), f = we((g) => g.localParticipant), u = we((g) => g.callStatus === "connected"), w = we((g) => g.isRecording), A = we((g) => g.error), C = be(() => Te(null, null, function* () {
7645
7678
  if (!(c.current || e))
7646
7679
  try {
7647
7680
  c.current = !0;
@@ -7651,7 +7684,7 @@ function qs(n) {
7651
7684
  throw console.error("[useVideoCall] Failed to initialize:", g), c.current = !1, g;
7652
7685
  }
7653
7686
  }), [n, e]), j = be(
7654
- (g) => Ae(null, null, function* () {
7687
+ (g) => Te(null, null, function* () {
7655
7688
  if (!e) {
7656
7689
  yield C();
7657
7690
  return;
@@ -7660,7 +7693,7 @@ function qs(n) {
7660
7693
  }),
7661
7694
  [e, C]
7662
7695
  ), y = be(
7663
- (g) => Ae(null, null, function* () {
7696
+ (g) => Te(null, null, function* () {
7664
7697
  if (!e) {
7665
7698
  yield C();
7666
7699
  return;
@@ -7680,19 +7713,19 @@ function qs(n) {
7680
7713
  e == null || e.toggleVideo(g);
7681
7714
  },
7682
7715
  [e]
7683
- ), b = be(() => Ae(null, null, function* () {
7716
+ ), b = be(() => Te(null, null, function* () {
7684
7717
  if (!e) throw new Error("PeersCaller not initialized");
7685
7718
  return e.startScreenShare();
7686
- }), [e]), P = be(() => Ae(null, null, function* () {
7719
+ }), [e]), P = be(() => Te(null, null, function* () {
7687
7720
  if (!e) throw new Error("PeersCaller not initialized");
7688
7721
  return e.stopScreenShare();
7689
7722
  }), [e]), _ = be(
7690
- (g) => Ae(null, null, function* () {
7723
+ (g) => Te(null, null, function* () {
7691
7724
  if (!e) throw new Error("PeersCaller not initialized");
7692
7725
  return e.startRecording(g);
7693
7726
  }),
7694
7727
  [e]
7695
- ), R = be(() => Ae(null, null, function* () {
7728
+ ), R = be(() => Te(null, null, function* () {
7696
7729
  if (!e) throw new Error("PeersCaller not initialized");
7697
7730
  return e.stopRecording();
7698
7731
  }), [e]), v = be(() => {
@@ -7767,7 +7800,7 @@ function Ws() {
7767
7800
  };
7768
7801
  }
7769
7802
  function Gs() {
7770
- const [n, e] = Ne({ videoDevices: [], audioDevices: [] }), [t, o] = Ne({ camera: null, microphone: null }), l = be(() => Ae(null, null, function* () {
7803
+ const [n, e] = Ne({ videoDevices: [], audioDevices: [] }), [t, o] = Ne({ camera: null, microphone: null }), l = be(() => Te(null, null, function* () {
7771
7804
  try {
7772
7805
  const a = yield navigator.mediaDevices.enumerateDevices();
7773
7806
  e({
@@ -7777,7 +7810,7 @@ function Gs() {
7777
7810
  } catch (a) {
7778
7811
  console.error("[useMediaDevices] Failed to get devices:", a);
7779
7812
  }
7780
- }), []), c = be(() => Ae(null, null, function* () {
7813
+ }), []), c = be(() => Te(null, null, function* () {
7781
7814
  try {
7782
7815
  if ("permissions" in navigator) {
7783
7816
  const a = yield navigator.permissions.query({
@@ -7793,7 +7826,7 @@ function Gs() {
7793
7826
  } catch (a) {
7794
7827
  console.error("[useMediaDevices] Failed to check permissions:", a);
7795
7828
  }
7796
- }), []), E = be(() => Ae(null, null, function* () {
7829
+ }), []), E = be(() => Te(null, null, function* () {
7797
7830
  try {
7798
7831
  return (yield navigator.mediaDevices.getUserMedia({
7799
7832
  video: !0,