Add combined polling API method for answers and ICE candidates

- Add pollOffers() method to RondevuAPI class
- Expose pollOffers() in Rondevu class
- Returns both answered offers and ICE candidates in single call
- Supports timestamp-based filtering with optional 'since' parameter
- More efficient than separate getAnsweredOffers() and getOfferIceCandidates() calls
This commit is contained in:
2025-12-10 19:33:11 +01:00
parent 8fbb76a336
commit b60799a712
2 changed files with 53 additions and 0 deletions

View File

@@ -296,6 +296,26 @@ export class Rondevu {
return await this.api.getAnsweredOffers(since)
}
/**
* Combined efficient polling for answers and ICE candidates
* Returns all answered offers and ICE candidates for all peer's offers since timestamp
*/
async pollOffers(since?: number): Promise<{
answers: Array<{
offerId: string
serviceId?: string
answererId: string
sdp: string
answeredAt: number
}>
iceCandidates: Record<string, Array<{
candidate: any
createdAt: number
}>>
}> {
return await this.api.pollOffers(since)
}
/**
* Add ICE candidates to specific offer
*/