diff --git a/src/main/js/webrtc_adaptor.js b/src/main/js/webrtc_adaptor.js index 17ecaa93..fb1248f8 100644 --- a/src/main/js/webrtc_adaptor.js +++ b/src/main/js/webrtc_adaptor.js @@ -550,15 +550,22 @@ export class WebRTCAdaptor { * @param {string=} mode : legacy for older implementation (default value) * mcu for merging streams * amcu: audio only conferences with mixed audio + * @param {string=} streamName : name of the stream + * @param {string=} role : role for the stream. It is used for selective forwarding of subtracks in conference mode. + * @param {string=} metadata : a free text information for the stream to AMS. */ - joinRoom(roomName, streamId, mode) { + joinRoom(roomName, streamId, mode, streamName, role, metadata) { this.roomName = roomName; let jsCmd = { command: "joinRoom", room: roomName, + mainTrack: roomName, streamId: streamId, mode: mode, + streamName: streamName, + role: role, + metadata: metadata, } this.webSocketAdaptor.send(JSON.stringify(jsCmd)); } @@ -758,8 +765,9 @@ export class WebRTCAdaptor { * Called to leave from a conference room. AMS responds with leavedTheRoom message. * Parameters: * @param {string} roomName : unique id for the conference room + * @param {string=} streamId : unique id for the stream that is streamed by this @WebRTCAdaptor */ - leaveFromRoom(roomName) { + leaveFromRoom(roomName, streamId) { for (var key in this.remotePeerConnection) { this.closePeerConnection(key); } @@ -767,6 +775,8 @@ export class WebRTCAdaptor { var jsCmd = { command: "leaveFromRoom", room: roomName, + mainTrack: roomName, + streamId: streamId, }; Logger.debug("leave request is sent for " + roomName); diff --git a/src/test/js/webrtc_adaptor.test.js b/src/test/js/webrtc_adaptor.test.js index 5a319f1c..467e07fc 100644 --- a/src/test/js/webrtc_adaptor.test.js +++ b/src/test/js/webrtc_adaptor.test.js @@ -897,15 +897,20 @@ describe("WebRTCAdaptor", function() { let jsCmd = { command: "joinRoom", room: roomId, + mainTrack: roomId, streamId: streamId, mode: "multitrack", + streamName: "streamName", + role: "role", + metadata: "metadata", + } let webSocketAdaptor = sinon.mock(adaptor.webSocketAdaptor); let sendExpectation = webSocketAdaptor.expects("send").once().withArgs(JSON.stringify(jsCmd)); - adaptor.joinRoom(roomId, streamId, "multitrack"); + adaptor.joinRoom(roomId, streamId, "multitrack", "streamName", "role", "metadata"); sendExpectation.verify()