7.2.1 • Published 3 years ago

flow-recorder v7.2.1

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

Table of Contents

Intro

Flow Recorder is an automated video recorder for web applications.

Automated screen recording with flow-recorder provides many advantages:

  • Video content is always up to date.
  • The quality of the flows can be improved over time.
  • It's scalable - you can maintain hundreds of video flows.
  • Full control over actions speed of the entire flows and/or each step.
  • Playback speed of certain flow parts.
  • Exclude certain flow parts from capturing.
  • The same flow can be captured in different formats and sizes for different platforms.
  • Editing doesn't require any additional tools or skills.

Installation

To use flow-recorder in your project, run:

npm install flow-recorder

Config file

To get started, you need to create a config file.
In the config file, add an options array and pass it as an argument to the run() function:

const flowRecorder = require("flow-recorder");
let options = [
    {
        "name": "my-project",
        "presetsDir": "presets/",
        "scriptsDir": "scripts/",
        "outputDir": "assets/videos",

        "presets": [
            "blog",
            "you-tube",
            "whats-new"
        ],

        "scripts": [
            "find-a-product",
            "see-product-details",
            "buy-a-product"
        ]
    }
]
flowRecorder.run(options);

Config options

keyDescriptionDefaultOptional
nameProject name that will be included in the exported video file name.NA
rootDirRoot project directory."./"optional
assetsDirAssets directory."./assets"optional
scriptsDirScripts directory."./scripts"optional
presetsDirPresets directory."./presets"optional
outputDirGenerated videos directory."./output"optional
screenshotsDirScreen shot directory."./output"optional
showStatsShows info about capturing (debugging).falseoptional
renderActualCursorVisualizes the exact position of the cursor (debugging).falseoptional
exportGifExport animated gifsfalseoptional
encodeVideoEncode video after capturing.falseoptional
exportGifBulkExport all scripts as animated gifs.falseoptional
encodeVideoBulkEncode all scripts as videos (for better quality/size ratio)falseoptional
metaData: generateMeta data will be generated.falseoptional
metaData: outputPathMeta data output directory."./outputoptional

Presets

Presets define basic properties of the media format, script pace and video quality. They especially useful if you have different platforms for sharing like video, blogs, emails and so on.

{
    "width": 1440,
    "height": 900,
    "scaleFactor": 1,
    "captureFPS": 60,
    "playbackFPS": 60,
    "stepDelay": 0,
    "videoBPS": 800000000,
    "speedFactor": 1,
    "audio": true,
    "soundEffects": true,
    "speech": true
}

Presets options

keyDescriptiondefault
widthWidth of the media in pixels800
heightHeight of the media in pixels800
scaleFactorScale factor of the media800
captureFPSWidth of the media in pixels800
playbackFPSWidth of the media in pixels800
stepDelayDelay between steps800
videoBPSVideo quality800
speedFactorDuration of each step800
audioCapture audiofalse
soundEffectsMouse clicksfalse
speechText to speech voice overfalse

Scripting

Scripts are plain JSON files:

{
    "url": "https://my-site.com",
    "stepDelay": 240,
    "speedFactor": 1,
    "steps": [{
            "startRecording": ""
        },
        {
            "click": "#b"
        },
        {
            "doubleClick": "#a"
        },
        {
            "tripleClick": "#b"
        },
        {
            "stopRecording": ""
        }
    ]
}

Scripts can be nested:

script-a.json

{
    "steps":[
        {
        "runScript": "./script-b.json"
        }
    ]
}

You can run multiple scripts in one project:

scripts:[
    "script_1",
    "script_2",
    "script_3"
]

Script options

Options should be provided in the script file itself:

{
    "url": "http://example.com",
    "speedFactor": 1000,
    "steps":[
        ...
    ]
}

Script steps

StepDescriptionExample
addStyleTagAdds <style> tag to the given frame.open
positionMoves cursor to the center of the screenopen
clickNavigates a cursor to a given target, actualize and visualize one clickopen
clickAndShootNavigates to a given target and makes one screenshotopen
doubleClickNavigates a cursor to a given target, actualize and visualize two clicks
dragAndDropNavigates to a given target, drags and drops after traveling for a given distanceopen
fastForwardMoves cursor to the center of the screenopen
fastForwardStartMoves cursor to the center of the screenopen
fastForwardStopMoves cursor to the center of the screenopen
hoverNavigates a cursor to a given targetopen
hoverAboveListNavigates a cursor to a given target and traveling through the list of itemsopen
inputTextNavigates to a given target (if provided) and typing a given textopen
navigateNavigates to a given urlopen
pagePage provides methods to interact with a single tabopen
pauseOnPauses recording when target appearsopen
pauseRecordingPauses recordingopen
playSoundMoves cursor to the center of the screenopen
positionNavigates to a given target, actualize and visualize three clicksopen
removeStyleTagMoves cursor to the center of the screenopen
resumeOnResumes recording when target appearsopen
resumeRecordingResumes recordingopen
rightClickNavigates a cursor to a given target, actualize and visualize three clicksopen
scrollByNavigates to a given target, actualize and visualize three clicksopen
scrollIntoViewscrolls the element's parent container such that target is visible to the useropen
shootMakes one screenshotopen
speakMoves cursor to the center of the screenopen
startRecordingStarts recordingopen
stopOnStops recording when target appearsopen
stopRecordingStops recording
subtitleMoves cursor to the center of the screenopen
tripleClickNavigates a cursor to a given target, actualize and visualize three clicks
waitWaits for a given amount of time
waitForSelectorWaits for target appearanceopen
zoomOnWaits for target appearanceopen

iframes

At this point, flow-recorder supports one level of iframes. Nesting is not supported.
To select an element inside an iframe include "iframe" string as the first chain of the target selector:

{
    "click": "iframe .my-target"
}

Troubleshooting

Video file is longer/shorter than the content
It is probably due to this bug.

Video content is too fast/slow
Check speedFactor value in the preset and/or in the script.

7.2.1

3 years ago

7.2.0

3 years ago

7.0.0

3 years ago

6.0.0

4 years ago

5.1.2

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago

5.0.3

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.6.0

4 years ago

4.4.0

4 years ago

4.3.0

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.9.0

4 years ago

3.8.0

4 years ago