[Webkit-unassigned] [Bug 195093] Safari 12.1 : Issue with navigator.mediaDevices.enumerateDevices

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 27 09:36:50 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=195093

--- Comment #1 from youenn fablet <youennf at gmail.com> ---
Hi Pradeep,

You are right.
We changed a bit our fingerprinting enumerateDevices mitigation.
I would be interested in your feedback there.

Device IDs should now remain stable after getUserMedia is granted even after page reload.
The device IDs will only be communicated after getUserMedia being granted.
That should allow picking the same device as previously as follows:

let stream;
let deviceId = window.localStorage.getItem('preferredMicrophoneId');
const constraint = deviceId ? {audio : {deviceId: {exact: deviceId}}} : {audio: true};
try {
    stream = await navigator.mediaDevices.getUserMedia(constraint);
} catch (e) {
   // In case of overconstrainederror, call getUserMedia({audio: true})
}
deviceId = stream.getAudioTracks()[0].getSettings().deviceId;
window.localStorage.setItem('preferredMicrophoneId', deviceId);

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190227/9ac40acf/attachment.html>


More information about the webkit-unassigned mailing list