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

fix(plugin-meetings): Windows/Chrome still asks for camera permissions even when not selecting videoEnabled and shareVideoEnabled #3831

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

Parimala032
Copy link
Collaborator

@Parimala032 Parimala032 commented Sep 13, 2024

COMPLETES #< SPARK-539683 >

This pull request addresses

This pull request addresses the issue with a kitchen sink app. When the user tries to disable the videoEnabled checkbox and sharVideoEnabled checkbox, the sample app still asks for camera access. This pull request resolves this problem with the following changes:

by making the following changes

Changes have been made in the plugin-meetings where previously getDevices() was being called without considering the user's usage. Now, getDevices is being called with parameters based on the user's requests.

PR.3831.mp4

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios where tested

Tested this Pull request by

  1. uncheck the videoEnabled and shareVideoEnabled checkbox and click on joinWithMedia() button ----> ask for microphone permission
  2. uncheck the audioEnabled and shareAudioEnabled checkbox and click on joinWithMedia() button -----> ask for camera permission
  3. checked both checkboxes ----> ask for the both permissions
  4. Checked with the mid-meeting

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

@Parimala032 Parimala032 requested review from a team as code owners September 13, 2024 17:26
@Parimala032 Parimala032 added the validated If the pull request is validated for automation. label Sep 13, 2024
@Parimala032 Parimala032 changed the title fix(plugin-meetings): resloved camera prompt issue fix(plugin-meetings): resolved camera prompt issue Sep 13, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3831.d3m3l2kee0btzx.amplifyapp.com

@Parimala032 Parimala032 changed the title fix(plugin-meetings): resolved camera prompt issue fix(plugin-meetings): Windows/Chrome still asks for camera permissions even when not selecting videoEnabled and shareVideoEnabled Sep 13, 2024
const deviceKind =
(isVideoEnabled && Media.DeviceKind.VIDEO_INPUT) ||
(isAudioEnabled && Media.DeviceKind.AUDIO_INPUT) ||
undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

@mkesavan13 Im unable to understand this logic. When isVideoEnabled is false and isAudioENabled is false, then shouldnt deviceKind = undefined. And that should call getDevice(undfiened) -> which means we ask for both the permissions.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Parimala032 can answer to this. Logically that is how it is supposed to work, yes

@@ -4196,6 +4200,8 @@ describe('plugin-meetings', () => {
// and that these were the only /media requests that were sent
assert.calledTwice(locusMediaRequestStub);
assert.calledOnce(handleDeviceLoggingSpy);
assert.calledWith(handleDeviceLoggingSpy, false);

});

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add test for the following conditions

  1. Only asked for camera permission
  2. Only asked for mic permission
  3. Ask for both permissions
  4. Ask for neither permissions.

Copy link
Contributor

@sreenara sreenara left a comment

Choose a reason for hiding this comment

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

Please change the title to reflect only the change this commit is doing. The PR description can cover the rest of the details. This title is quite long.

This pull request addresses the issue with a kitchen sink app.

Isn't this an issue with the web client too?

Changes have been made in the plugin-meetings

Could we be more specific about what the changes were inside plugin meetings? I don't see anything about the function that actually had the problem.

Please also add a root cause to the PR description.

* @returns {Promise<void>}
*/
private static async handleDeviceLogging(): Promise<void> {
private static async handleDeviceLogging(
isAudioEnabled = false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to set default values for these booleans?

try {
const devices = await getDevices();
const deviceKind =
(isVideoEnabled && Media.DeviceKind.VIDEO_INPUT) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Does enabling video automatically ask for audio too?
What's the reason for undefined being present here?

Copy link
Contributor

@mkesavan13 mkesavan13 left a comment

Choose a reason for hiding this comment

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

Please address @sreenara & @Shreyas281299 comments. Meanwhile, we can have tests written and demo recorded for following cases as well,

  • Video is enabled and Audio disabled
  • Both video and audio enabled
  • Both video and audio disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validated If the pull request is validated for automation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants