Hello All,
I have a live audio streaming application, I want to add some buffer at client end so that in case of network spikes the audio is smooth.
Till now i found that 'playoutDelayHint' this property can be used, Let me know if i am wrong.
I have tried to add below code but its not working.(Both the console.log are printing)
this.webRtcPeer = new kurentoUtils.WebRtcPeer.WebRtcPeerRecvonly(options,
error => {
if (error) {
return console.error(error);
}
this.webRtcPeer.generateOffer((a, b) => this.onOffer(a, b));
console.log("################ Adding 10 sec delay");
this.webRtcPeer.peerConnection.getReceivers().forEach(function (sender) {
sender.playoutDelayHint = 10;
console.log("################ ADDED 10 sec delay");
});
});
I also tried to do this with below code (Still no luck):
const [audioReceiver, videoReceiver] = this.webRtcPeer.peerConnection.getReceivers();
// Add additional 500 milliseconds of buffering.
setInterval(async () => {
audioReceiver.playoutDelayHint = audioReceiver.jitterBufferDelayHint = 100;
}, 1);
Thanks