Bug 295887

Summary: (iOS) getUserMedia() incorrectly emit 'devicechange' listener
Product: WebKit Reporter: Ronan Chi <wbxl2000>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Critical    
Priority: P2    
Version: Safari 18   
Hardware: iPhone / iPad   
OS: iOS 18   

Ronan Chi
Reported 2025-07-14 06:51:46 PDT
When I test getUserMedia() API in iOS, it incorrectly emit 'devicechange' listener. And I call getUserMedia() again in my web app, it will cause <strong>infinite</strong> 'devicechange' listener loop. It's ok in Chrome or PC Browser. Online Link: https://bug.qer.im/ios-getUserMedia-incorrectly-emit-devicechange-listener/index.html ```js navigator.mediaDevices.addEventListener('devicechange', () => { requestDevice(); }); async function requestDevice() { log('log', 'getUserMedia'); const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); stream.getTracks().forEach(track => { track.stop(); }); } requestDevice(); ```
Attachments
Ronan Chi
Comment 1 2025-07-14 06:55:35 PDT
*** This bug has been marked as a duplicate of bug 295888 ***
Note You need to log in before you can comment on or make changes to this bug.