mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-14 04:43:24 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b879522da | |||
| eb280e3826 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/rondevu-client",
|
"name": "@xtr-dev/rondevu-client",
|
||||||
"version": "0.17.0",
|
"version": "0.17.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@xtr-dev/rondevu-client",
|
"name": "@xtr-dev/rondevu-client",
|
||||||
"version": "0.17.0",
|
"version": "0.17.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/ed25519": "^3.0.0",
|
"@noble/ed25519": "^3.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/rondevu-client",
|
"name": "@xtr-dev/rondevu-client",
|
||||||
"version": "0.17.0",
|
"version": "0.17.1",
|
||||||
"description": "TypeScript client for Rondevu with durable WebRTC connections, automatic reconnection, and message queuing",
|
"description": "TypeScript client for Rondevu with durable WebRTC connections, automatic reconnection, and message queuing",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
@@ -365,10 +365,17 @@ export class Rondevu {
|
|||||||
pc.onicecandidate = async (event) => {
|
pc.onicecandidate = async (event) => {
|
||||||
if (event.candidate) {
|
if (event.candidate) {
|
||||||
try {
|
try {
|
||||||
|
// Handle both browser and Node.js (wrtc) environments
|
||||||
|
// Browser: candidate.toJSON() exists
|
||||||
|
// Node.js wrtc: candidate is already a plain object
|
||||||
|
const candidateData = typeof event.candidate.toJSON === 'function'
|
||||||
|
? event.candidate.toJSON()
|
||||||
|
: event.candidate
|
||||||
|
|
||||||
await this.api.addOfferIceCandidates(
|
await this.api.addOfferIceCandidates(
|
||||||
serviceFqn,
|
serviceFqn,
|
||||||
offerId,
|
offerId,
|
||||||
[event.candidate.toJSON()]
|
[candidateData]
|
||||||
)
|
)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[Rondevu] Failed to send ICE candidate:', err)
|
console.error('[Rondevu] Failed to send ICE candidate:', err)
|
||||||
|
|||||||
Reference in New Issue
Block a user