@xtr-dev/rondevu-client 0.17.0 → 0.17.1

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.
Files changed (2) hide show
  1. package/dist/rondevu.js +7 -1
  2. package/package.json +1 -1
package/dist/rondevu.js CHANGED
@@ -252,7 +252,13 @@ export class Rondevu {
252
252
  pc.onicecandidate = async (event) => {
253
253
  if (event.candidate) {
254
254
  try {
255
- await this.api.addOfferIceCandidates(serviceFqn, offerId, [event.candidate.toJSON()]);
255
+ // Handle both browser and Node.js (wrtc) environments
256
+ // Browser: candidate.toJSON() exists
257
+ // Node.js wrtc: candidate is already a plain object
258
+ const candidateData = typeof event.candidate.toJSON === 'function'
259
+ ? event.candidate.toJSON()
260
+ : event.candidate;
261
+ await this.api.addOfferIceCandidates(serviceFqn, offerId, [candidateData]);
256
262
  }
257
263
  catch (err) {
258
264
  console.error('[Rondevu] Failed to send ICE candidate:', err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtr-dev/rondevu-client",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "TypeScript client for Rondevu with durable WebRTC connections, automatic reconnection, and message queuing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",