Skip to content

Commit

Permalink
Custom collision parameter in streaming plugin (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qizot authored Jul 22, 2024
1 parent b1439ad commit 75149c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/streaming-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<module:streaming-plugin~STREAMING_EVENT_CREATED>}
*/
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',
Expand Down Expand Up @@ -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 || {};
Expand Down Expand Up @@ -751,4 +753,4 @@ export default {
*/
STREAMING_ERROR: PLUGIN_EVENT.ERROR,
},
};
};

0 comments on commit 75149c3

Please sign in to comment.