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

feat(share-tab-audio): Add share audio flag on desktop share. #1732

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tudor-phd
Copy link

No description provided.

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@damencho
Copy link
Member

Jenkins add to whitelist.

@jallamsetty1
Copy link
Member

@tudor-phd What happens when the audio constraint is set to false for getDisplayMedia() ? Does the share audio checkbox not show up in the screen selection dialog ? If that is the case are you planning to pass this new option set to false while creating a desktop track for virtual background ?

@tudor-phd
Copy link
Author

@tudor-phd What happens when the audio constraint is set to false for getDisplayMedia() ? Does the share audio checkbox not show up in the screen selection dialog ? If that is the case are you planning to pass this new option set to false while creating a desktop track for virtual background ?

Yes and yes
Screenshot 2021-09-29 at 18 22 09
.

@tudor-phd
Copy link
Author

@tudor-phd What happens when the audio constraint is set to false for getDisplayMedia() ? Does the share audio checkbox not show up in the screen selection dialog ? If that is the case are you planning to pass this new option set to false while creating a desktop track for virtual background ?

Also if the value will be undefined/not specified it will be ignored and set to true by default. The remaining cases are setting to: true / false
Example of use:
Screenshot 2021-09-30 at 09 12 40
Screenshot 2021-09-30 at 09 13 13
:

Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment.

const video = typeof desktopSharingFrameRate === 'object' ? { frameRate: desktopSharingFrameRate } : true;
const audio = this._getAudioConstraints();
// eslint-disable-next-line no-negated-condition
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reverse this instead of disabling the eslint rule.

JitsiMeetJS.js Outdated
const firePermissionPrompt = firePermissionPromptIsShownEvent || oldfirePermissionPromptIsShownEvent;

if (typeof desktopSharingAudio !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary here? IIRC we initialize it in RTC.js already.

Copy link
Author

@tudor-phd tudor-phd Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that in RTCUtils.js we call screenObtainer.init(options); -> but looks like we pass all options at the start -> then we want to change an option. This is the reason that I call again screenObtainer.init(options); with the new desktopSharingAudio option. @jallamsetty1 What do you think about this? Looks fine for you or would you have another approach to fix this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean that once someone sets their desktop as virtual background, the audio share option will no longer be available for subsequent screenshares and audio-only shares ?

Copy link
Author

@tudor-phd tudor-phd Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Already tested that. For example, I tried to apply the option just on the virtual background. Worked. After that, I wanted to test this case that you specified and I clicked the screen share option from the bottom toolbar to see the behavior on browser tab sharing. The audio share checkbox was there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should find a better way or workaround for this change in Chrome's behavior where the audio share gets checked by default whenever audio is requested as this affects regular screenshare as well.

@jallamsetty1
Copy link
Member

@tudor-phd Is it possible to ignore the audio track here when the desktop track is being used for virtual background ?

@tudor-phd
Copy link
Author

@tudor-phd Is it possible to ignore the audio track here when the desktop track is being used for virtual background ?

Already tried to do that with the flag that I created. Is not working. Same reason like here: #1732 (comment)

if (virtualBackgroundSharing) {
screenObtainer.virtualBackgroundSharing = true;
} else {
screenObtainer.virtualBackgroundSharing = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: screenObtainer.virtualBackgroundSharing = virtualBackgroundSharing ?? false

@jallamsetty1
Copy link
Member

@tudor-phd this LGTM with an optional suggestion.

@saghul
Copy link
Member

saghul commented Oct 12, 2021

I won't block this PR because Jaya approved it, but I will state my strong -1.

That option bears no meaning in lib-jitsi-meet. Virtual backgrounds are part of JM, all this library needs to offer is a way for the user of the API to specify some audio constraints.

As it stands it's a leaky abstraction.

If we come up with another case which needs audio sharing disabled (maybe presenter mode?) the flag name would be even more confusing.

@jallamsetty1
Copy link
Member

I won't block this PR because Jaya approved it, but I will state my strong -1.

That option bears no meaning in lib-jitsi-meet. Virtual backgrounds are part of JM, all this library needs to offer is a way for the user of the API to specify some audio constraints.

As it stands it's a leaky abstraction.

If we come up with another case which needs audio sharing disabled (maybe presenter mode?) the flag name would be even more confusing.

In that case, can we make "audio: false" the default constraints and pass option (shareDesktopAudio or something similar) for explicitly enabling it ?

@saghul
Copy link
Member

saghul commented Oct 13, 2021

I won't block this PR because Jaya approved it, but I will state my strong -1.

That option bears no meaning in lib-jitsi-meet. Virtual backgrounds are part of JM, all this library needs to offer is a way for the user of the API to specify some audio constraints.

As it stands it's a leaky abstraction.

If we come up with another case which needs audio sharing disabled (maybe presenter mode?) the flag name would be even more confusing.

In that case, can we make "audio: false" the default constraints and pass option (shareDesktopAudio or something similar) for explicitly enabling it ?

This is exactly how this should be implemented IMHO.

@sapkra sapkra added the feature-request Issue is really a feature request label Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Issue is really a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants