Skip to main content

render_answer

Function render_answer 

Source
pub fn render_answer(answer: &SdpAnswer) -> String
Expand description

Serialize an SDP answer for the application/sdp response body.

str0m can emit a rejected media line (port 0) with an EMPTY format list, e.g. m=audio 0 UDP/TLS/RTP/SAVPF . This happens when we restrict the CodecConfig (see crate::session::rtc_config_with_codecs) and the peer’s offer carries a codec the broadcast can’t egress – the classic case being AAC audio over WHEP, which we can’t carry, so the audio m-line comes back rejected with no payload. An m-line with no <fmt> violates RFC 4566, and a browser rejects the WHOLE answer in setRemoteDescription, killing playback of the media (e.g. video) that WAS negotiated. So we give any such line a placeholder static payload; the media stays rejected (port 0), so the placeholder is never used.