How To Add Additional Desktop Track

I am trying to add a deskop track as a new track and not to replace the current track. According to threads like this, Cannot add second audio track, possible before - #2 by damencho, there is suppose to be the ability to add multiple tracks. Here is my code.

function addDesktop() {

                devices: ['desktop'],
                resolution: 1080
            }).then(async (screenTracks) => {

                var screenVideoTrack = screenTracks.filter(track => track.getType() === 'video')[0];

                await onRemoteTrack(screenVideoTrack);

                if (screenVideoTrack) {

                    await room.addTrack(screenVideoTrack);

                    let i = localVideoTrackIndex +1;


                    localVideoTrack = screenVideoTrack;

            }).catch(error => {

                alert("There was an error sharing your video feed.");



The problem is I get this error:

webrtc_class.js:3220 Error: Cannot add second video track to the conference

And the error occurs at line:

await room.addTrack(screenVideoTrack);

And ideas to what I am doing wrong?

Going through the code of addTrack, is the currently impossible?

JitsiConference.prototype.addTrack = function(track) {
    const mediaType = track.getType();
    const localTracks = this.rtc.getLocalTracks(mediaType);

    // Ensure there's exactly 1 local track of each media type in the conference.
    if (localTracks.length > 0) {
        // Don't be excessively harsh and severe if the API client happens to attempt to add the same local track twice.
        if (track === localTracks[0]) {
            return Promise.resolve(track);

        // Currently, only adding multiple video streams of different video types is supported.
        // TODO - remove this limitation once issues with jitsi-meet trying to add multiple camera streams is fixed.
        if (FeatureFlags.isMultiStreamSendSupportEnabled()
            && mediaType === MediaType.VIDEO
            && !localTracks.find(t => t.getVideoType() === track.getVideoType())) {
            const sourceName = getSourceNameForJitsiTrack(

            const addTrackPromises = [];

            this.p2pJingleSession && addTrackPromises.push(this.p2pJingleSession.addTracks([ track ]));
            this.jvbJingleSession && addTrackPromises.push(this.jvbJingleSession.addTracks([ track ]));

            return Promise.all(addTrackPromises)
                .then(() => {

                    if (this.isMutedByFocus || this.isVideoMutedByFocus) {

        return Promise.reject(new Error(`Cannot add second ${mediaType} track to the conference`));

Namely this line:

&& !localTracks.find(t => t.getVideoType() === track.getVideoType()))