Skip to content

Conversation

@utkaka
Copy link
Contributor

@utkaka utkaka commented Aug 26, 2025

  • Some browsers (for example, Firefox) return the permissions granted status, but all device IDs in the list are empty, which means that you need to request permissions again
  • Some browsers (again, Firefox) request separate permissions for each device, which leads to a series of separate pop-ups during the start of the call. If we are absolutely sure that the user will use both the camera and the microphone, then we can request permissions in one pop-up.
  • When requesting permissions, browsers offer the user a choice of the desired device. This choice must be taken into account. In this case, the device that the user selected within the platform (if selected) must be offered as the default device.
  • During an active session, the selected device may become unavailable and we can no longer use it. In this case, we need to get the list of active devices again and, if necessary, request permissions from the user.

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>
@huly-github-staging
Copy link

Connected to Huly®: UBERF-13282

@utkaka utkaka marked this pull request as ready for review August 26, 2025 07:44
@utkaka utkaka requested a review from Copilot August 26, 2025 09:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the media device and permissions handling system to address browser-specific issues, particularly with Firefox. The changes centralize device management, improve permission requests, and handle device availability during active sessions.

Key changes include:

  • Replaces the enumerateDevices function with a new getMediaDevices function that handles permissions more intelligently
  • Consolidates device selection logic by removing separate getter functions and integrating them into the main media info structure
  • Updates all media-related components to use the new centralized device management approach

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
plugins/media/src/utils.ts Introduces new getMediaDevices function and MediaInfo interface, removes old enumeration logic
plugins/media-resources/src/utils.ts Removes separate device getter functions, updates useMedia to be async and use new device management
plugins/media-resources/src/components/*.svelte Updates media popup components to accept MediaInfo prop instead of fetching devices individually
plugins/love-resources/src/liveKitClient.ts Integrates new media device management into LiveKit connection flow
plugins/love-resources/src/utils.ts Removes old device management functions, updates screen sharing calls
plugins/recorder-resources/src/components/RecordingPopup.svelte Updates to use new getMediaDevices function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>
@utkaka utkaka requested a review from aonnikov August 28, 2025 06:09
@aonnikov aonnikov merged commit 2887252 into develop Aug 28, 2025
24 of 26 checks passed
@aonnikov aonnikov deleted the media-devices branch August 28, 2025 08:19
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

Successfully merging this pull request may close these issues.

3 participants