Skip to content

Commit

Permalink
fix bug audio and video codec don't working
Browse files Browse the repository at this point in the history
fix #99
the bug from: 7fd9a19
  • Loading branch information
a-wing committed Mar 28, 2024
1 parent 603b5ea commit c617b33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/whip.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export class WHIPClient
//Pending candidadtes
this.candidates = [];
this.endOfcandidates = false;

this.onOffer = offer => offer;
this.onAnswer = answer => answer;
}

async publish(pc, url, token)
Expand Down Expand Up @@ -46,6 +49,7 @@ export class WHIPClient
}
//Create SDP offer
const offer = await pc.createOffer();
offer.sdp = this.onOffer(offer.sdp);

//Request headers
const headers = {
Expand Down Expand Up @@ -192,7 +196,7 @@ export class WHIPClient
//}

//And set remote description
await pc.setRemoteDescription({ type: "answer", sdp: answer });
await pc.setRemoteDescription({ type: "answer", sdp: this.onAnswer(answer) });
}

async restart()
Expand Down

0 comments on commit c617b33

Please sign in to comment.