Fix ICE candidate handling - send full candidate objects

- Update IceCandidate interface to include sdpMid and sdpMLineIndex
- Update addIceCandidates to accept full candidate objects
- Update connection manager to send and receive complete ICE data
- Fixes 'Either sdpMid or sdpMLineIndex must be specified' error

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-14 19:31:30 +01:00
parent cd78a16c66
commit dd64a565aa
2 changed files with 26 additions and 8 deletions

View File

@@ -26,6 +26,8 @@ export interface Offer {
export interface IceCandidate {
candidate: string;
sdpMid: string | null;
sdpMLineIndex: number | null;
peerId: string;
role: 'offerer' | 'answerer';
createdAt: number;
@@ -278,7 +280,14 @@ export class RondevuOffers {
/**
* Post ICE candidates for an offer
*/
async addIceCandidates(offerId: string, candidates: string[]): Promise<void> {
async addIceCandidates(
offerId: string,
candidates: Array<{
candidate: string;
sdpMid?: string | null;
sdpMLineIndex?: number | null;
}>
): Promise<void> {
const response = await this.fetchFn(`${this.baseUrl}/offers/${encodeURIComponent(offerId)}/ice-candidates`, {
method: 'POST',
headers: {