JPlayer , using android , not working

2,222 views
Skip to first unread message

NK,Lee

unread,
Dec 23, 2013, 5:23:27 AM12/23/13
to jpl...@googlegroups.com


On Android, my JPlayer is not working, 

iOS, it's OK.


it's my code.
----------------------------------------------------------------------------------------
$("#jplayer_tablet").jPlayer("play", parseInt(startTime_));
----------------------------------------------------------------------------------------



I want to give a startTime, iOS is good work,  however, Android , start only 0 seconds.

Mark Panaghiston

unread,
Dec 30, 2013, 8:49:00 AM12/30/13
to jpl...@googlegroups.com
Which version of Android is this?

Android can be difficult to design for since there are so many flavours and every device is different.
With Android 2.3 we solved a number of issues by using an external controller:
http://jplayer.org/latest/developer-guide/#jPlayer-known-issues-android

One of the problems with integrating that into jPlayer core is that, for example, a playlist type use would be doing a lot of extra stuff that was not necessary and it would actually stop it from working if you did that stuff for the ended event.

Maybe it will give you some ideas though... And maybe you would like to try your hand at fixing it too by forking GitHub.
In the code I do do some iOS specific stuff, by using a flag to know the 1st time is ignored and then the progress event tells jPlayer that iOS is doing something so we can now jump to the correct time.

If you are stuck for time though... Add a delay between setMedia and play(time). In addition, the first time ever on a page, setMedia then play and then play(time), each with a small delay between. You could also use the progress event handler to keep the delay to a minimum.

Ron Eslinger

unread,
Feb 9, 2014, 5:08:42 PM2/9/14
to jpl...@googlegroups.com
How do I add a delay between setMedia and Play. I am using your Audio playlist example from your demo, and on Droid, the audio jumps to a different track after selecting a track or when I hit the Next button. 

Can you send me or provide an example based on your playlist demo that would fix this problem on Droid? It is driving me crazy for the past couple months, and I have tried everything found in many articles to resolve this, but nothing works.


I just want my playlist to work correctly, and I understand the issues with the hardware on Droid, and needing a delay between setMedia and Play, but not sure how to accomplish this using the Javascript within the demo.

Any help on this would be great!!!!!!!

Thanks

Mark Panaghiston

unread,
Feb 10, 2014, 3:52:19 PM2/10/14
to jpl...@googlegroups.com
First off, take a look at this info and the fix demo here:
http://jplayer.org/latest/developer-guide/#jPlayer-known-issues-android

The main part that is of interest is the ability to play the tracks in the playlist on Android, not the ended stuff - which I'd consider as secondary.

If you look at that "fix" it uses the progress event to know when the Android Audio instance is ready to play. So normal browsers just follow the W3C spec, but Android sets flags and stuff that trigger the play on the progress event's first occurrence after the setMedia. The other item of note is that the preload option must not be "none". Otherwise the progress event never fires at all.

A gross way of doing it would be to add a 1 or 2 second delay on the play() method of the playlist. You'd add the delay when you detect Android is being used... And probably want to store the timeout id and kill it before creating a new one just in case some caffeine crazed user spams the track.

Ron Eslinger

unread,
Feb 10, 2014, 6:11:29 PM2/10/14
to jpl...@googlegroups.com
I inspect the demo fix page, and go through the Javascript code, and I just don't know where to begin. I understand Java, and Ajax, but I'm trying to figure out how to incorporate your fix into the demo playlist from your site. It makes sense with a single player. This player only plays on Droid devices as it is used on Droid devices only to help people with Cancer.

This is what I have. Can you incorporate the fix, and maybe you can display this as a demo fix for playlist. Any help on this would be great as we are suppose to go live tomorrow with this app.



