最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

webrtc - Screen recording the browser window using javascript - Stack Overflow

programmeradmin1浏览0评论

I'm developing an app which is basically a drawing app in which interactive simulations can be embedded.

I'm trying to add the option for recording the screen and audio in the website itself so that teachers can create the lessons online. What is the best way to achieve this? I've searched a lot in the internet and found that recordRTC by Muaz Khan is a very nice choice. But I'm a noobie and I feel like there are too many options in it and I'm not sure which is the best option for me.

I've also read about webRTC. Is it possible to screenrecord using it? I don't mind using chrome extension, provided I should have the option for recording a specific part of the page with it. Please help....

I'm developing an app which is basically a drawing app in which interactive simulations can be embedded.

I'm trying to add the option for recording the screen and audio in the website itself so that teachers can create the lessons online. What is the best way to achieve this? I've searched a lot in the internet and found that recordRTC by Muaz Khan is a very nice choice. But I'm a noobie and I feel like there are too many options in it and I'm not sure which is the best option for me.

I've also read about webRTC. Is it possible to screenrecord using it? I don't mind using chrome extension, provided I should have the option for recording a specific part of the page with it. Please help....

Share Improve this question edited Mar 15, 2020 at 10:36 Synn Ko 872 silver badges18 bronze badges asked May 26, 2018 at 14:07 Jithin KsJithin Ks 5292 gold badges9 silver badges18 bronze badges 1
  • If you want to get up and running quickly you can choose any open source screen recording tool like this - github./mgechev/jscapture – Abrar Commented May 26, 2018 at 14:12
Add a ment  | 

2 Answers 2

Reset to default 2

As of May 2018, you can obtain a screen video stream in Firefox using:

let constraints = {
  video: {
    mediaSource: "screen"
  }
};

navigator.mediaDevices.getUserMedia(constraints)
  .then(mediaStream => {
    // do something with mediaStream now
  });

However, this doesn't actually record the screen. You'll need to build a way to do that yourself. One way is to use WebRTC to send the video you obtain to your backend and record it there.

As far as other browsers go:

  • Chrome does not support natively obtaining screen media. You'll have to build an extension and ask your users to install it. It's not very hard to do.
  • Edge & safari supposedly support it, but I have not tried then.

You can check this library videojs-record. Built using RecordRtc. You can also use it with popular js frameworks like React and Angular.

发布评论

评论列表(0)

  1. 暂无评论