Steel
Steel

Reputation: 55

Chrome packaged apps: Permission for getUserMedia() audio input

I'm porting my web app over to a Chrome packaged app and I heavily use the Web Audio API (which works great), but I use getUserMedia() to get line in audio. Normally a status bar comes down asking for permission from the user. In a packaged app this does not happen and error 1 (permission denied) is thrown. Has anyone had any experience with this in a packaged app setting or know if there is a certain permission I need to add?

Oh, I also did some research and found some bugs filed with chrome on it but I don't know if any of them have been implemented yet.

Upvotes: 4

Views: 1542

Answers (1)

codeisforeva
codeisforeva

Reputation: 469

You have to add the proper permissions in your manifest.json. Then it should inform the user when they install your app.

  "permissions": [
    "audioCapture", 
    "videoCapture"
  ]

You can use one or the other depending on what type of request you're passing as a parameter to getUserMedia(), that is {audio:true} or {video:true}, respectively.

Upvotes: 8

Related Questions