Abhinit Modi
Abhinit Modi

Reputation: 63

Capturing desktop video and microphone audio from a chrome extension

I am using the navigator.webkitGetUserMedia API to capture the desktop and using microphone to capture audio. When I make the following call

navigator.webkitGetUserMedia({
     audio:true,  
     video: {
     mandatory: {
        chromeMediaSource: 'desktop',
        chromeMediaSourceId: id,
        maxWidth:screen.width,
        maxHeight:screen.height} 
     }
  }, gotStream, getUserMediaError);

I am getting a screen capture error. Does this API not support the above scenario?

I am able to capture audio and desktop video individually but not together. Also, since I am capturing desktop and not the webcam video, does that make any difference?

Upvotes: 2

Views: 1354

Answers (1)

Stiliyan
Stiliyan

Reputation: 1174

Chrome does not allow you to request an audio stream alongside a chromeMediaSource.

See Why Screen Sharing Fails here for more info.

You may be able to circumvent this by sending individual getUserMedia requests - one for the audio stream and one for desktop.

Upvotes: 3

Related Questions