question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

video-keyboard-response start parameter bug in Safari

See original GitHub issue

When 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:closed
  • Created 2 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bjoluccommented, Oct 1, 2021

I haven’t added a changeset file yet because I wasn’t sure if it makes sense to flag this as a patch for the video-* plugins and thus bump their version numbers, given that these plugins haven’t been published as npm packages yet?

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.

1reaction
becky-gilbertcommented, Jul 12, 2021

@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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

If Safari on Mac doesn't open a webpage or isn't working as ...
If Safari isn't working as you expect, one of these solutions might help.
Read more >
Customize a start page in Safari on Mac - Apple Support
In the Safari app on your Mac, choose Bookmarks > Show Start Page. Click the Options button in the bottom-right corner of the...
Read more >
wwdc2022-10032 | Apple Developer Forums
Hello, On the wwdc22 Dive into App Intents video in 16:08 you can see that part of parameters are in ParamaterSummary and one...
Read more >
Block pop-up ads and windows in Safari - Apple Support
Learn how to block pop-up windows and handle persistent ads on your iPhone, iPad, or Mac.
Read more >
Safari Technology Preview Release Notes - Apple Developer
Added support for WebCodecs encoder bitrate related parameters (255476@main) ... If you come across an implementation bug in web technology, Web Inspector, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found