Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS screenshare not working #2314

Open
Cogniveon opened this issue Jul 11, 2023 · 10 comments
Open

MacOS screenshare not working #2314

Cogniveon opened this issue Jul 11, 2023 · 10 comments

Comments

@Cogniveon
Copy link

I found a similar issue open (#464 feature-request), however this MacOS screen sharing issue has not been discussed.

Current behavior

Trying to share the screen on MacOS throws an Error (Cannot add second video track to the conference)

Expected Behavior

Sharing the screen should either close the camera video and switch to the screensharing view or add another video track for sharing the screen.

Steps to reproduce

  • Start a jitsi meet
  • Attempt to share the screen from a MacOS device.

Environment details

lib-jitsi-meet version: v1626.0.0+a41aa571
jitsi-meet server version: 2.0.8615
@jitsi/electron-sdk version: 5.0.5
MacOS version: Ventura 13.2

@saghul
Copy link
Member

saghul commented Jul 11, 2023

Do you have your own client built with lib-jitsi-meet?

@Cogniveon
Copy link
Author

My own application built with jitsi electron sdk.
Electron logs show the error from this function block
The function block comment says they have to add support for multiple video tracks but MacOS screen share is completely broken because of this.

@saghul
Copy link
Member

saghul commented Jul 11, 2023

What config do initialize lib-jitsi-meet with?

@Cogniveon
Copy link
Author

This is the config used to initialize lib-jitsi-meet

var config = {
    hosts: {
        domain: 'example.com',
        muc: 'conference.<!--# echo var="subdomain" default="" -->example.com'
    },

    // BOSH URL. FIXME: use XEP-0156 to discover it.
    bosh: '//example.com/http-bind',

    testing: {
    },
    enableNoAudioDetection: true,
    enableNoisyMicDetection: true,
    // Default value for the channel "last N" attribute. -1 for unlimited.
    channelLastN: -1,
    enableWelcomePage: false,
    toolbarButtons: [
        'camera',
        'chat',
        'closedcaptions',
        'desktop',
    //    'download',
    //    'embedmeeting',
    //    'etherpad',
    //    'feedback',
        'filmstrip',
    //    'fullscreen',
        'hangup',
    //    'help',
    //    'invite',
    //    'livestreaming',
        'microphone',
        'mute-everyone',
        'mute-video-everyone',
    //    'participants-pane',
        'profile',
        'raisehand',
    //    'recording',
    //    'security',
        'select-background',
        'settings',
    //    'shareaudio',
    //    'sharedvideo',
        'shortcuts',
        'stats',
        'tileview',
        'toggle-camera',
        'videoquality',
        '__end'
     ],

    p2p: {
        enabled: true,
        stunServers: [

            // { urls: 'stun:example.com:3478' },
            { urls: 'stun:example.com:443' }
        ]
    },

    analytics: {
    },
    deploymentInfo: {
    },
    /**
     * Default interval (milliseconds) for triggering mouseMoved iframe API event
     */
    mouseMoveCallbackInterval: 1000,
    makeJsonParserHappy: 'even if last key had a trailing comma'
};

/* eslint-enable no-unused-vars, no-var */
// Temporary backwards compatibility with old mobile clients.
config.flags = config.flags || {};
config.flags.sourceNameSignaling = true;
config.flags.sendMultipleVideoStreams = true;
config.flags.receiveMultipleVideoStreams = true;

@saghul
Copy link
Member

saghul commented Jul 13, 2023

You seem to be using an old Docker release. It will work with the latest version.

@Cogniveon
Copy link
Author

I'm not using the docker release. These are the versions of the jitsi packages I have installed.

dpkg -l | grep jitsi
ii  jitsi-meet                         2.0.8719-1                        all          WebRTC JavaScript video conferences
ii  jitsi-meet-prosody                 1.0.7322-1                        all          Prosody configuration for Jitsi Meet
ii  jitsi-meet-turnserver              1.0.7322-1                        all          Configures coturn to be used with Jitsi Meet
ii  jitsi-meet-web                     1.0.7322-1                        all          WebRTC JavaScript video conferences
ii  jitsi-meet-web-config              1.0.7322-1                        all          Configuration for web serving of Jitsi Meet
ii  jitsi-videobridge2                 2.3-25-g1da507fa-1                all          WebRTC compatible Selective Forwarding Unit (SFU)

@saghul
Copy link
Member

saghul commented Jul 13, 2023

Can you try to use the default config? Yours is heavily edited.

@Cogniveon
Copy link
Author

Cogniveon commented Jul 13, 2023

I tried with the following simplified config.

var config = {
    hosts: {
        domain: 'example.com',
        muc: 'conference.<!--# echo var="subdomain" default="" -->example.com'
    },

    // BOSH URL. FIXME: use XEP-0156 to discover it.
    bosh: '//example.com/http-bind',

    testing: {
    },
    p2p: {
        enabled: true,
        stunServers: [

            // { urls: 'stun:example.com:3478' },
            { urls: 'stun:meet-jit-si-turnrelay.jitsi.net:443' }
        ]
    },
};

// Temporary backwards compatibility with old mobile clients.
config.flags = config.flags || {};
config.flags.sourceNameSignaling = true;
config.flags.sendMultipleVideoStreams = true;
config.flags.receiveMultipleVideoStreams = true;

Still the same error when trying to screenshare from MacOS.. other functionalities working fine

VM381 lib-jitsi-meet.min.js:2 2023-07-13T06:41:28.883Z [JitsiMeetJS.ts] <Object.getGlobalOnErrorHandler>:  UnhandledError: Cannot add second video track to the conference Script: null Line: null Column: null StackTrace:  Error: Cannot add second video track to the conference
    at uh.addTrack (https://**************/libs/lib-jitsi-meet.min.js?v=7322:2:774472)
...........
.........
.....
 
JitsiConference.js:1160 Uncaught (in promise) Error: Cannot add second video track to the conference
    at uh.addTrack (JitsiConference.js:1160)

@saghul
Copy link
Member

saghul commented Jul 13, 2023

Can you check all the video types here? && !localTracks.find(t => t.getVideoType() === track.getVideoType())) {

@saghul
Copy link
Member

saghul commented Jul 13, 2023

Looks like somehow both tracks are detected as either camera tracks or screen tracks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants