@fairfox/polly 0.29.4 → 0.30.0

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/src/mesh.js CHANGED
@@ -2137,6 +2137,12 @@ class MeshWebRTCAdapter extends NetworkAdapter2 {
2137
2137
  }
2138
2138
 
2139
2139
  // src/shared/lib/mesh-client.ts
2140
+ async function resolveIceServers(rtc) {
2141
+ if (rtc?.iceCredentialResolver) {
2142
+ return rtc.iceCredentialResolver();
2143
+ }
2144
+ return rtc?.iceServers;
2145
+ }
2140
2146
  async function createMeshClient(options) {
2141
2147
  const keyring = await resolveKeyring(options.keyring);
2142
2148
  const encryptionEnabled = options.encryptionEnabled ?? true;
@@ -2144,11 +2150,12 @@ async function createMeshClient(options) {
2144
2150
  throw new Error(`createMeshClient: encryption is enabled but the keyring has no document key for "${DEFAULT_MESH_KEY_ID}". Bootstrap or apply a pairing token that carries the document key before connecting.`);
2145
2151
  }
2146
2152
  const knownPeerIds = [...keyring.knownPeers.keys()].filter((id) => id !== options.signaling.peerId);
2153
+ const resolvedIceServers = await resolveIceServers(options.rtc);
2147
2154
  const webrtcAdapterOptions = {
2148
2155
  signaling: undefined,
2149
2156
  peerId: options.signaling.peerId,
2150
2157
  knownPeerIds,
2151
- ...options.rtc?.iceServers !== undefined && { iceServers: options.rtc.iceServers },
2158
+ ...resolvedIceServers !== undefined && { iceServers: resolvedIceServers },
2152
2159
  ...options.rtc?.dataChannelLabel !== undefined && {
2153
2160
  dataChannelLabel: options.rtc.dataChannelLabel
2154
2161
  },
@@ -2609,4 +2616,4 @@ export {
2609
2616
  $meshCounter
2610
2617
  };
2611
2618
 
2612
- //# debugId=F8AB2EAE5AA41F5864756E2164756E21
2619
+ //# debugId=B913980F5DCF2AE364756E2164756E21