mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-15 05:13:23 +00:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user