Best way to implement screen recording in web app


I’m doing a project which is about creating an environment where online teachers can make use of interactive simulations to teach.

Here is the prototype

I’m thinking implementing the facility to screen record so that teachers can screencapture from the webapp itself without having the difficulty to look for third party apps.

What is the best way to implement this?