Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

257
Views
video source can't be started DOM exception

Error:

Uncaught (in promise) DOMException: Could not start video source

What I tried:

I checked that is my chrome is allowed to access camera and it was allowed.
I tried to updated my camera drive but no updates were available.
This error comes mostly but sometimes my site doesn't give this error.
How to resolve this issue?
It is a problem of my laptop and it is still saying that my code has an error pls give any solutions
Code:

getDevices: async function(){
    let $this = this;
    navigator.mediaDevices
    .enumerateDevices()
    .then(function(devices) {
        devices.forEach(function(device) {
            if(device.kind == "audioinput"){
                $this.microphones.push(device);
            }
            else if(device.kind == "audiooutput"){
                $this.speakers.push(device);
            }
            else if(device.kind == "videoinput"){
                $this.cameras.push(device);
            }
        });
     });
    let videoStream = await navigator.mediaDevices.getUserMedia({video: true,audio: false});
    let audioStream = await navigator.mediaDevices.getUserMedia({video: false,audio: true});
    const combinedStream = new MediaStream(
        [
            ...videoStream.getVideoTracks(),
            ...audioStream.getAudioTracks()
        ]
    );

    document.getElementById("myVideo").srcObject=combinedStream;
    document.getElementById("myVideo").muted = true;
},
setCamera: async function(){
    let videoStream = await navigator.mediaDevices.getUserMedia({video:{deviceId:this.selectedCamera},audio: false});
    let audioStream = await navigator.mediaDevices.getUserMedia({video: false,audio: true});
    const combinedStream = new MediaStream(
        [
            ...videoStream.getVideoTracks(),
            ...audioStream.getAudioTracks()
        ]
    );

    document.getElementById("myVideo").srcObject=combinedStream;
    document.getElementById("myVideo").muted = true;
}, //It says that The error is on this line and the error is Uncaught (in promise) DOMException: Could not start video source.

-Thanks For All Your Solutions

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!