Bug 224161 - Broken transition when video player with MediaStream changes size
Summary: Broken transition when video player with MediaStream changes size
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 10.15
: P2 Critical
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-03 14:46 PDT by Serj Lavrin
Modified: 2021-04-08 11:17 PDT (History)
12 users (show)

See Also:


Attachments
Patch (1.85 KB, patch)
2021-04-08 02:39 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (1.92 KB, patch)
2021-04-08 02:42 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Serj Lavrin 2021-04-03 14:46:03 PDT
Reproduction:

1. Create video player element
2. Assign CSS transition to that element
2. Assign captured user media stream to that element
3. Change width and height of the element

What happens:

Video transitions are not smooth. Video mid-transition appears to be jerky, and sometimes black background being exposed.


What expected:

The transition should be smooth.



Additional info:


This demo reproduces this bug in Safari 14 on macOS

https://jsfiddle.net/ArmorDarks/enrL02yx/35/

1. Load the demo
2. Wait for predefined video to load
3. Click a few times the "Toggle video size" button - video will smoothly resize without any issues
4. Click "Start camera stream". It will request you camera stream and assign it to the same video player
5. Try the "Toggle video size" button again - instead of a smooth transition, the video will "jump" mid-transition and expose black background sometimes

Here's the recording of the reproduction:
https://www.dropbox.com/s/kcbse6bv18ri1og/Screen%20Recording%202021-04-04%20at%2000.36.15.mov?dl=0

It seems to be more prominent in heavier applications. For instance, this recording uses exactly the same positioning, but produces a much worse transition:
https://www.dropbox.com/s/mjgqzd4al175f8r/Screen%20Recording%202021-04-04%20at%2000.37.44.mov?dl=0

This case is quite common for modern web-based streaming solutions, like Restream Studio, which are using transitions on video element with a user's captured video to smoothly switch between different layouts. There seems to be no way to workaround that issue.
Comment 1 Smoley 2021-04-07 14:39:18 PDT
This does not reproduce for me on Safari 13.1.2, I can reproduce this on Safari 14.0.1 as well as TOT 14.2.
Comment 2 Radar WebKit Bug Importer 2021-04-07 14:39:28 PDT
<rdar://problem/76366061>
Comment 3 youenn fablet 2021-04-08 02:39:30 PDT
Created attachment 425486 [details]
Patch
Comment 4 youenn fablet 2021-04-08 02:42:39 PDT
Created attachment 425488 [details]
Patch
Comment 5 EWS 2021-04-08 09:04:32 PDT
commit-queue failed to commit attachment 425488 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 6 EWS 2021-04-08 11:17:37 PDT
Committed r275662 (236298@main): <https://commits.webkit.org/236298@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425488 [details].