Bug 219643

Summary: applyConstraints() should update track correctly when no constraints passed at first
Product: WebKit Reporter: Daria <dari.zielinska>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Major CC: webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac   
OS: macOS 10.15   

Description Daria 2020-12-08 07:02:56 PST
Function applyConstraints() does not work as expected.

Where? 
- issue is only reproduced on Mac"16 (and probably on iOS.14 but needs to be check)
- only on Safari - works on other browsers

How?

Steps to reproduce:

1. Start video without any constraints.
2. Then try to apply new constraints (1080x720) using applyConstraints()
(it is easy to reproduce using https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API/Constraints - at the bottom there is box with example so when video is started with empty object and then user tries to apply new constraints - camera starts blinking, there is black screen and then camera is off).

Expected result:

Constraints are applied properly and camera is on.

Actual result:

Error - "A MediaStreamTrack ended due to a capture failure"
Camera starts blinking, then video went black and camera is off. 

Additional thoughts: when user applies width: 600 and height: 400 it is working well.
Comment 1 Radar WebKit Bug Importer 2020-12-08 07:11:02 PST
<rdar://problem/72091581>
Comment 2 youenn fablet 2020-12-08 07:12:13 PST
I would hope this is fixed in latest Safari Tech Preview.
The issue might be that the change of preset takes more than 3 seconds, which is quite long and WebKit then assumes the capture failed.
Comment 3 Radar WebKit Bug Importer 2020-12-08 07:12:22 PST
<rdar://problem/72091622>
Comment 4 youenn fablet 2021-07-06 04:34:30 PDT
Closing, @Daria, please reopen if you can reproduce the issue.