mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-13 00:58:12 +00:00
Merge pull request #590 from r-b-g-b/master
Option to set video playback rate
This commit is contained in:
commit
d6f7002497
@ -16,6 +16,7 @@ autoplay | boolean | true | If true, the video will begin playing as soon as it
|
|||||||
controls | boolean | false | If true, controls for the video player will be available to the subject. They will be able to pause the video or move the playback to any point in the video.
|
controls | boolean | false | If true, controls for the video player will be available to the subject. They will be able to pause the video or move the playback to any point in the video.
|
||||||
start | numeric | null | If given a value, the video will start at this time point in seconds.
|
start | numeric | null | If given a value, the video will start at this time point in seconds.
|
||||||
stop| numeric | null | If given a value, the video will stop at this time point in seconds.
|
stop| numeric | null | If given a value, the video will stop at this time point in seconds.
|
||||||
|
rate | numeric | null | The playback rate of the video. 1 is normal, <1 is slower, >1 is faster.
|
||||||
|
|
||||||
## Data Generated
|
## Data Generated
|
||||||
|
|
||||||
|
@ -65,6 +65,12 @@ jsPsych.plugins.video = (function() {
|
|||||||
pretty_name: 'Stop',
|
pretty_name: 'Stop',
|
||||||
default: null,
|
default: null,
|
||||||
description: 'Time to stop the clip.'
|
description: 'Time to stop the clip.'
|
||||||
|
},
|
||||||
|
rate: {
|
||||||
|
type: jsPsych.plugins.parameterType.FLOAT,
|
||||||
|
pretty_name: 'Rate',
|
||||||
|
default: null,
|
||||||
|
description: 'The playback rate of the video. 1 is normal, <1 is slower, >1 is faster.'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,6 +139,10 @@ jsPsych.plugins.video = (function() {
|
|||||||
display_element.querySelector('#jspsych-video-player').currentTime = trial.start;
|
display_element.querySelector('#jspsych-video-player').currentTime = trial.start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(trial.rate !== null){
|
||||||
|
display_element.querySelector('#jspsych-video-player').playbackRate = trial.rate;
|
||||||
|
}
|
||||||
|
|
||||||
// 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