//<![CDATA[
$(document).ready(function(){

new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, [
{
title:"Biology of Thought <br>The Healing Breath<br>",
artist:"Ron Eslinger",
mp3:"healing.mp3"
},
{
title:"Attack Cancer<br>",
artist:"Ron Eslinger",
mp3:"attackcancer.mp3"


},
{
title:"Healing Visualizations<br>",
artist:"Ron Eslinger",
mp3:"healingvisualization.mp3"


},
{
title:"Healing Affirmations<br>",
artist:"Ron Eslinger",
mp3:"healingaffirmations.mp3"


},
{
title:"Bio-Rhythmic Music with Subliminal Messages for Wellness and Healing<br>",
artist:"Ron Eslinger",
mp3:"music.mp3"


}
], {
swfPath: "../js",
supplied: "mp3",
smoothPlayBar: true,
keyEnabled: true,
audioFullScreen: false
});
});
//]]>



--
You received this message because you are subscribed to a topic in the Google Groups "jPlayer: HTML5 Audio & Video for jQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jplayer/MMm3BXFShqc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jplayer+u...@googlegroups.com.
To post to this group, send email to jpl...@googlegroups.com.
Visit this group at http://groups.google.com/group/jplayer.
For more options, visit https://groups.google.com/groups/opt_out.

Mark Panaghiston

unread,
Feb 10, 2014, 7:06:35 PM2/10/14
to jpl...@googlegroups.com
You'll need to be looking at the play() method:
https://github.com/happyworm/jPlayer/blob/master/add-on/jplayer.playlist.js#L401

This part here is the problem part....

if(this.playlist.length) {
this.select(index);
$(this.cssSelector.jPlayer).jPlayer("play");
}

We need to insert a delay for the Android devices between the select(index) and the jPlayer("play"). Ideally this is done via the progress event to give a robust solution, where you set a flag that is then captured.

I cannot provide clean and tested code for that right now. I will provide the delay solution next and then give a best guess as to the other solution code.

Solution A - With a timeout:

play: function(index) {
  var self = this;
  index = (index < 0) ? this.original.length + index : index; // Negative index relates to end of array.
if(0 <= index && index < this.playlist.length) {
if(this.playlist.length) {
this.select(index);
if($.jPlayer.platform.android) {
clearTimeout(this.androidFixID);
this.androidFixID = setTimeout(function() {
$(self.cssSelector.jPlayer).jPlayer("play");
}, 2000);
} else {
$(this.cssSelector.jPlayer).jPlayer("play");
}
}
} else if(index === undefined) {
$(this.cssSelector.jPlayer).jPlayer("play");
}
},

Solution B - With an event handler:

jPlayerPlaylist = function(cssSelector, playlist, options) {

(Many lines... look at the end of it for:)

  if($.jPlayer.platform.android) {
// Create a progress event handler to fix android
$(this.cssSelector.jPlayer).bind($.jPlayer.event.progress, function() {
if(self
.androidFix) {
    self.androidFix = false;
$(this).jPlayer("play");
}
});
  }

// Instance jPlayer
$(this.cssSelector.jPlayer).jPlayer(this.options);
};


play: function(index) {
  index = (index < 0) ? this.original.length + index : index; // Negative index relates to end of array.
if(0 <= index && index < this.playlist.length) {
if(this.playlist.length) {
this.select(index);
if($.jPlayer.platform.android) {
this.androidFix = true;
} else {
$(this.cssSelector.jPlayer).jPlayer("play");
}
}
} else if(index === undefined) {
$(this.cssSelector.jPlayer).jPlayer("play");
}
},

The solution B will be the best if you can get it working. My code should be correct, but check in the console for syntax errors that might have slipped me by.

I think I'll use this (solution B) method to fix the jPlayer core... In practice, even if you have fixed it in your code, and then update to a new jPlayer in future, both codes would work in harmony and only result in 2 play commands given at the appropriate time... And 2 plays do not cause a problem. A caveat of the jPlayer core fix would probably include the pause command cancelling the androidFix flag. ie., so you do not click pause real fast and then the fix starts it playing.

Good luck with your launch tomorrow.

Ron Eslinger

unread,
Feb 10, 2014, 7:26:15 PM2/10/14
to jpl...@googlegroups.com
I'm using the jquery.playlist.min.js. I don't even see the jplayer.playlist.js file in the demo zip. Also the code is bunched up together and it doesn't match the link above. Can you send me the js file with the fix and I'll be your tester. Just eager to get this published, and I've been stuck on it for many days. 

Any help would be wonderful.

Thank you so much

Mark Panaghiston

unread,
Feb 11, 2014, 5:45:06 AM2/11/14
to jpl...@googlegroups.com
Seriously? - I am sorry, but this reply will be rather rude.

That link to GitHub... That is the master repository of the jPlayer source files. You can download them from there in a ZIP file or you can clone the repo itself using GIT... But I am now assuming that you do not have a clue what I'm talking about. Yes, now I'm being a GIT.
https://github.com/happyworm/jPlayer

The official releases can be found here:
https://github.com/happyworm/jPlayer/releases

Also, we have hidden away on the main jPlayer website, hidden on the main site navigation, the download page. This page has the original source for jPlayer 2.5.0 (at the moment) and many other files.
http://jplayer.org/download/

The link to GitHub is on our website in 2 places... The home page and the download page.

I must now apologize for being patronizing... Last night I'd stayed up an extra hour to try and help you, and now the wind went out my sails... I had hoped you'd be back here today saying it worked, rather than asking questions that are indicative of a "person" who did not event do a simple google search for the source. A search for "jPlayer source" and the download page comes up first in the results. Yeah, you were busy, but that is what you get paid for.

Ron Eslinger

unread,
Feb 11, 2014, 9:26:47 AM2/11/14
to jpl...@googlegroups.com
Sorry about that, I had an emergency to attend to. On top of Mobile app development, Website Development, I also support Virtual Servers, Networks for 150 plus customers, and had a massive emergency with Knoxville Bar Association. I developed their site at www.knoxbar.org and their main server crashed shortly after I sent that message to you last night, and I had to go on-site and work all night on getting their server back up and running.

I got home about 2 hours ago, took a nap, and back up working on this mobile app. I am about to test, and will send you a response to let you know what happen.

I am an Entrepreneur and work for myself. I use to run multiple companies here in Knoxville TN, but after going up against a 10 billion dollar company out of California for a game me and my team created, I had to close everything down.

So I work out of my house, and continue to work for all my customers as a 1099. I am developing Mobile apps for a hypnotist who trained me here in Knoxville, and these apps will help people with cancer, stress, weight problems, smoking, and so on. I do not get paid for the development of these apps, but hopefully down the road, I will get a small percentage.

I do appreciate your help and will let you know what happens here shortly.

Ron Eslinger

unread,
Feb 11, 2014, 10:28:16 AM2/11/14
to jpl...@googlegroups.com
Mark, I thank you so much for this fix. I used the sample A fix by editing the playlist.js file on line 401, and now I can go between playlist items and it does not jump or cut off. I ended up setting the wait to 1500 and ran multiple test, which all seem to be working perfectly now. I do appreciate your help on this and sorry if I gave you the wrong impression. I stay busy like you constantly. I work day and night, and all this in hopes that I can retire by next year.

Last year was very difficult going through that lawsuit and I lost my house, cars, kids, and business. So my goal is to work with this hypnotist to create mobile apps to help people.

I will send you a link to the mobile app once I have it and other apps uploaded.

Thank you again for your time, and I know other would be interested in the playlist fix.

Mark Panaghiston

unread,
Feb 11, 2014, 12:15:14 PM2/11/14
to jpl...@googlegroups.com
No problem Ron. Glad to hear you got it sorted out.

I think I'll look into adding it to the core. Two birds with 1 stone... Once I accepted that Android are not going to fix it, the solution seemed to become clear.

If you get time, solution B should be more robust... You may be making assumptions about your network bandwidth and then others may take that extra 200ms and go over the threshold and fail. Solution B automatically adjusts the delay, since the progress event happens when the audio can be played without causing an error.

Ron Eslinger

unread,
Feb 14, 2014, 7:10:42 AM2/14/14
to jpl...@googlegroups.com
Do I place solution B within the new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
},

Or within the $(document).ready(function(){?



I played around with it and wasn't sure where to place the code, and when I did both, it seemed to break it. I noticed you had your example within a function that past options and the playlist.

I'm just using the example from your demo page. I would like to use solution B if it will completely prevent this from happening on slower networks.


//<![CDATA[
$(document).ready(function(){

new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, [
{
title:"Biology of Thought and The Healing Breath<br>",
artist:"Ron Eslinger",
m4a:"Biology.mp4"
},
{
title:"Attack Cancer<br>",
artist:"Ron Eslinger",
m4a:"Attack.mp4"


},
{
title:"Healing Visualizations<br>",
artist:"Ron Eslinger",
m4a:"HealingV.mp4"


},
{
title:"Healing Affirmations<br>",
artist:"Ron Eslinger",
m4a:"HealingA.mp4"


},
{
title:"Bio-Rhythmic Music with Subliminal Messages for Wellness and Healing<br>",
artist:"Ron Eslinger",
m4a:"Biomusic.mp4"


}
], {
swfPath: "../js",
supplied: "m4a",
smoothPlayBar: true,
keyEnabled: true,
audioFullScreen: false
});
});
//]]>

Mark Panaghiston

unread,
Feb 14, 2014, 10:26:33 AM2/14/14
to jpl...@googlegroups.com
You worry me... I think you need a good nights rest.

How did you achieve Solution A then?
Because Solution B is carried out on the same piece of code. This one here, the source code of the jPlayerPlaylist object definition jplayer.playlist.js that was linked to in the post on GitHub:
https://github.com/happyworm/jPlayer/blob/master/add-on/jplayer.playlist.js

Look at that code and re-read the Solution B instructions and you should be able to find the parts I'm talking about.

This weekend you should go out for a walk and smell some flowers. I'm going to myself, a walk along the canal and then down the river for a mile or two.

Healthy Visions

unread,
Feb 14, 2014, 11:06:43 AM2/14/14
to jpl...@googlegroups.com

OK, sorry, Yes I need sleep, worked till 3 AM on another down server for Steel Plate Fabricators, then was back up at 5 AM.

 

I’ll test it out and let you know what I find.

 

Thanks again.

Healthy Visions

unread,
Feb 14, 2014, 12:38:32 PM2/14/14
to jpl...@googlegroups.com

Great, that seems to do it as well. Nice and clean transition, with no jumping to the next track. Thank you very much and I hope that the next release will have these fixes so I don’t have to keep modifying the files.

 

I appreciate your help on this.

 

Here is a link to the droid app.

https://play.google.com/store/apps/details?id=com.healthyvisions.attackcancer

 

 

Also a link to the iphone app.

https://itunes.apple.com/us/app/attack-cancer/id815546224?mt=8

 

 

I appreciate your help and enjoy using your player. Very nice.

 

 

 

From: jpl...@googlegroups.com [mailto:jpl...@googlegroups.com] On Behalf Of Mark Panaghiston
Sent: Friday, February 14, 2014 10:27 AM
To: jpl...@googlegroups.com
Subject: Re: [jPlayer] Re: JPlayer , using android , not working

 

You worry me... I think you need a good nights rest.

Mark Panaghiston

unread,
Feb 14, 2014, 5:32:19 PM2/14/14
to jpl...@googlegroups.com
Looking good Ron.

I plan to incorporate those fixes into the jPlayer core... But I'm not sure on a time-scale just yet. I hope to look at this next week, but I have a feeling it might get pushed to the week after.

Have a nice weekend. You've earned it!

zlie...@denverlibrary.org

unread,
Feb 18, 2014, 4:25:46 PM2/18/14
to jpl...@googlegroups.com
Thanks so much, Mark - I was running into the same issue, found this and used your option B. Working for me now!

Zeth

Healthy Visions

unread,
Feb 23, 2014, 11:43:34 AM2/23/14
to jpl...@googlegroups.com

Thanks Mark, I noticed a new issue in this app after making the changes. I can click to a different track without having it jump to the next track, however, if I open the page and immediately click on Play prior to the track loading, it goes to the next track.

 

It happens every time. If I let it sit for a few seconds, it eventually loads and works great. But knowing people out there, they will go to the page and hit the play button, which always skips the first track and goes to the second track.

 

Is this the same issue with Droid? Is there a way to show a progress loading and prevent users from hitting the play button until it is actually ready to play? I am not sure what the process is when you first open the page, and it is loading the first track, then displays the time in the progress bar, which works when you hit the play button.

 

Any help would be great. We went live a couple weeks ago, and I’ve had complaints and people uninstalling the apps due to this issue. It has to do with slower networks like 3G. On wireless and 4G, it loads very quickly and doesn’t appear to be an issue.

 

 

 

 

From: jpl...@googlegroups.com [mailto:jpl...@googlegroups.com] On Behalf Of Mark Panaghiston
Sent: Friday, February 14, 2014 5:32 PM
To: jpl...@googlegroups.com
Subject: Re: [jPlayer] Re: JPlayer , using android , not working

 

Looking good Ron.

--

Mark Panaghiston

unread,
Feb 23, 2014, 12:41:13 PM2/23/14
to jpl...@googlegroups.com
Your in the realms of Android there and you will need to investigate... The most obvious thing to look for is whether the ended event is happening when the proactive user presses play quickly on page load.

I'd like to be able to help, but I can only buy so many devices for testing. I can't help it if I only buy the good quality Android devices that work, such as the Nexus 7. Next time I will buy a Samsung, which I had associated with quality too, but maybe they only make quality LED displays and are riding on the coat tails of that success.

As to a solution... Looking at Solution B and thinking... When the user presses a button on the GUI, the play button, it does not uses that piece of code. It bypasses it completely in that case and talks directly to the jPlayer core... Hmmm... So if I pulled my finger out and applied this update to the core, then it might simply start working... But that is a guess and a hope... In practice, things are never that easy... For example, applying the fix to the core means that the preload option for Android must never be "none". In your case it is easy, I tell you not to do that, but the core library must assume people are stupid and have not read any instructions and just copied and pasted the code into a page and expect it to work. Hmmm... OK I'm ranting now... Focus!

A solution then... With solution B we have established that the play command is going direct to the core while the Android browser is "not ready" for the play. This corrupts the current track that was setup and - I assume the ended event fires - which causes the playlist to move to the next track through the playlist code, which does have the Android fix in it.

Short term band-aids then - This is only for Android:
1) We want to stop the user from being able to play before Android is ready... Well a crude way to do it would be to hide the GUI controls by default - ONLY THE GUI - and then show it when the progress event occurs.

In that first bit of code for solution B... Changes in red background. - OK, I'm adding pseudo code atm cause I do not have time right now...

  if($.jPlayer.platform.android) {
// Create a progress event handler to fix android
$(this.cssSelector.jPlayer).bind($.jPlayer.event.progress, function() {
if(self
.androidFix) {
    self.androidFix = false;
$(this).jPlayer("play");
}
// Show the GUI here (when under Android.)
});
// Hide the GUI by default here (when under Android.)
  }

To be library like, you'd want to get the cssSelectorAncestor and the cssSelector.gui from the jPlayer options and then use that. But if you only ever have 1 instance of the playlist, then you cann get away with just adding in the selector you use to the gui.

Ok thinking...

Inside jPlayer the gui jQuery selector is at:
this.css.jq.gui

Access that external, well inside the progress event using:
$(this).data("jPlayer").css.jq.gui

So put it together like this...

  if($.jPlayer.platform.android) {
// Create a progress event handler to fix android
$(this.cssSelector.jPlayer).bind($.jPlayer.event.progress, function() {
if(self
.androidFix) {
    self.androidFix = false;
$(this).jPlayer("play");
}
// Show the GUI here in the event (when under Android.)
$(this).data("jPlayer").css.jq.gui.show();
}).data("jPlayer").css.jq.gui.show(); // Hide the GUI by default here in the Android logicical clause.
  }

Other options... Erm... The all revolve around disabling the display until the Android can play it without screwing up.

Please investigate if the ended event is occurring and is the cause of the problem... If it is, then this fix should work. Let us know.

I will try and sort out the core, but I doubt i will be fast enough for you. Plus, you'd want to remove all those changes you'd added and start using an Edge version of jPlayer.

PS. The google group seems to complain about your posts...
Are you posting directly from emails?
I'm using the web page to post and it complains about your posts having emails in them.

Mark Panaghiston

unread,
Feb 23, 2014, 12:43:11 PM2/23/14
to jpl...@googlegroups.com
And the correct code for anyone who did not notice the error:

  if($.jPlayer.platform.android) {
// Create a progress event handler to fix android
$(this.cssSelector.jPlayer).bind($.jPlayer.event.progress, function() {
if(self
.androidFix) {
    self.androidFix = false;
$(this).jPlayer("play");
}
// Show the GUI here in the event (when under Android.)
$(this).data("jPlayer").css.jq.gui.show();
}).data("jPlayer").css.jq.gui.hide(); // Hide the GUI by default here in the Android logicical clause.
  }

The commet was correct, but I'd forgotten to change the .show() to a .hide() in the code that executes on page load. (Android)

Healthy Visions

unread,
Feb 23, 2014, 5:18:06 PM2/23/14
to jpl...@googlegroups.com

Sounds great Mark, I will check it out and give you an update. I’ll play around with the different options and figure out which works best. I do appreciate your help on this and I will be happy to give you credit in my apps with the use of jPlayer for all your hard work in helping me make  this a good app.

 

I will keep you updated, may be by tomorrow morning as I’m about to head out with the family.

 

Thanks

Healthy Visions

unread,
Feb 24, 2014, 12:26:31 PM2/24/14
to jpl...@googlegroups.com

I tried this, but it appears to break the playlist. The list never shows up, and unable to play anything. I moved the code around some, but still no go. When I remark the hide() function, the playlist works, so It seems to be something with the hide function. In your example, you did not have $(this) before .data, which in dreamweaver showed it as an error, so I added $(this), but no go.

 

I’ll keep playing around with the functions.

 

 

if($.jPlayer.platform.android) {

    // Create a progress event handler to fix android

    $(this.cssSelector.jPlayer).bind($.jPlayer.event.progress, function() {

 

      if(self.androidFix) {

        self.androidFix = false;

 

        $(this).jPlayer("play");

      }

                        // Show the GUI here in the event (when under Android.)

      $(this).data("jPlayer").css.jq.gui.show();

                 

    });

 

$(this).data("jPlayer").css.jq.gui.hide();

// Hide the GUI by default here in the Android logicical clause.;

Healthy Visions

unread,
Feb 24, 2014, 12:35:08 PM2/24/14
to jpl...@googlegroups.com

I did add an alert where you have show and hide, and this works. It alerts me that the process is not ready when the page comes up, but then a few seconds later, I receive an alert that the audio is ready. I will see what I can do to disable the play button, or add a loading indicator.

Healthy Visions

unread,
Feb 24, 2014, 1:13:07 PM2/24/14
to jpl...@googlegroups.com

I was able to get this to work with the use of a Loading image over the play button. So the user can’t click on the play button until the audio loads.

 

This is just a way to prevent the user from hitting the play button while it is still loading, on slow devices. The progress indicator over the play button helps as well to let the user know it is loading.

 

 

 

<li><div id="loadprog" style="background: url('loadin.gif');width:40px;height:40px;background-repeat:no-repeat;position:absolute;display: block;margin-left:5px;margin-top:5px;"></div><a href="javascript:;" class="jp-play" tabindex="1" style="display: block;">play</a></li>

 

 

 

if($.jPlayer.platform.android) {

    // Create a progress event handler to fix android

    $(this.cssSelector.jPlayer).bind($.jPlayer.event.progress, function() {

 

      if(self.androidFix) {

        self.androidFix = false;

 

        $(this).jPlayer("play");

      }

                        // Show the GUI here in the event (when under Android.)

      //$(this).data("jPlayer").css.jq.gui.show();

                  //alert('ready to play');

                  document.getElementById('loadprog').style.display='none';

    });

 //alert('Not ready');

//$(this).data("jPlayer").css.jq.gui.hide();

document.getElementById('loadprog').style.display='block';

// Hide the GUI by default here in the Android logicical clause.;

 

 

  }

 

 

Then I added this under the play: function(index) at the end of the file

 

if(0 <= index && index < this.playlist.length) {

                                                                if(this.playlist.length) {

                                                                                this.select(index);

                                                                               

             if($.jPlayer.platform.android) {

                                                                document.getElementById('loadprog').style.display='block';

//show progress  image each time the track changes.

        this.androidFix = true;

      } else {

 

 

 

 

        $(this.cssSelector.jPlayer).jPlayer("play");

 

 

 

 

      }

 

 

 

image001.png

Mark Panaghiston

unread,
Feb 24, 2014, 4:11:02 PM2/24/14
to jpl...@googlegroups.com
Good you got it working... Your solution looks nice actually with the loading over the play button...

A few points... My code did work, you just read it incorrectly. Look again:

  if($.jPlayer.platform.android) {
// Create a progress event handler to fix android
$(this.cssSelector.jPlayer).bind($.jPlayer.event.progress, function() {
if(self
.androidFix) {
    self.androidFix = false;
$(this).jPlayer("play");
}
// Show the GUI here in the event (when under Android.)
$(this).data("jPlayer").css.jq.gui.show();
}).data("jPlayer").css.jq.gui.hide(); // Hide the GUI by default here in the Android logicical clause.
  }

The hide() line is chained onto the end of the
$(this.cssSelector.jPlayer)
In the event handler $(this) is equal to that. Outside the event handler, it could be many things, but in our case, it would be a jQuery wrapping of the jPlayerPlaylist instance object.

How about you take 5 seconds to learn a little jQuery... For example, this line here:
document.getElementById('loadprog').style.display='none';
Could be written in jQuery like:
$('#loadprog').hide();

I only say that since jQuery is on the page anyway... Otherwise the pure JS is fine.

Healthy Visions

unread,
Feb 25, 2014, 8:06:12 AM2/25/14
to jpl...@googlegroups.com

Still doesn’t seem to work. I did this exactly how you have it and it seems to break the page. I will keep it like it is with the loading indicator. I also added a message in the progress bar indicating the audio track is loading.

 

I’ve played with JQuery for years, but more of a Javascript, PHP, MySQL, and VB kind of guy. I started javascript back in 1997 and it tends to be easy for me to use and not have to look up anything. When they stop using javascript fully, and switch over to JQuery as a requirement, I will take some time to learn it fully.

 

For now, I don’t need to use it much, but do use PHP, HTML, Javascript, VB, ASP.net, and MySQL on a daily basis. JQuery is fun, and I use it in some of my complex websites for searching the MySQL database without having to repost/ reload the form values into PHP, or I can dynamically load information into a DIV from PHP / MySQL using JQuery. Works great.

 

Thanks for the advice, and as mentioned before, I will give you credit in our apps for use of JPlayer and your support. I do appreciate everything and look forward to newer players, and the future of JPlayer / JQuery.

 

Thanks

Mark Panaghiston

unread,
Mar 8, 2014, 12:13:25 PM3/8/14
to jpl...@googlegroups.com
The Android fix described in this thread has now been applied to the core in jPlayer 2.5.5. This has been pushed to github and is available there until the next official minor version (2.6) is released.
https://github.com/happyworm/jPlayer

Mark Panaghiston

unread,
Mar 12, 2014, 6:50:31 AM3/12/14
to jpl...@googlegroups.com
jPlayer 2.5.5 has been put online temporarily:
http://jplayer.org/2.5.5/demos/

You can see the new jPlayer core in operation with the original Playlist code here:
http://jplayer.org/2.5.5/demo-02/

ie., The Playlist code changes described in this thread were applied to the core, instead of patching the operation of the playlist.

This area will be removed with jPlayer 2.6.0 goes live.

Steve

unread,
May 25, 2014, 11:04:45 AM5/25/14
to jpl...@googlegroups.com
Sorry to hijack this thread, but I want to make sure whether latest jPlayer 2.6 should be working on Android 4.4.2 (Nexus 5)? I have used it in a site that works properly on all three major browsers, but does not work on Android (I have only 4.x and don't really care about 2.x compatibility).

Thanks in advance!

Mark Panaghiston

unread,
May 26, 2014, 11:47:21 AM5/26/14
to jpl...@googlegroups.com
Yes - jPlayer 2.6.0 contains the Android Fix described in this thread.

I am surprised you have problems in the Nexus 5... The Google Devices run the best Android - well, from my niche media in the browser point of view. As in, Nexus devices use Chrome by default and work well.

The problem with the fix is, that Android should have fixed this rubbish 3 years ago. Just as I cave in and add the fix, those Samsung and other Android brands update to the 4.4+ versions and started working with the old code... As in, they FINALLY got the W3C Media Spec implemented well enough not to take a huge dump on itself when trying do change the media and play it. But those Nexus devices always worked and they work with or without the fix.

The only place I know it causes a problem, is when using Phone Gap... And we have plans to add an option to disable the fix for when using jPlayer with PhoneGap.

Steve

unread,
May 26, 2014, 4:19:47 PM5/26/14
to jpl...@googlegroups.com
Thanks for the prompt reply. I was surprised it is not working mysefl, but hey s*** happens, so I am not that worried, I just needed to know whether I should add fix or look elsewhere for the problem. Basically I've used the barebones sample you have on your site, nothing fancy. And when I say use, I mean I copy pasted it, fiddled it just a bit to work as I need it and that's it. I am no js guru by a long shot, so I might have made something stupid, but hey, it worked on the other browsers. You can take a look at the code here if you wish and tell me if you see anything wrong:

// jPlayer start
  $(document).ready(function(){
      $("#jplayer_1").jPlayer({
        ready: function() {
          $(this).jPlayer("setMedia", {
            mp3: "../sounds/nature.mp3"
          }).jPlayer("play");
          var click = document.ontouchstart === undefined ? 'click' : 'touchstart';
          var kickoff = function () {
              $("#jquery_jplayer_1").jPlayer("play");
              document.documentElement.removeEventListener(click, kickoff, true);
            };
        document.documentElement.addEventListener(click, kickoff, true);
        },
        loop: true,
        swfPath: "http://jplayer.org/latest/js"
      });
      $(".sound-button").toggle(
          function () {
            $(this).attr({src:"../images/sound-button-off.gif"});
            $("#jplayer_1").jPlayer("stop");
          },
          function () {
            $(this).attr({src:"../images/sound-button-on.gif"});
            $("#jplayer_1").jPlayer("play");
          }
        );
    });
// jPlayer end

Steve

unread,
May 29, 2014, 10:53:54 AM5/29/14
to jpl...@googlegroups.com
I would appreciate any help.

Healthy Visions

unread,
Jun 16, 2014, 11:48:03 AM6/16/14
to jpl...@googlegroups.com

Hi Mark, I receive a lot of complaints on Droid devices that the audio starts playing for 5 to 10 seconds, then stops, then starts back up, then stops. I’ve not had this issue on my devices, but have seen on some LG devices. I’ve had a few complaints on iPad as well doing the same thing, or playing but no audio. Is there a way to download more of the audio track prior to playing so this could be avoided?

 

Let’s say a user clicks on the Play button, have it download for a few seconds, or a percentage before actually playing. These audio tracks are hypnosis tracks and I hate to hear that during their hypnosis session the track stops for a few seconds, then starts, and then stops again.

 

Any help on this would be great as I’m getting bad reviews and comments. Also in the release of IOS 7.1, it no longer displays the total time of the track until someone clicks on the play button. Just thought I would mention this.

 

Thanks

 

From: jpl...@googlegroups.com [mailto:jpl...@googlegroups.com] On Behalf Of Mark Panaghiston
Sent: Wednesday, March 12, 2014 6:51 AM
To: jpl...@googlegroups.com
Subject: Re: [jPlayer] Re: JPlayer , using android , not working

 

jPlayer 2.5.5 has been put online temporarily:

--

You received this message because you are subscribed to a topic in the Google Groups "jPlayer: HTML5 Audio & Video for jQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jplayer/MMm3BXFShqc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jplayer+u...@googlegroups.com.
To post to this group, send email to jpl...@googlegroups.com.
Visit this group at http://groups.google.com/group/jplayer.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages