Bug 173081 - navigator.mediaDevices should be instance of EventTarget
Summary: navigator.mediaDevices should be instance of EventTarget
Status: RESOLVED DUPLICATE of bug 187575
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-06-07 15:52 PDT by Stefan Fochler
Modified: 2021-03-16 19:26 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Fochler 2017-06-07 15:52:34 PDT
Overview:
navigator.mediaDevices does not implement EventTarget, although the current Media Capture specification draft states (in the WebIDL section below https://w3c.github.io/mediacapture-main/#mediadevices), that MediaDevices and thus navigator.mediaDevices inherits from the EventTarget.

Steps to Reproduce:
1. Open the Web Inspector on any page
2. Try using the EventTarget's methods (addEventListener...) on navigator.mediaDevices

Actual Result:
The desired methods are not available. navigator.mediaDevices instanceof EventTarget === false

Expected Result:
One can use addEventListener and removeEventListener to listen for the "devicechange" event.

Build Date & Hardware:
Safari TP 33 on macOS 10.12.5
Comment 1 Radar WebKit Bug Importer 2017-06-08 21:46:03 PDT
<rdar://problem/32666694>
Comment 2 Alexey Shvayka 2021-03-16 19:26:50 PDT
r233761 fixed `navigator.mediaDevices` to extend EventTarget.

*** This bug has been marked as a duplicate of bug 187575 ***