@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.
- package/dist/rondevu.js +7 -1
- 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
|
-
|
|
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