Git Product home page Git Product logo

jscapture's Introduction

Warning!

JSCapture won't work in Chrome 37+ due to removal of the experimental desktop sharing API.

JSCapture

JSCapture is screen capturing library implemented with pure JavaScript and HTML5.

It allows you to make screenshots and record a video of your desktop from your browser.

How to use

JSCapture uses getUserMedia for screen capturing. Currently the API for screen capturing is supported only by Google Chrome, Canary and Chromium by enabling an experimental flag.

In order to enable the flag:

  • Go to chrome://flags/#enable-usermedia-screen-capture
  • Enable - "Enable screen capture support in getUserMedia()"
  • Restart your browser.

Note that you MUST use https in order to be allowed to do screen recording. Since there are some very expensive operations happening when each frame is being captured the video won't be useful when you're capturing a high resolution. In order to handle this issue use the scale property.

API

  • JSCapture.capture(config) - Captures a new screenshot.
    • config.x - (Number) default value 0. Specifies the left offset.
    • config.y - (Number) default value 0. Specifies the top offset.
    • config.width - (Number) default value the screen width. Specifies the width of the screenshot.
    • config.height - (Number) default value the screen height. Specifies the height of the screenshot.
    • config.process - (Function|Array) default value an empty array. A list of filters, which are going to process the image.
    • config.done - (Function) default value is undefined. Callback, which is being called with the captured image.
    • config.fail - (Function) default value is undefined. A callback, which is being executed on unsuccessful screen capturing (for example if the user does not allow screen capturing).
    • config.delay - (Number) default value 0. Specifies the delay after each the screenshot will be captured.
  • JSCapture.record(config) - Capture a video.
    • config.x - (Number) default value 0. Specifies the left offset.
    • config.y - (Number) default value 0. Specifies the top offset.
    • config.width - (Number) default value the screen width. Specifies the width of the video.
    • config.height - (Number) default value the screen height. Specifies the height of the video.
    • config.process - (Function|Array) default value an empty array. A list of filters, which are going to process the individual frames.
    • config.done - (Function) default value is undefined. Callback, which is being called with the captured video.
    • config.delay - (Number) default value 0. Specifies the delay after each the video will be captured.
    • config.frameRate - (Number) default value 60 frames per second. Specifies the number of frames per second.
    • config.done - (Function) default value is undefined. A callback, which accepts the video (as a Blob), result of the screen recording, as an argument
    • config.fail - (Function) default value is undefined. A callback, which is being executed on unsuccessful screen recording (for example if the user does not allow screen capturing).
    • config.duration - (Number) default is Infinity. A number which indicates the length of the video.
  • JSCapture.stopRecording(fn) - Stops the video recording.
    • fn - (Function) default value is undefined. A callback, which accepts the video (as a Blob), result of the screen recording, as an argument. Note that the callback provided in config.done won't be invoked if JSCapture.stopRecording(fn) is called.
  • JSCapture.isRecording() - (Boolean) Returns whether the screen recording have been started.

Demo

Here

Contributors

mgechev jbrooksuk themgt hemanth
mgechev jbrooksuk themgt hemanth

License

This software is distributed under the terms of the MIT license.

jscapture's People

Contributors

hemanth avatar jbrooksuk avatar mgechev avatar themgt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jscapture's Issues

Hi Team, good job you have done.

You have done excellent application , But i am facing a problem that i m not able to enable the usermedia-screen-capture because when I enter given url (chrome://flags/#enable-usermedia-screen-capture) in chrome addressbar. i am not getting that 'enable screen capture support in getUserMedia()' option in that list. please suggest me how to resolve that or how to enable that. Currently i cant able to run your demo application because of the error. that says
screenshot from 2015-05-19 16 36 29
screenshot from 2015-05-19 16 32 14

please help me to resolve .
thanks

No flag like usermedia-screen-capture

Hello,

I Open chrome with url chrome://flags, but I did't get any flag like usermedia-screen-capture. How I can enable? I am using chrome Version 50.0.2661.102.

Model is open, but don't have any instruction. its blank.

Switch to chooseDesktopMedia API

As pointed out by a commenter on Hacker News, switching to chooseDesktopMedia opens this to a much wider audience.

Please do not do this.

You should not instruct users to change flags in order to use this. This opens up fairly serious security loopholes as malicious websites can start screensharing without being instantiated by the user.

Instead of using the getUserMedia API directly, you should use Chrome's chooseDesktopMedia API to get a desktop capture source (the screen, a tab, or any application window). The chooseDesktopMedia API is available in Chrome 34+ and can be used to do desktop screen capture/share without asking the user to enable flags.

As of 6 hours ago, the flag (#enable-usermedia-screen-capture) has been removed and will not be present in Chrome 35 Stable. [Ref: https://codereview.chromium.org/270353002 & https://code.google.com/p/chromium/issues/detail?id=347641]

In any case, cool hack!

enable-usermedia-screen-capturing no longer available

Google Chrome –enable-usermedia-screen-capturing flag was available in previous versions of Chrome, which allows content and screen sharing as an experimental basis among all Chrome users. A Chrome user could enable “screen capture support in getUserMedia()” by visiting ‘chrome://flags’. However, in the later versions of Chrome, the feature is not available and the flag “enable screen capture support in getUserMedia()” is no more available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.