From c872f80e0f9b1fee735ec5a96c0eb6ed12182cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Per=C5=BCy=C5=82o?= Date: Mon, 22 Jul 2024 11:21:29 +0200 Subject: [PATCH] Custom collision parameter in streaming plugin --- src/plugins/streaming-plugin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/streaming-plugin.js b/src/plugins/streaming-plugin.js index d6282ad..ee1bf80 100644 --- a/src/plugins/streaming-plugin.js +++ b/src/plugins/streaming-plugin.js @@ -560,9 +560,10 @@ class StreamingHandle extends Handle { * @param {boolean} [params.data.buffer] - Enable buffering of the datachannels * @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, threads, metadata }) { + async createRtpMountpoint({ id = 0, name, description, secret, pin, admin_key, permanent = false, is_private = false, e2ee = false, audio, video, data, threads, metadata, collision }) { const body = { request: REQUEST_CREATE, type: 'rtp', @@ -612,6 +613,7 @@ class StreamingHandle extends Handle { } if (typeof threads === 'number' && threads > 0) body.threads = threads; if (metadata) body.metadata = metadata; + if (typeof collision === 'number') body.collision = collision; const response = await this.message(body); const { event, data: evtdata } = response._janode || {}; @@ -751,4 +753,4 @@ export default { */ STREAMING_ERROR: PLUGIN_EVENT.ERROR, }, -}; \ No newline at end of file +};