getUserMedia() incorrectly emit 'devicechange' listener

When I test getUserMedia() API in iOS, it incorrectly emit 'devicechange' listener.
And I call getUserMedia() again in my web app, it will cause infinite 'devicechange' listener loop.
It's ok in Chrome or PC Browser.

Environment: iPhone 15 Pro Max (iOS 18.5, Safari)
Reference: WebKit Bug #295888

  1. Click the Request Audio Stream button
  2. The 'devicechange' listener will be triggered (I logged it below)
  3. And also can test video stream
  4. The 'devicechange' listener will be triggered too, but it's not infinite loop.

screen recording: audio.MP4 video.MP4