[Webkit-unassigned] [Bug 259304] In WKWebView, getUserMedia API calls fail with the message "The operation was aborted." in pages loaded at capacitor://localhost:8080
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jul 26 03:13:55 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=259304
--- Comment #3 from ShivaSantoshT <shivasantosh01 at gmail.com> ---
Hi Team,
In iOS 16 versions, we are not getting permission prompts for the Camera or Microphone when accessing the getUserMedia API on a page with the domain capacitor://localhost:8080.
I have added both Camera and Microphone permissions in the info.plist file of the application.
Privacy - Microphone Usage Description
Privacy - Camera Usage Description
For the below code, we are encountering an abort error with code-20, name-AbortError, and the message 'The operation was aborted.'
Html file
<video autoplay playsinline id="videoElement"></video>
homepage.ts code-
import { AfterViewInit, Component } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage implements AfterViewInit{
constructor() {}
ngAfterViewInit(): void {
let video: any = document.querySelector("#videoElement");
navigator.mediaDevices.getUserMedia({ video: true, audio:true })
.then((stream) => {
video.srcObject = stream;
video.play();
})
.catch( (e) => {
// eslint-disable-next-line no-console
console.log("Something went wrong!" + e.message);
});
}
}
Please find below the link for the sample code published in the public Git repo-
https://github.com/TShivaSantosh/ionic-sample-app-camera-issue
Steps to reproduce-
Download the project from the link above.
Run 'npm install' inside the folder.
Run the sample app on an iOS 16 device.
Launch the application.
Camera and Microphone permissions should be requested, and the preview should be displayed inside the video element on the HTML page.
Additional information
The issue mentioned above is occurring on iOS 16. However, when I checked the getUserMedia API (using the above code) on a page with the URL capacitor://localhost:8080, it worked without any problems on iOS 17 beta. Can we assume that the above API will continue to work in the iOS 17 release?
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230726/7ac45b65/attachment.htm>
More information about the webkit-unassigned
mailing list