I have just setup FancyBox3 to see if its ok to use with my project.
So far so good.
Just one thing though, Is it possible to set the left and right keyboard buttons to skip forward or backward 5 seconds?
In the JS file, i found the following code;
// Left arrow and Up arrow
if (keycode === 37 || keycode === 38) {
e.preventDefault();
self.previous();
return;
}
// Righ arrow and Down arrow
if (keycode === 39 || keycode === 40) {
e.preventDefault();
self.next();
return;
}
I think this means that at the moment the left and up arrow skip to the next video, and right and down skip to the previous video, but can it change to skipping 5 seconds forward and backward on the current video
Use this one.
if (keycode === 37 || keycode === 38) {
e.preventDefault();
if($("video")[0].currentTime-5>=0)
{
$("video")[0].currentTime=$("video")[0].currentTime-5;
}
return;
}
// Righ arrow and Down arrow
if (keycode === 39 || keycode === 40) {
e.preventDefault();
if($("video")[0].currentTime+5<=$("video")[0].duration)
{
$("video")[0].currentTime=$("video")[0].currentTime+5;
}
return;
}
just replace $("video")[0] with the video element you want to fast forward.this may not be perfect but works if you are able to get the video element.