Record browser tab with javascript - Stack Overflow

Is it possible to record the current tab of the browser using just javascript and nothing else? I don&#

Is it possible to record the current tab of the browser using just javascript and nothing else? I don't want to use chrome or firefox extension. What I want to do is that the presenter would like to record his current tab and share it with others. If it's possible what is the best way to do this?

Is it possible to record the current tab of the browser using just javascript and nothing else? I don't want to use chrome or firefox extension. What I want to do is that the presenter would like to record his current tab and share it with others. If it's possible what is the best way to do this?

Share Improve this question asked Jun 15, 2018 at 11:10 Mo SadeghiMo Sadeghi 5198 silver badges25 bronze badges 1
  • Chrome's recorder feature, which is now bundled into developer tools (it is not a plugin), might apply to your use-case: developer.chrome./docs/devtools/recorder – Jeromy French Commented Aug 17, 2022 at 21:10
Add a ment  | 

2 Answers 2

Reset to default 4

There is... something that is in the process of being defined: MediaCapture Screen Share API.

This will allow to create a MediaStream from different sources such as the user's screen, or one of their apps' window, or some unclear-to-me "browser" thing.
From this MediaStream, it is easy to record it with the MediaRecorder API.

Currently, no browser has really implemented what is being defined there, but you can get some experimental implementations in Firefox, and, only from extension in Chrome.

This API doesn't really define a way to choose the current tab by default though, so your users will have to select this tab themselves from a prompt.

Live Example that will currently work only in Firefox.

And mandatory code block to be able to link to the fiddle, even though this code will not work anywhere for now!

navigator.getDisplayMedia({ video: true })
  .then(stream => {
    // we have a stream, we can record it
    const chunks = [];
    const recorder = new MediaRecorder(stream);
    recorder.ondataavailable = e => chunks.push(e.data);
    recorder.onstop = e => exportVid(new Blob(chunks));
    recorder.start();
    // defineWhenWeStopRecorder(recorder)
  }, error => {
    console.log("Unable to acquire screen capture", error);
  });

I have not worked on recorder yet. But found this post that may help. It is an API.

https://hacks.mozilla/2016/04/record-almost-everything-in-the-browser-with-mediarecorder/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745200517a4616297.html

相关推荐

  • Record browser tab with javascript - Stack Overflow

    Is it possible to record the current tab of the browser using just javascript and nothing else? I don&#

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信