-
I am following your examples and have the error The presence of the "bundle group" is ensure here in your lib: ex_webrtc/lib/ex_webrtc/sdp_utils.ex Line 34 in ae1e49f I imagine that my SDP below is "bad" but what is the reason? %ExWebRTC.SessionDescription{
type: :offer,
sdp: "v=0\r\no=- 7650321100484192730 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\n"
} How do I get it?The JS is straightforward: localPC = new RTCPeerConnection(PCCONFIG);
const offer = await localPC.createOffer();
await localPC.setLocalDescription(offer);
channel.push("signaling", JSON.stringify(localPC.localDescription)); The Channel For debugging, I made this function verbose. case Jason.decode!(msg) do
%{"type" => "offer"} = offer ->
with {:sd, desc} <-
{:sd, SessionDescription.from_json(offer)},
{:pc_srd, :ok} <-
{:pc_srd, PeerConnection.set_remote_description(state.pc, desc)},
{:pc_ca, {:ok, answer}} <-
{:pc_ca, PeerConnection.create_answer(state.pc)},
{:pc_sld, :ok} <-
{:pc_sld, PeerConnection.set_local_description(state.pc, answer)} do
msg = %{"type" => "answer", "sdp" => answer.sdp}
send(state.channel, {:signaling, msg})
else
{step, error} ->
Logger.error("Error creating answer: #{inspect({step, error})}")
end
The state of the Room GS is: state #=> %{
pc: #PID<0.1405.0>,
channel: #PID<0.1404.0>,
room_id: "1",
video_track: nil,
video_depayloader: %ExWebRTC.RTP.VP8Depayloader{
current_frame: nil,
current_timestamp: nil
},
audio_track: nil
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Your offer needs to contain at least one media line (
We could allow empty offers, but I don't really see how that could be useful, can you share your usecase? |
Beta Was this translation helpful? Give feedback.
-
My use case is just my ignorance... localStream = await navigator.mediaDevices.getUserMedia(MEDIACONSTRAINTS);
localPC = new RTCPeerConnection(PCCONFIG);
for (let track of localStream.getTracks()) {
localPC.addTrack(track, localStream);
}
^^^
const offer = await localPC.createOffer();
await localPC.setLocalDescription(offer);
channel.push("signaling", JSON.stringify(localPC.localDescription)); sdp:
|
Beta Was this translation helpful? Give feedback.
Your offer needs to contain at least one media line (
m=audio 9 ...
) that is bundled (so yourbundle_policy
in JS PeerConnection config is left as the default). If you add a track or a transceiver to your JS PeerConnection (pc.addTransceiver("audio")
before creating the offer), it should work fine. Your offer will look something like this: