Bug 207191

Summary: Align getDisplayMedia() with spec
Product: WebKit Reporter: Alex Bakoushin <alex>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, cdumez, commit-queue, eric.carlson, esprehn+autocc, ews-watchlist, glenn, hta, jer.noble, kondapallykalyan, philipj, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Alex Bakoushin 2020-02-04 02:02:44 PST
Currently, calling navigator.mediaDevices.getDisplayMedia() with no parameters throws a TypeError.

But according to the spec, the first and only parameter is optional.
See: https://www.w3.org/TR/screen-capture/#mediadevices-additions

Also, according to the spec, the first parameter type is DisplayMediaStreamConstraints, which defaults to:
{
  video = true;
  audio = false;
}
See: https://www.w3.org/TR/screen-capture/#dom-displaymediastreamconstraints

Expected behavior:
Calling getDisplayMedia() with no parameters will not throw an error, but will use the defaults of DisplayMediaStreamConstraints.
Comment 1 Radar WebKit Bug Importer 2020-02-04 09:12:42 PST
<rdar://problem/59151017>
Comment 2 youenn fablet 2020-02-07 07:09:15 PST
Created attachment 390083 [details]
Patch
Comment 3 WebKit Commit Bot 2020-02-07 10:41:47 PST
Comment on attachment 390083 [details]
Patch

Clearing flags on attachment: 390083

Committed r256034: <https://trac.webkit.org/changeset/256034>
Comment 4 WebKit Commit Bot 2020-02-07 10:41:49 PST
All reviewed patches have been landed.  Closing bug.