Jump to content
  • 0

How could we get a notified by JS SDK about the latency increased ?


Alper
 Share

Question

1 answer to this question

Recommended Posts

  • 1

Thank you for the question. I think looking at the RTT(Round Trip Time) likely gives you the result. 

Sample publishing page shows the RTT in seconds. Check the screenshot below

 

 

image.thumb.png.981077d493447c0dab5d916c34df6abd.png

 

In order to get this value, you just need to call the `enableStats` after you receive the `publish_started` callback as in the sample publisher page

 

...
else if (info == "publish_started") {
	webRTCAdaptor.enableStats(obj.streamId);
}
...

 

After that, you'll receive `updated_stats` callback and you can get the video and audio Round Trip Time as follows. 

...
else if (info == "updated_stats") {					
  console.log(
	" video RTT: " + obj.videoRoundTripTime + " audio RTT: " + obj.audioRoundTripTime 
	);
}
...

In a good scenario, RTT time should be less than 50ms, the lower the better. Additionally, jitter and packet lost are the other parameters that specify the quality of the video.

I hope this response answers your question well.  
 

Please let me know if you have any other questions or I can do anything for you. 

 

Regards,

Oguz

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...