npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wd-video

v0.1.0

Published

Utility for recording videos of your integration tests with WD

Downloads

5

Readme

WD Video Recorder

Utility that allows you to make videos of your integration tests with WD. See WD homepage for more information on how to run integration tests with node.

WD Video Recorder uses fluent-ffmpeg interface for FFMpeg. FFMpeg must be installed on your system prior to using this utility!

Installation

Utility is distributed via npm. Execute

$ npm install wd-video

from root directory of your node project to install WD Video Recorder.

Usage

Using WD Video Recorder should be really easy. The process consists of NNN simple steps:

  1. Import library to your JavaScript (test) file

     var Recorder = require('wd-video-recorder');
    	
  2. Initialize WD environment. For more information how to do this, please visit WD homepage.

     var browser = wd.promiseChainRemote();
     browser.init({browserName:'firefox'}).then(function() {
     	// ...
     });
  3. Create an instance of video recorder class

     var recorder = new Recorder(browser, [options]);
    	

    You can limited set of configuration options to constructor. See Recorder.constructor for more information.

  4. Start recording

     recorder.start();
    	
  5. Stop recording

     recorder.stop();
    	
  6. Save recorded video

     recorder.save(output, callback);
    	

    callback function receives three parameters - stderr, stdout and full path to recorded video.

  7. Clear recorder

     recorder.clear();
    	

    Since recorder uses WD screenshot feature, it peridocally takes screenshots of browser window. These screenshots are stored on your filesystem (either your system's temporary directory or in tempDir directory specified in constructor options. See Recorder.constructor for more information.). These screenshots should be deleted after recording video.

Recorder API

constructor

new Recorder(browser:WD.browser, [options:Object]):Recorder

Parameters

browser WD Browser Instance of WD browser.

options Object Optional. Hash of configuration options for this recorder. Following options are recognized:

  • tmpdir String Path to a directory. Recorder will create a subdirectory for its screenshots in this directory. Defaults to os.tmpdir().
  • fps Integer Frames per second. Screenshots will be taken at most at this rate. Actual rate depends on the browser delay (taking a screenshot is asynchronous). default FPS is 15.
  • aspect String Aspect ratio of recorded video. 4:3 for example. It is unspecified by default.
  • size String Size of recorded video. 800x600 for example. It is unspecified by default.
  • beforeSave Function(proc:ffmpeg):void Callback invoked just before saving the video. It takes on paramater - underlying FFMpeg process instance (See fluent-ffmpeg for documentation). This allows you to further modify the video output.

start

recorder.start():Recorder

Starts taking screenshots from browser instance passed to constructor.

Returns This instance.

save

recorder.save(output:String, callback:Function(stderr:String, stdout:String, output:String)):Recorder

Parameters

output String Relative (to current working directory) or absolute path to desired output video file.

callback Function(stderr:String, stdout:String, output:String) Callback function that gets called after save is done.

Returns This instance

clear

recorder.clear():Recorder

Removes all taken screenshots and screenshots directory itself. Throws an exception and does nothing if the recorder is running.

Returns This instance

stop

recorder.stop():Recorder

Stops the recorder from taking screenshots. Does not remove screenshots or screenshots directory. After calling stop(), you may call start() again to resume recording.

Returns This instance

stopAndClear

recorder.stopAndClear():Recorder

Stops recorder and clears the screenshots directory.

Returns This instance

stopAndSave

recorder.stopAndSave(output:String, callback:Function(stderr:String, stdout:String, output:String)):Recorder

Stops recorder and saves the video. See save method for parameter reference.

Parameters

Same as for save method

Returns This instance

stopSaveAndClear

recorder.stopSaveAndClear(output:String, callback:Function(stderr:String, stdout:String, output:String)):Recorder

Stops recorder, saves the video and clears the screenshots directory. See save method for parameter reference.

Parameters

Same as for save method

Returns This instance

Testing

Unit tests can be run from command line with:

$ grunt test