Get webcam permission in Electron on Ubuntu

I’m developing an Electron app that requires access to the webcam stream in the renderer process. In the main process, I have an event listener that waits for navigation to a particular page, then requests media access by calling await systemPreferences.askForMediaAccess("camera"). In the renderer process, when I load that page I call navigator.mediaDevices.getUserMedia(constraints) where constraints is

{
  video: {
    width: {
      ideal: 320,
      max: 640,
    },
    height: {
      ideal: 240,
      max: 480,
    },
    frameRate: {
      ideal: 2,
      max: 10,
    },
  },
}

This works well when I build my application for Mac and Windows, but on Ubuntu the camera stream fails to load. Are there other steps I am missing for Ubuntu?