diff --git a/src/plugins/streaming-plugin.js b/src/plugins/streaming-plugin.js index d2af62c..e16e7d2 100644 --- a/src/plugins/streaming-plugin.js +++ b/src/plugins/streaming-plugin.js @@ -566,17 +566,19 @@ 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) * @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', @@ -630,6 +632,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;