aws / amazon-chime-sdk-js

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

Block background throttling of video processing #2746

Closed hunnorth closed 11 months ago

hunnorth commented 11 months ago

Issue #:

Description of changes: Frames per second of video stream was being processed on the main thread using setTimeout. However, when a meeting window gets moved into the background, the main thread timer used in setTimeout gets throttled and the fps drops dramatically. To overcome this issue, this PR will move the setTimeout call into a worker thread that does not get throttled.

Testing:

Can these tested using a demo application? Please provide reproducible step-by-step instructions. Yes, start a meeting with at least one other attendee. Enable a video filtered and then hide the window (switch tabs). The other attendee should then observe no fps degradation in filter-enabled attendee.

Checklist:

  1. Have you successfully run npm run build:release locally? yes

  2. Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved? no

  3. Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved? no

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.