Bug 230819 - applyConstraints throws OverconstrainedError if specify exact for deviceId
Summary: applyConstraints throws OverconstrainedError if specify exact for deviceId
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: youenn fablet
Keywords: InRadar
Depends on:
Reported: 2021-09-26 23:19 PDT by Trung Le
Modified: 2021-09-28 09:35 PDT (History)
11 users (show)

See Also:

Patch (5.54 KB, patch)
2021-09-28 07:13 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 Trung Le 2021-09-26 23:19:56 PDT
It seems in the latest Safari 15.0, calling applyConstraints for a video media stream track with exact for deviceId will results in OverconstrainedError - Constraint not supported. This works in Safari 14.
Comment 1 Kevin Neal 2021-09-27 09:41:57 PDT
Thanks for filing. Please attach a file, or link to a demo, that documents the bug.
Comment 2 Radar WebKit Bug Importer 2021-09-27 09:42:10 PDT
Comment 3 Trung Le 2021-09-27 10:08:57 PDT
I have been able to reproduce this issue with just use navigator.mediaDevices.getUserMedia() and applyConstraints() API.
Repo steps:

- Call stream = navigator.mediaDevices.getUserMedia({ video: { deviceId: { exact: <deviceId string> }}}); <- exact here works.
- Call stream.getVideoTracks()[0].applyConstraints({ deviceId: { exact: <deviceId string> }}); <- throw OverconstrainedError error in Safari 15 but not Safari 14.
Comment 4 youenn fablet 2021-09-28 07:09:44 PDT
Thanks for the report, I'll fix it soon but would like to understand the impact for your application.
Comment 5 youenn fablet 2021-09-28 07:13:20 PDT
Created attachment 439472 [details]
Comment 6 EWS 2021-09-28 09:20:34 PDT
Committed r283173 (242221@main): <https://commits.webkit.org/242221@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439472 [details].
Comment 7 Trung Le 2021-09-28 09:35:37 PDT
Thanks. That was quick. This completely breaks our video filter when we try to apply video constraints.
Will this be released in the next Safari patch version?