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

429
Views
In electron since the 'remote' has been deprecated, what module to use in place of it?

I am trying to make a video recording app using electron js as per this video from fireship - https://youtu.be/3yqDxhR2XxE and I'm stuck at building a selection menu of available video sources, as it turned out that the "remote" module has been deprecated. I have 2 js files, one is index.js which is the main electron js file and the other is the render.js file (in which I'm building functions for my app). I tried importing "remote" module in the index.js file but that didn't work. I even set the enableRemoteModule: true in webPreferences in index.js but that too didn't work. Now I am completely out of ideas as a newbie. I heard about the ipcRenderer and ipcMain modules but not sure they will work.

Below is the code for my "app.js":

//Buttons
const videoElement = document.querySelector('Video');
const startBtn = document.getElementById('startBtn');
const stopBtn = document.getElementById('stopBtn');
const videoSelectBtn = document.getElementById('videoSelectBtn');
videoSelectBtn.onclick = getVideoSources;


const {
  desktopCapturer
} = require("electron");
const {
  remote
} = require('@electron/remote')
const {
  Menu
} = remote


//Getting all available Video Sources
async function getVideoSources() {
  const inputSources = await desktopCapturer.getSources({
    types: ['window', 'screen']
  });

  const videoOptionsMenu = Menu.buildFromTemplate(
    inputSources.map(source => {
      return {
        label: source.name,
        click: () => selectSource(source)
      };
    })
  );

  videoOptionsMenu.popup();
}

over 4 years ago · Santiago Trujillo
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!