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

120
Views
getDisplayMedia Screenshot in Safari browser?

This is the code to generate image,

console.log('--imageCapture');
const btn = document.querySelector('#btn')
btn.addEventListener('click',()=>{
  screenshot()
})

function screenshot(){
const canvas = document.createElement("canvas");

// Request media
navigator.mediaDevices.getDisplayMedia().then(stream => 
{
  console.log(stream);
  
  let track = stream.getVideoTracks()[0];
  
  let capture = new ImageCapture(track);
  
  capture.grabFrame().then(bitmap => 
  {
    // Stop sharing
    track.stop();
      
    // Draw the bitmap to canvas
    canvas.width = bitmap.width;
    canvas.height = bitmap.height;
    canvas.getContext('2d').drawImage(bitmap, 0, 0);
      
    const frame = canvas.toDataURL("image/png");
  });
})
.catch(e => {
  console.log(e)});
}

these code runs It runs perfectly in Chrome, but it can't running in safari, is there any way to generate image in safari?

about 4 years ago · Santiago Gelvez
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!