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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jspsych-contrib/plugin-video-text-response

v1.0.0

Published

Initial release: Plays a video and collects free-text responses, recording the video time of each response.

Readme

jspsych logo

jsPsych is a JavaScript framework for creating behavioral experiments that run in a web browser.

Plugin Description

The video-text-response plugin plays a video and collects one or more free-text responses from the participant. By default the response box is enabled only while the video is paused, so the participant can pause, type a response, resume, and repeat as many times as they like within a single trial. The video's playback position is recorded for every pause and every response, which makes the plugin well suited to event-segmentation, continuous-rating, and "pause and comment" paradigms, as well as simple "watch then answer" tasks.

Native HTML5 video controls are hidden by default, so the participant can pause and resume but cannot scrub or skip ahead. Pausing is handled by a custom Pause/Resume button and/or a configurable key (Space bar by default).

Overview

  • Pause-gated or continuous responding (response_allowed_while_playing).
  • Multiple responses per trial, each tagged with the video time at which it was given.
  • Optional on-screen history of submitted responses.
  • Character filtering (letters / numbers / symbols) for constrained inputs.
  • Flexible trial-ending options: on response, on a done button, when the video ends, or after a time limit.

Parameters

This is a summary of the most commonly used parameters. See the full documentation for the complete parameter and data reference.

| Parameter | Type | Default | Description | | --------- | ---- | ------- | ----------- | | stimulus | VIDEO (array) | undefined | Path(s) to the video file. Required. | | response_allowed_while_playing | BOOL | false | If false, the response box is enabled only while paused. If true, it stays open continuously. | | show_pause_button | BOOL | true | Show a custom Pause/Resume button below the video. | | pause_key | KEY | " " | Key that toggles pause/resume. Set to null to disable keyboard pausing. | | prompt | HTML_STRING | null | HTML shown below the video and above the response box. | | placeholder | STRING | "" | Placeholder text in the empty response box. | | required | BOOL | true | Block submission of an empty or whitespace-only response. | | response_ends_trial | BOOL | true | End the trial as soon as a response is submitted. | | trial_ends_after_video | BOOL | false | End the trial when the video finishes playing. | | show_done_button | BOOL | false | Show a button that ends the trial when clicked. | | allow_numbers / allow_letters / allow_symbols | BOOL | true | Restrict which character classes are accepted in the box. | | show_response_history | BOOL | false | Display previously submitted responses on screen during the trial. |

Data Generated

This is a summary of the data collected. See the full documentation for the complete reference, including how rt and response_duration differ.

| Name | Type | Value | | ---- | ---- | ----- | | response | STRING (array) | Each submitted response, in submission order. | | rt | INT (array) | Time from trial start to each submission. | | response_duration | INT (array) | Time from when each response window opened to its submission. | | response_video_time | FLOAT (array) | Video playback time (seconds) at each submission. | | pause_video_time | FLOAT (array) | Video playback time at each pause. | | pause_duration | INT (array) | Length of each pause in milliseconds. | | total_trial_time | INT | Total trial duration in milliseconds. |

Examples

Pause to respond, as many times as needed, with the trial ending when the video finishes:

var trial = {
  type: jsPsychVideoTextResponse,
  stimulus: ["video/sample_video.mp4"],
  prompt: "<p>Pause the video (button or spacebar) whenever you want to respond.</p>",
  response_ends_trial: false,
  trial_ends_after_video: true,
};

Continuous responding while the video plays:

var trial = {
  type: jsPsychVideoTextResponse,
  stimulus: ["video/sample_video.mp4"],
  response_allowed_while_playing: true,
  response_ends_trial: false,
  trial_ends_after_video: true,
};

Letters-only input, response required, with an on-screen response history:

var trial = {
  type: jsPsychVideoTextResponse,
  stimulus: ["video/sample_video.mp4"],
  required: true,
  allow_numbers: false,
  allow_symbols: false,
  show_response_history: true,
  response_ends_trial: false,
  trial_ends_after_video: true,
};

Letting the participant end the trial themselves with a done button (useful when responses do not end the trial and you do not want to rely on the video finishing):

var trial = {
  type: jsPsychVideoTextResponse,
  stimulus: ["video/sample_video.mp4"],
  prompt: "<p>Pause and respond as many times as you like.</p>",
  response_ends_trial: false,
  show_done_button: true,
  done_button_label: "I'm finished",
  done_prompt: "<p>Click when you have nothing more to add.</p>",
};

Loading

Via NPM

npm install @jspsych-contrib/plugin-video-text-response
import VideoTextResponse from "@jspsych-contrib/plugin-video-text-response";

Via CDN

<script src="https://unpkg.com/@jspsych-contrib/plugin-video-text-response"></script>

Compatibility

plugin-video-text-response requires jsPsych v8.0.0 or later.

Documentation

See the full documentation for the complete parameter and data reference.

Author / Citation

Gabriel Fajardo, Xinyi Guan