Hi there,
in Example: Inject Audio and Video using FFmpeg, this logic is shown (not exact code, but same operations):
const transport = await router.createPlainTransport(
{
ip : '127.0.0.1',
rtcpMux : false,
comedia : true
});
const rtpPort = transport.tuple.localPort;
(Note, it should read “router.createPlainRtpTransport()” and “listenIp” instead of “ip”, I’ve created a PR for these small typos: #6)
My doubt comes from the fact that PlainRtpTransport.tuple
should not exist before calling PlainRtpTransport.connect()
; docs say:
plainRtpTransport.tuple
The transport tuple. It’s set after callingconnect()
method (it’s undefined otherwise).
However, the linked example uses comedia
, which forbids using connect()
:
comedia, Boolean, […] If enabled,
connect()
method must not be called.
Which brings me to this question: is the example valid at all?
Does the call await router.createPlainRtpTransport()
only return after having actually received remote RTP packets (thus being able to obtain the remote IP address and port)? If not, I don’t see how the example would be correct, so I’d appreciate an explanation of how this works