Skip to content

Commit

Permalink
videoroom/streaming: add optional e2ee parameter to start request
Browse files Browse the repository at this point in the history
  • Loading branch information
atoppi committed Jan 26, 2024
1 parent b6eb92a commit c8247f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/plugins/streaming-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@ class StreamingHandle extends Handle {
*
* @param {object} params
* @property {RTCSessionDescription} params.jsep
* @property {boolean} [params.e2ee]
* @returns {Promise<module:streaming-plugin~STREAMING_EVENT_STATUS>}
*/
async start({ jsep }) {
async start({ jsep, e2ee }) {
if (typeof jsep === 'object' && jsep && jsep.type !== 'answer') {
const error = new Error('jsep must be an answer');
return Promise.reject(error);
Expand All @@ -259,6 +260,7 @@ class StreamingHandle extends Handle {
const body = {
request: REQUEST_START,
};
jsep.e2ee = (typeof e2ee === 'boolean') ? e2ee : jsep.e2ee;

const response = await this.message(body, jsep);
const { event, data: evtdata } = response._janode || {};
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/videoroom-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,14 @@ class VideoRoomHandle extends Handle {
*
* @param {object} params
* @param {RTCSessionDescription} params.jsep - The JSEP answer
* @param {boolean} [e2ee] - True to hint an end-to-end encrypted negotiation
* @returns {Promise<module:videoroom-plugin~VIDEOROOM_EVENT_STARTED>}
*/
async start({ jsep }) {
async start({ jsep, e2ee }) {
const body = {
request: REQUEST_START,
};
jsep.e2ee = (typeof e2ee === 'boolean') ? e2ee : jsep.e2ee;

const response = await this.message(body, jsep);
const { event, data: evtdata } = response._janode || {};
Expand Down

0 comments on commit c8247f7

Please sign in to comment.