From ed3c8442ba4d134d9430af4ccb341ca3cd91d6ec Mon Sep 17 00:00:00 2001 From: Vittorio Palmisano Date: Mon, 16 Dec 2024 15:17:19 +0100 Subject: [PATCH] allow to set audio video jitter buffers --- scripts/playout-delay-hint.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/playout-delay-hint.js b/scripts/playout-delay-hint.js index faa36d3..093e9ba 100644 --- a/scripts/playout-delay-hint.js +++ b/scripts/playout-delay-hint.js @@ -33,10 +33,11 @@ window.getPlayoutDelayHint = () => { } const handleTransceiverForJitterBufferTarget = (id, transceiver, event) => { - const jitterBufferTarget = window.PARAMS?.jitterBufferTarget - if (jitterBufferTarget === undefined) { - return + let jitterBufferTarget = window.PARAMS?.jitterBufferTarget + if (jitterBufferTarget && isNaN(jitterBufferTarget)) { + jitterBufferTarget = jitterBufferTarget[transceiver.receiver.track?.kind] } + if (isNaN(jitterBufferTarget)) return if (transceiver.receiver && transceiver.receiver.track?.label !== 'probator') { log( `RTCPeerConnection-${id} ${event}: set jitterBufferTarget ${transceiver.receiver.track?.kind} ${transceiver.receiver.jitterBufferTarget} -> ${jitterBufferTarget}`,