mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
Merge pull request #464 from andrewheusser/video-stop-event-handler
added event handler to video plugin to end trial when a stop time is specified
This commit is contained in:
commit
1885be8e36
@ -115,6 +115,16 @@ jsPsych.plugins.video = (function() {
|
|||||||
end_trial();
|
end_trial();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// event handler to set timeout to end trial if video is stopped
|
||||||
|
display_element.querySelector('#jspsych-video-player').onplay = function(){
|
||||||
|
if(trial.stop != false){
|
||||||
|
if(trial.start == false){
|
||||||
|
trial.start = 0;
|
||||||
|
}
|
||||||
|
jsPsych.pluginAPI.setTimeout(end_trial, (trial.stop-trial.start)*1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// function to end trial when it is time
|
// function to end trial when it is time
|
||||||
var end_trial = function() {
|
var end_trial = function() {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user