Videos?

324 views
Skip to first unread message

Ulysses Bernardet

unread,
Apr 12, 2015, 3:44:22 AM4/12/15
to jsp...@googlegroups.com
Hi,

is it possible to use videos with jsPsych?

Cheers, Ulysses

Josh de Leeuw

unread,
Apr 13, 2015, 8:46:35 AM4/13/15
to Ulysses Bernardet, jsp...@googlegroups.com
Yes, it's definitely possible. There's no official plugin that shows video at the moment, but I did develop a plugin at one point that showed video and allowed subjects to mark different moments in the video. There's no documentation, and the plugin would need to be updated to work with version 4.x. You might use this plugin as a template for building a plugin that showed video.


However, depending on what you wanted to do, you could just use the single-stim plugin to show an HTML <video> element. An example trial might look like this:

var stimulus = '<video width="400" controls>'+
  '<source src="mov_bbb.mp4" type="video/mp4">'+
  '<source src="mov_bbb.ogg" type="video/ogg">'+
'</video>';

var trial = {
  type: 'single-stim',
  stimuli: [stimulus],
  is_html: true,
  choices: ['enter']
}
  


--
You received this message because you are subscribed to the Google Groups "jsPsych" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspsych+u...@googlegroups.com.
To post to this group, send email to jsp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/71a90822-e7c9-4645-ace1-e584cdfc8e1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ulysses Bernardet

unread,
Apr 14, 2015, 2:24:42 AM4/14/15
to jsp...@googlegroups.com
Great, thanks for the quick reply. I'll give it a shot then :)

Cheers, Ulysses

letizia....@gmail.com

unread,
Mar 21, 2016, 12:49:49 PM3/21/16
to jsPsych, ber...@gmail.com
Hello Josh!

I'm a new jsPsych user. I'm trying to set up a behavioural task using mp4 files. I would like to present to subjects 3 sec video and to ask them (after each video) to press "1", "2", "3", "4" or "5" on the keyboard. I would record accuracy and reaction times for every response.

I was wandering if there is some explanation on how to use movies in jsPsych and if there is a plugin that could be useful to me. I tried to adapt my task starting from your code, but there something that I don't really get.

Thank you very much!
Letizia

Josh de Leeuw

unread,
Mar 21, 2016, 12:53:43 PM3/21/16
to letizia....@gmail.com, jsPsych
Hi,

We are actually in the middle of an experiment using videos in our lab. I wrote a new video plugin for that experiment, but it's not documented or included in the main jsPsych files. However, you can find our experiment here:


The video plugin is here:


And here's an example trial using the plugin (from https://github.com/jodeleeuw/instructor-mediation/blob/master/exp1/index.html):

timeline.push({
type: 'video',
autoplay: true,
controls: false,
width: video_width,
height: video_height,
sources:[instructor_videos[0]],
timing_post_trial: 0,
center_vertical: true
});

I don't have the time at the moment to document the plugin and add it to the library, but it'll be in there at the next release (which could be a few months from now).

Josh

--
You received this message because you are subscribed to the Google Groups "jsPsych" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspsych+u...@googlegroups.com.
To post to this group, send email to jsp...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages