MicrosoftEdge / MicrosoftEdge/WebView2Feedback
How to set default camera in webview2?
Open
@champnic is already working on this.
Since Jan 6, 2021.
feature request
tracked
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
When a PC has multiple cameras,
how to set default camera and disable for Ask before accessing camera like Edge/Chrome browser?

Version
SDK: 1.0.721-prerelease
Runtime: 87.0.664.66 (64-bit)
Framework: WPF
OS: Win10
Sample html code to play the webcam video after page is loaded.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SampleWebCam</title>
<style>
.vContainer {
margin: 0px auto;
width: 500px;
height: 375px;
border: 10px #333 solid;
}
#videoElement {
width: 500px;
height: 375px;
background-color: #666;
}
</style>
</head>
<body>
<div class="vContainer">
<video id="videoElement" autoplay />
</div>
<script>
const video = document.querySelector("#videoElement");
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(function (stream) {
video.srcObject = stream;
})
.catch(function (err0r) {
console.log("Something went wrong!");
});
}
</script>
</body>
</html>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.