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

154
Views
Anulando navigator.mediaDevices.getDisplayMedia para Screenshare dentro de electron

Me encontré con la captura de pantalla con electron al renderizar un sitio web cuando necesitaba una solución para habilitar el uso compartido de pantalla dentro de mi aplicación de electron; sin embargo, el desktopCapturer siempre está indefinido, de mi lado y es la única forma en que puedo acceder; las fuentes están dentro del proceso principal;

Me gustaría saber si hay una manera de que las fuentes definan cuando hago algo como esto.

 let all_sources = undefined ipcRenderer.on('SET_SOURCES', (ev, sources) => { all_sources = sources console.log("The sources are : ", all_sources) }) const wait_function = function() { return new Promise(resolve => { setTimeout(function() { resolve(all_sources); }, 4000); }); }; contextBridge.exposeInMainWorld("myCustomGetDisplayMedia", async () => { await ipcRenderer.send('GET_SOURCES') await wait_function(); // want to make sure all_sources is defined const selectedSource = all_sources[0]; // take the Entire Screen just for testing purposes return selectedSource; });

esto está dentro del script js de precarga. Gracias

about 4 years ago · Juan Pablo Isaza
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!