Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

431
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda