video-keyboard-response start parameter bug in Safari
See original GitHub issueWhen setting a start
parameter for the video-keyboard-response
plugin in Chrome or Firefox, the video plays from the start time specified (i.e., the plugin works as intended), but in Safari, the stimulus screen appears completely blank with no audio.
Replication: Including a start
time like in the example below appears to work in all browsers except Safari.
var stim_video_seg_initial = {
type: 'video-keyboard-response',
autoplay: true,
**start: 10,**
trial_ends_after_video: true,
stimulus: [
'video-location.mp4'
],
choices: jsPsych.NO_KEYS,
};
The above code works as intended in Firefox and Chrome. In Safari, the above code only shows a blank screen until the intended video duration has passed.
It looks to me like the issue stems from the onseeked
listener on line 190 of the jspsych-video-keyboard-response.js
plugin. It looks to me like this listener is never called on Safari browsers.
if(trial.start !== null){
video_element.pause();
video_element.currentTime = trial.start;
video_element.onseeked = function() {
video_element.style.visibility = "visible";
if (trial.autoplay) {
video_element.play();
}
}
}
This issue seems to replicate across different Mac and iOS devices running Safari. Are you aware of this issue? Are there any fixes that you can think of? Maybe there is an alternative listener to the onseeked
listener that is specific to Safari devices?
Any input is appreciated. Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (2 by maintainers)
Feel free to do so. The version will be bumped from 0.1.0 to 1.0.0 anyway, so an additional patch change won’t affect the version number, but it will be added to the release notes and changelog.
@bmchardy great, thanks very much for the feedback! This fix will be added to the next release. Thanks for reporting the issue, and for your patience 😃