Bug 273938
Summary: | getUserMedia camera stream does not work in PWA on some devices | ||
---|---|---|---|
Product: | WebKit | Reporter: | tombauer345 |
Component: | WebRTC | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | cillian.escobar, eric.carlson, g.cacchione, jer.noble, kvcrawford, thorsten, webkit-bug-importer, youennf |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 17 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 17 |
tombauer345
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/127821430>
youenn fablet
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
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
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
(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
Still persistent in iOS 17.6.1
Cillian
iOS 18 public Beta 5 has this resolved. Working without any flaws. :-)