Bug 216641 - Add support for speaker selection
Summary: Add support for speaker selection
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
: 179415 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-17 02:51 PDT by youenn fablet
Modified: 2024-04-10 19:27 PDT (History)
36 users (show)

See Also:


Attachments
WIP (67.94 KB, patch)
2020-09-17 03:10 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
WIP (68.40 KB, patch)
2020-09-17 04:44 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP (74.38 KB, patch)
2020-09-17 05:07 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP (75.77 KB, patch)
2020-09-17 05:34 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP (75.92 KB, patch)
2020-09-17 06:16 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP (75.89 KB, patch)
2020-09-17 06:37 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP (75.92 KB, patch)
2020-09-17 06:47 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2020-09-17 02:51:10 PDT
Add support for speaker selection
Comment 1 youenn fablet 2020-09-17 03:10:55 PDT
Created attachment 409016 [details]
WIP
Comment 2 youenn fablet 2020-09-17 04:44:08 PDT
Created attachment 409022 [details]
WIP
Comment 3 youenn fablet 2020-09-17 05:07:51 PDT
Created attachment 409024 [details]
WIP
Comment 4 youenn fablet 2020-09-17 05:34:36 PDT
Created attachment 409025 [details]
WIP
Comment 5 youenn fablet 2020-09-17 06:16:03 PDT
Created attachment 409027 [details]
WIP
Comment 6 youenn fablet 2020-09-17 06:37:05 PDT
Created attachment 409029 [details]
WIP
Comment 7 youenn fablet 2020-09-17 06:47:42 PDT
Created attachment 409030 [details]
WIP
Comment 8 youenn fablet 2020-09-18 05:19:25 PDT
*** Bug 179415 has been marked as a duplicate of this bug. ***
Comment 9 Eric Carlson 2020-09-18 10:47:59 PDT
Comment on attachment 409030 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=409030&action=review

> Source/WebCore/ChangeLog:8
> +        https://bugs.webkit.org/show_bug.cgi?id=216641
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        MediaDevices now receive non hashed device IDs.

I think it would be a good idea to point to the spec here.

> Source/WebCore/ChangeLog:9
> +        We hash them before exposing them and keep a mapping in WebProcess between hashed audoi output device Ids and the persistent Ids.

s/audoi/audio/

> Source/WebCore/ChangeLog:21
> +        All these methods can be used based on user gesture.

This is unclear, it makes it sound like they are optionally gated on a user gesture.

> Source/WebCore/Modules/mediastream/MediaDevices.cpp:227
> +        auto groupId = RealtimeMediaSourceCenter::singleton().hashStringWithSalt(newDevice.groupId(), m_groupIdHashSalt);

All of the capture classes should now set supportedConstraints.setSupportsGroupId(true) so MediaTrackSupportedConstraints.groupId returns `true`

> Source/WebCore/Modules/mediastream/MediaDevices.cpp:356
> +    document->topDocument().setDefaultAudioOutputDeviceId(WTFMove(persistentId));
> +    m_audioOutputDeviceId = WTFMove(deviceId);

It might be better to swap the order of these lines in case a side effect of calling setDefaultAudioOutputDeviceId checks audioOutputDevice()
Comment 10 Radar WebKit Bug Importer 2020-09-24 02:52:16 PDT
<rdar://problem/69491182>
Comment 11 Jovan Chohan 2021-08-27 11:35:21 PDT
Is there any timeline for this feature support?
Comment 12 David P 2022-07-10 17:15:10 PDT
Support for setSinkId is listed for Safari Tech Preview release 148 at https://developer.apple.com/safari/technology-preview/release-notes/ and it seems the current release is 136 https://webkit.org/blog/category/safari-technology-preview/page/2/

So should this issue have a status other than New?
Comment 13 Olivier Anguenot 2023-03-01 12:13:31 PST
Hi,
any news about this feature ?

Thanks i advance
Comment 14 Karl Dubost 2023-03-19 17:36:18 PDT
https://wpt.fyi/results/audio-output/idlharness.https.window.html
https://wpt.live/audio-output/idlharness.https.window.html

Activating on STP Allow speaker device selection in Experimental features makes 3 more tests green. 

The 3 remaining are

* MediaDevices interface: operation selectAudioOutput(optional AudioOutputOptions)	
* MediaDevices interface: navigator.mediaDevices must inherit property "selectAudioOutput(optional AudioOutputOptions)" with the proper type	
* MediaDevices interface: calling selectAudioOutput(optional AudioOutputOptions) on navigator.mediaDevices with too few arguments must throw TypeError
Comment 15 Karl Dubost 2023-03-19 17:38:54 PDT
It also improves the results on
https://wpt.live/audio-output/setSinkId-permissions-policy.https.sub.html
Comment 16 Michael Hagar 2024-01-24 07:33:07 PST
Any update on this?