The TypeScript definition of ProducerStat clearly says that it’s an optional value:
roundTripTime?: number;
And this is because, whether mediasoup can calculate it or not, depend on the presence of RTCP XR exchange between mediasoup and the producer endpoint. We don’t show it in the stats when its value is zero (its initial value). Are you testing in localhost? or also in server side?
You can do it manually by listening for the “trace” event of type “packet” in the Producer and calculating how many video frames (RTP packets with same timestamp value) are received per seconds. However, you’d rather get it in client side via local producer stats.
Yes, we cannot do magic and cannot know in advance whether we’ll be able to calculate roundTripTime or not. The commit I referenced should be self-explanatory.