A shim to insulate apps from WebRTC spec changes and browser prefix differences
Overall
score
98%
Build a helper module that simplifies WebRTC session description management during the offer-answer exchange process.
Your implementation should provide a function that:
type and sdp propertiesThe function should leverage modern WebRTC APIs to simplify session description handling.
@generates
/**
* Creates an offer and handles the answer for a WebRTC peer connection.
*
* @param {RTCPeerConnection} pc - The peer connection to negotiate
* @param {Object} answerData - The answer from remote peer as plain object with type and sdp
* @returns {Promise<string>} The offer SDP string to send to remote peer
*/
async function createAndExchangeOffer(pc, answerData) {
// IMPLEMENTATION HERE
}
module.exports = { createAndExchangeOffer };{type: 'answer', sdp: '...'}, successfully sets both local and remote descriptions @testProvides cross-browser WebRTC compatibility and session description handling.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-webrtc-adapterdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10