Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8358039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:40:29+00:00 2026-06-09T10:40:29+00:00

I’ve run into an issue using jPlayer and I thought after searching a few

  • 0

I’ve run into an issue using jPlayer and I thought after searching a few places that it would be used commonly enough on here and someone is bound to have run into a similar issue.

I am using the jPlayer to play through audio files and my users would like the functionality to fast-forward and rewind via specific hotkeys. I noticed that jPlayer doesn’t offer this functionality out of the box (it only handles fast-forward and rewind through clicking on the progress bar currently)

Ideally – all that would be necessary would be for a single keypress to toggle the fast-forwarding (or rewinding). When the same key is pressed again, the audio file would begin playing based on the current location.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:40:30+00:00Added an answer on June 9, 2026 at 10:40 am

    I decided to implement my own solution to this, which currently seems to work just fine. I thought I would share it in case anyone else encounters such an issue.

    Pardon the crude implementation. It was just a proof of concept:

    Necessary Javascript:

    //Handles the key down event (so the user can hold a key down to continue)
    $(document).keydown(function (e) {
        //Rewind
        if (e.keyCode == 37 && (!rewinding)) {
            rewinding = true;
            //Pause the player
            $("#player").jPlayer("pause");
            RewindTrack();
            rwaction = window.setInterval(function () { RewindTrack() }, 500);
        }
        else if (e.keyCode == 39 && (!fastforward)) {
            fastforward = true;
            //Pause the player
            $("#player").jPlayer("pause");
            FastforwardTrack();
            ffaction = window.setInterval(function () { FastforwardTrack() }, 500);
        }
    });
    //Ends the action
    $(document).keyup(function (e) {
        //Rewind
        if (e.keyCode == 37) {
            rewinding = false;
            window.clearInterval(rwaction);
            $("#player").jPlayer("pause");
        }
        else if (e.keyCode == 39) {
            fastforward = false;
            window.clearInterval(ffaction);
            $("#player").jPlayer("pause");
        }
    });
    
    //Related function
    function GetPlayerProgress() {
        return ($('.jp-play-bar').width() / $('.jp-seek-bar').width() * 100);
    }
    
    //Handles rewinding
    function RewindTrack() {
        //Get current progress and decrement
        var currentProgress = GetPlayerProgress();
        //Rewinds 10% of track length
        var futureProgress = currentProgress - 10;
        //If it goes past the starting point - stop rewinding and pause
        if (futureProgress <= 0) {
            rewinding = false;
            window.clearInterval(rwaction);
            $("#player").jPlayer("pause", 0);
        }
        //Continue rewinding
        else {
            $("#player").jPlayer("playHead", parseInt(futureProgress, 10));
        }
    }
    
    //Fast forwards the track
    function FastforwardTrack() {
        //Get current progress and increment
        var currentProgress = GetPlayerProgress();
        //Fast forwards 10%
        var futureProgress = currentProgress + 10;
        //If the percentage exceeds the max - stop fast forwarding at the end.
        if (futureProgress >= 100) {
            fastforward = false;
            window.clearInterval(ffaction);
            $("#player").jPlayer("playHead", parseInt($('.jp-duration').text().replace(':', '')));
        }
        else {
            $("#player").jPlayer("playHead", parseInt(futureProgress, 10));
        }
    }
    

    Working Demo (Use left arrow for rewind and right for fast-forward)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to run a str_replace or preg_replace which looks for certain words
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.