WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
204106
Calling getUserMedia multiple times in same tab can cause NotReadableError
https://bugs.webkit.org/show_bug.cgi?id=204106
Summary
Calling getUserMedia multiple times in same tab can cause NotReadableError
Dag-Inge Aas
Reported
2019-11-12 01:20:08 PST
Created
attachment 383343
[details]
Screenshot showing the issue on an iPhone X running iOS 13.2 Summary: Calling getUserMedia multiple times on the same page (after stopping the tracks of the original getUserMedia stream) can cause getUserMedia to fail with NotReadableError. After this the tab is broken for further usages of getUserMedia and Safari must be restarted to fix the issue. This bug only impacts iOS. Steps to reproduce: 1. Go to
https://codepen.io/daginge/full/bGGxboP
on an iPhone running iOS 13.2 2. Tap: "Click me to start testing" 3. Let the test run for about a minute or until it fails, whatever comes first. 4. Observe "NotReadableError" 5. Observe that subsequent clicks to "Click me to start testing" still fails with NotReadableError. 6. Restart Safari 7. Click "Click me to start testing". 8. Observe that getUserMedia now works again. It can also be observed that once the call fails with NotReadableError and the user goes to the home screen, the "capturing" icon is visible. The webapp cannot stop capturing at this point, and the user believes the page is listening in on calls. ONly way to fix this is to close the tab or kill Safari. I have been able to reproduce this with timeouts between calls of up to 20 seconds. However, testing this with timeout 0 it does not seem to trigger the issue. I suspect this issue might have something to do with how Safari on iOS cleans up media access. See also attached image. Impact: All services requiring the use of subsequent getUserMedia calls. Keeping the getUserMedia stream around when you don't need it (for example in an application looking to do many subsequent calls without reloading the page) is bad UX, drains the battery, and makes the user believe you are listening when you aren't. Workaround: Don't kill the stream, keep it around forever. It's yours now.
Attachments
Screenshot showing the issue on an iPhone X running iOS 13.2
(383.59 KB, image/png)
2019-11-12 01:20 PST
,
Dag-Inge Aas
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Chad Phillips
Comment 1
2019-11-12 14:40:56 PST
I wonder if this is related to
https://bugs.webkit.org/show_bug.cgi?id=179363
Radar WebKit Bug Importer
Comment 2
2019-11-18 00:27:28 PST
<
rdar://problem/57274619
>
youenn fablet
Comment 3
2019-11-18 00:49:46 PST
It might be that
https://bugs.webkit.org/show_bug.cgi?id=201638
fixes this issue. When reproing the issue, we could look at whether there is a sandbox violation happening in the console log.
Dag-Inge Aas
Comment 4
2019-11-18 01:46:44 PST
Thanks, I'll follow that patch! How will I know when a Safari for iOS build is out so I can test it?
Dag-Inge Aas
Comment 5
2019-12-16 02:16:27 PST
Re-tested this on iOS 13.3 now. No errors in console.log hinting at any sandbox violation when this happens. Is there some debug log I'm missing here?
Dag-Inge Aas
Comment 6
2020-01-22 02:16:32 PST
Continued high error rates for this bug. I can reproduce it quite reliably. Any updates on a fix for this? Anything we can do to help the process?
youenn fablet
Comment 7
2020-03-13 02:20:22 PDT
Hi Daginge, Have you tried the latest iOS 13.4 seed?
Dag-Inge Aas
Comment 8
2020-03-14 04:37:38 PDT
Could not reproduce on latest iOS 13.4 seed as of today. Is there any timeline until release?
youenn fablet
Comment 9
2020-03-23 01:12:05 PDT
Closing now, please reopen if you still see the issue.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug