NEW 273938
getUserMedia camera stream does not work in PWA on some devices
https://bugs.webkit.org/show_bug.cgi?id=273938
Summary getUserMedia camera stream does not work in PWA on some devices
tombauer345
Reported 2024-05-09 05:19:38 PDT
When in the manifest.json display is standalone/fullscreen the camera stream does not work and only sends the loadstart progress and suspend events after added to the homescreen. In the browser it works fine and sends all expected events. I have an iphone 15 pro and with ios 17.4.1. It for some reason works on the same website when using an iphone 11 pro also on ios 17.4.1. The devices have the exact same safari settings. Also no errors are thrown in either setup. I've tried to clear all safari data and website data but the bug remains. Any ideas or is this an actual webkit bug? I think it was once a bug a few years ago maybe it came back? I didn't have any issues prior to the newest ios verison. my code setup: <html> <head> <link rel="manifest" href="manifest.json"> </head> <body>S <video id="video" width="200" height="200" autoplay playsinline muted></video> <script> const video = document.getElementById('video'); const events = [ 'play', 'waiting', 'loadstart', 'progress', 'suspend', 'durationchange', 'loadedmetadata', 'loadeddata', 'canplay', 'playing', 'canplaythrough', 'timeupdate' ]; events.forEach(e => { video.addEventListener(e, () => { console.log(`${e} event fired`); }); }); if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment' }}) .then(function(stream) { video.srcObject = stream; video.onloadedmetadata = () => { video.play(); }; }) .catch(function(error) { console.log("Something went wrong!", error); }); } </script> </body> </html> manifest.json : { "name": "Test App", "display": "standalone" //or fullscreen does not matter. }
Attachments
Radar WebKit Bug Importer
Comment 1 2024-05-09 10:27:33 PDT
youenn fablet
Comment 2 2024-05-14 23:41:11 PDT
Is it the same as https://bugs.webkit.org/show_bug.cgi?id=273046, which is fixed in iOS 17.5? @tombauer345, can you try iOS 17.5 as well?
tombauer345
Comment 3 2024-05-14 23:43:40 PDT
Well I‘m sorry but I decided to backup the phone and reset it. That worked. I am still on 17.4.1 and will update now
Gio Cacchione
Comment 4 2024-06-14 07:08:49 PDT
It seems the bug is occurring again on iOS 17.5.1 Everything was working fine on 17.5 but started seeing issues again after the update to 17.5.1
tombauer345
Comment 5 2024-06-26 14:50:31 PDT
(In reply to Gio Cacchione from comment #4) > It seems the bug is occurring again on iOS 17.5.1 > > Everything was working fine on 17.5 but started seeing issues again after > the update to 17.5.1 Same here... really annoying.
Cillian
Comment 6 2024-08-21 02:49:08 PDT
Still persistent in iOS 17.6.1
Cillian
Comment 7 2024-08-24 05:13:45 PDT
iOS 18 public Beta 5 has this resolved. Working without any flaws. :-)
Note You need to log in before you can comment on or make changes to this bug.