Skip to content
Commit e3567fa7 authored by Daniel Calviño Sánchez's avatar Daniel Calviño Sánchez
Browse files

Fix video zoom jump with background blur when changing resolution



The input track is played in a video element which, in turn, is drawn on
the canvas used to calculate the segmentation mask and on the output
canvas. When the resolution of its input track changes a video element
may still play the track using the old resolution for some frames (it
happens with real hardware cameras, although apparently not with virtual
devices), even if "track.getSettings()" already returns the new
resolution.

Due to this mismatch, when the resolution of the input track changed
(for example, due to a quality change in a call with several
participants), the video could zoom in and out, as the output canvas
size was based on the new size, while the video element drawn on it was
still using the old size.

Fortunately, the "videoWidth" and "videoHeight" attributes of the video
element seem to reflect the actual size of the video being played, so
those values can be used to do the calculations instead of relying on
the expected video size.

Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
parent 2157aa8b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment