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 4335422
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:40:02+00:00 2026-05-21T10:40:02+00:00

I am using jQuery 1.5 and jPlayer 2.0.0, please ignore the fact that this

  • 0

I am using jQuery 1.5 and jPlayer 2.0.0, please ignore the fact that this is going to auto play music, I am going to supply enough warning before it starts, the user has to press a big button to initiate the page and I will provide a big STOP button.

I would like the audio file to begin playing and a function be called after the page is ready and the audio is loaded.

I have the following javascript (I have modified the code so it can be understood better).

function FemeMusic() {

    FemeMusic.prototype.addMusic = function(actionAfterMusic) {
        $("#jp").jPlayer({
            ready: function() {
                var jPlayerElement = $(this);
                jPlayerElement.jPlayer('setMedia', {
                    mp3: 'aSongByJamesBlunt.mp3'
                });
                jPlayerElement.bind($.jPlayer.event.progress,
                function(event) {
                    if (event.jPlayer.status.seekPercent === 100) {
                        jPlayerElement.jPlayer("play");
                    }
                    if (actionAfterMusic) {
                        actionAfterMusic.call();
                    }
                });
             },
             swfPath: "/flash",
             preload: "auto"
         });
    }
} 

I have this function to trigger the above code.

$(document).ready(function() {
    var femeMusic = new FemeMusic();
    femeMusic.addMusic(killMyself); 
});

I was using the same code but with the $.jPlayer.event.loadeddata event without the if statement instead of $.jPlayer.event.progress and it worked fine in some browsers but isn’t compatible when it comes to using flash because it doesn’t fire the event (Also I had a problem with it in firefox 3.5 but I don’t know why). The above seems to work in Firefox

I read this

“I suggest you use the progress event instead and check that the:
event.jPlayer.status.seekPercent === 100. “

On this post http://groups.google.com/group/jplayer/browse_thread/thread/9dc9736f9d6947bd?pli=1 by the creator

Any one got any suggestions?


Edit

Having not got this working in chrome and safari I tested this on a new version 3.6 of Firefox (which I should have done in the first place) and it worked as expected, despite the fact that in the documentation event.progress id described as:

A robust jPlayer event supported by Flash and HTML5 browsers

and in the link above the creator suggests to use event.progress to get round browser problems I can only assume it’s a browser specific issue.

Would be nice to get some clarification on this though.

  • 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-05-21T10:40:03+00:00Added an answer on May 21, 2026 at 10:40 am

    From the creator of jPlayer:

    So your goal here is to auto-play AFTER the media is buffered?

    If you want the short answer. Forget it. x-browser buffering is a mine
    field. Some simply ignore it as you have found. Just setMedia and play it.

    If you really want to try and do it. Then a play then pause would help,
    since a media.play() is better x-browser than a media.load() i.e. its
    operation varies less. The iOS Safari would ignore the play completely
    though. The user would need to click on something that starts the
    operation i.e. a play button.

    That last point applies to trying any form of autoplay, so ensure that there
    is a play button available. The jPlayer interface will cope with iOS not
    playing through feedback from the browser events i.e. stalled.

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

Sidebar

Related Questions

I am working on this page where I'm using a Jquery Mp3 Player (Jplayer)
I am writing an application using jQuery (with the jPlayer plugin) that needs to
using jquery's .post i send do my php code an object that with var_dump
Using jQuery, how can I get the input element that has the caret's (cursor's)
I am having trouble playing an MP3 file using jQuery Jplayer in Firefox 8.
Using jQuery 1.6.2 HTML that I'm operating on <select id=langId> <option value=0>Argentina - Spanish</option>
Using jquery how do i simply check if it is read only? this is
I'm using the jQuery audio player 'jPlayer', I have a loop which creates a
Using jQuery and given this <ul> <li> <a external=http://stackoverflow.com href=home.htm>Link 1</a> </li> <li> <a
Using jquery, how can I find the first div that contains an input with

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.