8000 navigator.mediaDevices.getDisplayMedia Ignores deviceId on macOS When Capturing Virtual Displays · Issue #1794 · flutter-webrtc/flutter-webrtc · GitHub
[go: up one dir, main page]

Skip to content
navigator.mediaDevices.getDisplayMedia Ignores deviceId on macOS When Capturing Virtual Displays #1794
Open
@ygalbrami

Description

@ygalbrami

Describe the bug

navigator.mediaDevices.getDisplayMedia ignores the deviceId parameter on macOS when attempting to capture a virtual display created with flutter_virtual_display. Despite desktopCapturer.getSources correctly identifying the virtual display and the application correctly passing the deviceId, the capture defaults to the primary display. Native logs indicate start desktop capture: sourceId: (null).

To Reproduce

  1. Set up a Flutter project with flutter_webrtc and flutter_virtual_display.
  2. Use flutter_virtual_display.createDisplay to create a virtual display.
  3. Use desktopCapturer.getSources to retrieve a list of available screen sources.
  4. Verify the virtual display's id is present in the list.
  5. Call navigator.mediaDevices.getDisplayMedia with the deviceId set to the virtual display's id.
  6. Observe that the captured stream is from the primary display, not the virtual display.
  7. Check the native logs and observe start desktop capture: sourceId: (null).

Expected behavior

navigator.mediaDevices.getDisplayMedia should use the provided deviceId to capture the specified virtual display.

Platform information

  • **Flutter version: 3.29.2 * **
    Plugin version: 0.12.12+hotfix.1
    macOS: 13.7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0