jsPsych/examples/jspsych-video-button-response.html
2019-07-12 17:02:06 -04:00

47 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-video-button-response.js"></script>
<script src="../plugins/jspsych-html-button-response.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
</head>
<body></body>
<script>
var pre_trial = {
type: 'html-button-response',
stimulus: '<div style="max-width:600px;"><p>Some browsers now require that a user interacts with a web page before video or audio content will autoplay. Clicking the button below satisfies that requirement.</p><p>Without this trial, the video will load but not play.</p></div>',
choices: ['continue']
}
var trial = {
type: 'video-button-response',
sources: ['video/sample_video.mp4'],
choices: ['y','n'],
button_html: '<button class="jspsych-btn">%choice%!</button>',
margin_vertical: '10px',
margin_horizontal: '8px',
prompt: 'Press Y or N',
width: 600,
//height: 600,
autoplay: true,
//controls: true,
//start: 8,
//stop: 9,
rate: 1.5,
//trial_duration: 2000,
response_ends_trial: true
}
jsPsych.init({
show_preload_progress_bar: true,
timeline: [pre_trial, trial],
on_finish: function() { jsPsych.data.displayData(); }
});
</script>
</html>