skip to Main Content

I’m using RecordRTC for screen recording on my website.

I want to wait for 5 seconds and show a timer-like thing AFTER THE USER HAS SELECTED THE WINDOW|TAB to record the screen on.

Basically I’m interested on some browser events that will be fired when the user selects the window|tab to perform screen recording on.

Is this possible? Thx in advance.

2

Answers


  1. something like this ?

    const delay = (n) => new Promise((resolve) => setTimeout(resolve, n));
    await delay(5000);
    
    console.log('something'); // will run after 5 seconds
    

    (it has to be inside and async function)

    Login or Signup to reply.
  2. You can use window.onfocus a timeout function.

    window.onfocus = function() { 
      
      setTimeout(function() {
        doRecordStuff(); 
      }, 5000);
      
      
    };
    
    function doRecordStuff(){console.log('recording...');}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search