From e1e393514a067f4ecd6ab6df6377db3943551cbe Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Tue, 10 Feb 2026 16:25:45 +0100 Subject: [PATCH 1/3] streaming: add support for bufferkf_ms and bufferkf_bytes --- src/plugins/streaming-plugin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/streaming-plugin.js b/src/plugins/streaming-plugin.js index d2af62c..fb227a4 100644 --- a/src/plugins/streaming-plugin.js +++ b/src/plugins/streaming-plugin.js @@ -617,6 +617,8 @@ class StreamingHandle extends Handle { if (video.rtpmap) body.videortpmap = video.rtpmap; if (video.fmtp) body.videofmtp = video.fmtp; if (typeof video.buffer === 'boolean') body.videobufferkf = video.buffer; + if (typeof video.bufferkf_ms === 'number') body.bufferkf_ms = video.bufferkf_ms; + if (typeof video.bufferkf_bytes === 'number') body.bufferkf_bytes = video.bufferkf_bytes; if (typeof video.skew === 'boolean') body.videoskew = video.skew; if (typeof video.port2 === 'number' && typeof video.port3 === 'number') { body.videosimulcast = true; From a3074f8cb808e91009c323ff7dbf89eae394b561 Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Tue, 10 Feb 2026 16:29:41 +0100 Subject: [PATCH 2/3] Move the properties out of the video object, and make them explicit --- src/plugins/streaming-plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/streaming-plugin.js b/src/plugins/streaming-plugin.js index fb227a4..79e6f44 100644 --- a/src/plugins/streaming-plugin.js +++ b/src/plugins/streaming-plugin.js @@ -576,7 +576,7 @@ class StreamingHandle extends Handle { * @param {number} [params.collision] - The stream collision discarding time in number of milliseconds (0=disabled) * @returns {Promise} */ - async createRtpMountpoint({ id = 0, name, description, secret, pin, admin_key, permanent = false, is_private = false, e2ee = false, audio, video, data, media, threads, metadata, collision }) { + async createRtpMountpoint({ id = 0, name, description, secret, pin, admin_key, permanent = false, is_private = false, e2ee = false, audio, video, data, media, bufferkf_ms, bufferkf_bytes, threads, metadata, collision }) { const body = { request: REQUEST_CREATE, type: 'rtp', @@ -617,8 +617,6 @@ class StreamingHandle extends Handle { if (video.rtpmap) body.videortpmap = video.rtpmap; if (video.fmtp) body.videofmtp = video.fmtp; if (typeof video.buffer === 'boolean') body.videobufferkf = video.buffer; - if (typeof video.bufferkf_ms === 'number') body.bufferkf_ms = video.bufferkf_ms; - if (typeof video.bufferkf_bytes === 'number') body.bufferkf_bytes = video.bufferkf_bytes; if (typeof video.skew === 'boolean') body.videoskew = video.skew; if (typeof video.port2 === 'number' && typeof video.port3 === 'number') { body.videosimulcast = true; @@ -632,6 +630,8 @@ class StreamingHandle extends Handle { if (typeof data.buffer === 'boolean') body.databuffermsg = data.buffer; } } + if (typeof bufferkf_ms === 'number') body.bufferkf_ms = bufferkf_ms; + if (typeof bufferkf_bytes === 'number') body.bufferkf_bytes = bufferkf_bytes; if (typeof threads === 'number' && threads > 0) body.threads = threads; if (metadata) body.metadata = metadata; if (typeof collision === 'number') body.collision = collision; From 29ac91c4470b2dd52ff9e9bf7e9120f1c76c9e0e Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Tue, 10 Feb 2026 17:36:27 +0100 Subject: [PATCH 3/3] Update jsdoc --- src/plugins/streaming-plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/streaming-plugin.js b/src/plugins/streaming-plugin.js index 79e6f44..e16e7d2 100644 --- a/src/plugins/streaming-plugin.js +++ b/src/plugins/streaming-plugin.js @@ -566,11 +566,13 @@ class StreamingHandle extends Handle { * @param {string} [params.video.rtpmap] - rtpmap that will be used * @param {boolean} [params.video.skew] - Set skew compensation * @param {string} [params.video.fmtp] - fmtp that will be used - * @param {boolean} [params.video.buffer] - Enable buffering of the keyframes + * @param {boolean} [params.video.buffer] - Enable buffering of the keyframes (deprecated, see bufferkf_ms and bufferkf_bytes) * @param {Object} [params.data] - The datachannel descriptor for the mp * @param {number} [params.data.port] - Port used for datachannels packets * @param {boolean} [params.data.buffer] - Enable buffering of the datachannels * @param {object[]} [params.media] - [multistream] The media object, each media includes type, mid, port, pt ... + * @param {number} [params.bufferkf_ms] - Enable buffering of the video keyframes (milliseconds) + * @param {number} [params.bufferkf_bytes] - Enable buffering of the video keyframes (bytes) * @param {number} [params.threads] - The number of helper threads used in this mp * @param {Object} [params.metadata] - An opaque metadata to add to the mp * @param {number} [params.collision] - The stream collision discarding time in number of milliseconds (0=disabled)