aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
709 stars 477 forks source link

Zoomed in effect when Simulcast is enabled #2844

Closed zepedr0 closed 6 months ago

zepedr0 commented 7 months ago

What happened and what did you expect to happen?

If I set enableSimulcastForUnifiedPlanChromiumBasedBrowsers as true in the MeetingSessionConfiguration, my camera loads with a zoomed in effect.

Have you reviewed our existing documentation?

Reproduction steps

This is possible to reproduce in the demo application, but I think it is only happening with M2 macbooks. Make sure to set configuration.enableSimulcastForUnifiedPlanChromiumBasedBrowsers = true (if simulcast is enabled in the frontend options it does not work, it should be hardcoded as true), and that your camera is not active anywhere else (green light is turned off). After joining the meeting and turning on the camera the image should start zoomed in (if it doesn't, turn the video off, wait for the green light to turn off, and the start the video on again).

Issue seems related to the Facetime camera recording in a vertical mode:

Screenshot 2024-02-19 at 16 49 27

Instead of the standard horizontal mode:

Screenshot 2024-02-19 at 16 50 23

Amazon Chime SDK for JavaScript version

amazon-chime-sdk-js@3.20.0

What browsers are you seeing the problem on?

Chrome

Browser version

Version 121.0.6167.160 (Official Build) (arm64)

Meeting and Attendee ID Information.

No response

Browser console logs

localhost-1708358470439.log

hensmi-amazon commented 7 months ago

Thanks for the report! I was able to reproduce this with an M2 laptop, seems to be some unwanted interaction with the built in camera when we set media constraints. I will have a fix in the next release, but given that will not be too soon, you can mitigate this issue with code like the following:

    if (new DefaultBrowserBehavior().hasChromiumWebRTC()) {
        configuration.videoUplinkBandwidthPolicy = new DefaultSimulcastUplinkPolicy(
            configuration.credentials.attendeeId,
            this.meetingLogger
          );
        configuration.videoUplinkBandwidthPolicy.chooseMediaTrackConstraints = (): MediaTrackConstraints => {
            const trackConstraint: MediaTrackConstraints = {
              width: { ideal: 1280 },
              height: { ideal: 720 },
              frameRate: { ideal: 15 },
            };
            return trackConstraint;
          }
      }

      this.meetingSession = new DefaultMeetingSession(
         configuration,
         this.meetingLogger,
         this.deviceController,
         new DefaultEventController(configuration, this.meetingLogger, this.eventReporter)
     );
zepedr0 commented 7 months ago

Thank you for looking into this so fast! That workaround seems to have fixed our issue for now 🙌

hensmi-amazon commented 6 months ago

Latest version is released, closing