jPlayer returns e_url error but then starts playing

817 views
Skip to first unread message

Eugenio

unread,
Oct 20, 2011, 4:57:42 PM10/20/11
to jpl...@googlegroups.com
Hello,
I'm using jPlayer on a new Recommendation Radio http://mentor.fm
Sometimes I've experienced a weird behaviour; I catch URL errors using something like this:

$(this).bind($.jPlayer.event.error, function(event) {
switch(event.jPlayer.error.type) {
case $.jPlayer.error.URL:
....send me an email with some details....
audioplaylist.next();

and sometime it happened that probably for some reason the player perceived an error (I received the email), it skipped to the next song but then the song that caused the error actually started and so I could hear two songs together.

Any clue?

Thanks!

Eugenio

Eugenio

unread,
Oct 20, 2011, 4:58:49 PM10/20/11
to jpl...@googlegroups.com
Sorry I forgot part of the question: can I got exactly what the server answered in order to understand the problem?

Dustin Blake

unread,
Oct 20, 2011, 5:11:10 PM10/20/11
to jpl...@googlegroups.com

Eugenio

unread,
Oct 20, 2011, 6:09:30 PM10/20/11
to jpl...@googlegroups.com
Hi Dustin,
thanks for the answer. I could hardly use this approach because the URLs expire when I use them, so if I call the URL after getting an error message I would get an expired error message, not the original error message.
Is it not possible to get that info directly from jPlayer?

Eugenio

Dustin Blake

unread,
Oct 20, 2011, 6:37:13 PM10/20/11
to jpl...@googlegroups.com
jPlayer exposes some errors through the error event object, as your already using.  As far as response header information I'm not quite sure how that's actually accomplished because I don't think there is any one object available that has them all, some things like mime-type(confirm?), user-agent and referrer are available through the document object however.

Sorry, but in a way I feel like I don't quite understand what your asking.

If your binding to a certain event like an error, and waiting for it to occur, and having some information emailed to you about the error, you should be including in the email the date/time and status of jPlayer using the event objects (http://www.jplayer.org/latest/developer-guide/#jPlayer-event-object


Eugenio

unread,
Oct 20, 2011, 7:21:07 PM10/20/11
to jpl...@googlegroups.com
What I'm asking is: is there any way to have more details about what the server answered to jPlayer?
Right now I know there is an URL error but apparently is a false allarm because than the music start so I don't understand why jPlayer think there is an error.

Can error_context error_message error_hint give me some more details about?

Thanks.

Eugenio

unread,
Oct 22, 2011, 7:43:31 PM10/22/11
to jpl...@googlegroups.com
Now I'm receiving also context, message and hint but it doesn't help me 
the message is:Media URL could not be loaded.
the context is the url I called
the hint is: check media URL is valid.

The URL is valid and actually the radio plays it but for some reason it thinks there is an error and therefore it skips to the next track, the result, as I said before, is that two tracks are played at the same time.
This happens just sometimes and I have no clue how to debug this, does anybody know how can I get some further details about the server response?

One idea: could be that the server is slow to response and jPlayer thinks there is an error? Then it gets the streams but the  error already raised? Is there a timeout parameter?

Dustin Blake

unread,
Oct 22, 2011, 9:39:48 PM10/22/11
to jpl...@googlegroups.com
You could certainly .delay() (/w jQuery) the loading of the media.

How are you requesting files?  

Eugenio

unread,
Oct 22, 2011, 9:49:29 PM10/22/11
to jpl...@googlegroups.com
Hi,
as far as I know I can use delay() to delay the execution of a function, but how can I use it in order to wait before the error raises with
$(this).bind($.jPlayer.event.error ...
?

About your second question I'm not sure what you mean: I'm using the playlist version of jPlayer, I produce an array of URLs that is then used by the player. I add a new element to the array (the next song) every time a song start.

Eugenio

Eugenio

unread,
Oct 24, 2011, 3:26:38 AM10/24/11
to jpl...@googlegroups.com
Is there any of the author who can help? If jPlayer detect an error in trying to playing a track, I'm pretty sure it has somewhere the response of the server, that is what I need.

Thanks.

Mark Panaghiston

unread,
Oct 24, 2011, 8:29:49 AM10/24/11
to jpl...@googlegroups.com
The URL error that jPlayer raises can actually be caused by a codec not supported error in HTML5... But you appear to be using the flash then html solution, so flash will be used nearly everywhere.

The Flash only creates the error if the MP3 file is not available and it generates an error in the Flash, which bubbles up the jPlayer URL error.

The error handling has no idea what the server response is. It goes by either the errors generated in the Flash when it tries to load the url or from the HTML5 media element, which generates its own error event. A broken url will generate the URL error.

I tried to reproduce the problem, but it seemed to work for the first 10 songs or so... And then I figured that I could be there all day trying to get it to fail.

So you got a bunch of emails from your error handler... But you must have been on the page at the time to observe both tracks playing... The Flash can't play 2 at a time and I have not seen anything like that happen as a bug. The HTML5 solution might behave in an odd manner... As it depends on the browser and how well the html element really works.

Have you always used the solution:"flash,html" since the start when you observed this problem?

Eugenio

unread,
Oct 24, 2011, 1:47:21 PM10/24/11
to jpl...@googlegroups.com
Hi Mark and thanks for your answer.
Yes the solution:"flash,html" is there since long time ago. I'm sure that more than once happened that the player played two songs together, it happened to me on MacOS (I would say only with chrome but I'm not 100% sure) and happened at least to one other user (linux,chromium).
What happens is very weird: you have the control on a song but not on the other so for example if you mute the volume just one song is muted. It doesn't happen often but it happens and every time I got an e_url error on the first song so my guess was that jPlayer thought there was an error, skipped to the next song and played it but actually the first song in some way arrived to the player and starts being played together with the second.

I haven't find any way to reproduce the error on purpose. 

OK, wait, just right now happened again: two songs played at the same time, I had the developers network tool enabled in chrome so I can give you more details: it is very strange, the response of the server for the song was normal

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private
Content-Disposition: inline; filename="bla bla blah....mp3"
Content-Type: audio/x-mp3
Date: Mon, 24 Oct 2011 17:16:08 GMT
Server: Microsoft-IIS/6.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Content-Length: 715466
Connection: keep-alive

but if I look at the status from the main page of the tool I can see a "failed". I posted the link to a screenshot here http://mentor.fm/error.png ... the url correspondant to "failed" is exactly the one the starts playing together with the following one in the playlist. For that track I also received as usual an email "e_url error Media URL could not be loaded" as usual.

Any clue? :)

Thanks again.

Eugenio

Mark Panaghiston

unread,
Oct 25, 2011, 6:43:40 PM10/25/11
to jpl...@googlegroups.com
With the flash solution, when a URL error occurs, the JavaScript actually resets the flash for another try. It's error handler does a setMedia on the current media in jPlayer's status so that in the normal way you can press play again and it will retry the media URL. This made the Flash mimic the HTML5 media solution, which allowed you to spam play and it would keep trying.

You are changing the media yourself in the error event handler... I do not see why this would cause a problem with the Flash, as your setMedia from the playlist would come after the URL error event media reset on the Flash. My mind boggles as to how the Flash can play 2 media at a time and orphan one of them. Setting the media destroys any old media in the Flash.

It does sound like something is up though. So maybe there is a bug in the system for a niche like this where the url fails and the suddenly works again.

My only suggestion right now is that you add a clearMedia command into your error handler to ensure the media is cleared before you change the playlist. I actually think that it might make will not make any difference, but try it and see.

The other thing to consider is that errorAlerts might screw things up. The alerts can mess with some operations. Early in 2.0.0 patches, there was a problem with the alerts causing the Flash to not work in the page. Wondering if it is related.

Eugenio

unread,
Oct 25, 2011, 10:31:49 PM10/25/11
to jpl...@googlegroups.com


On Tuesday, October 25, 2011 3:43:40 PM UTC-7, Mark Panaghiston wrote:
With the flash solution, when a URL error occurs, the JavaScript actually resets the flash for another try.

Just to be 100%, is there a way to make the player show up which solution is using?
 
It's error handler does a setMedia on the current media in jPlayer's status so that in the normal way you can press play again and it will retry the media URL. This made the Flash mimic the HTML5 media solution, which allowed you to spam play and it would keep trying.

Ok, that could be a reason for one problem: I'm receiving error messages but I'm pretty sure that just a few of them involve the 
contemporary play of two different songs. So maybe sometime I receive an error because the player tries twice before succeeding.

A few time I also received this error
"Attempt to issue media playback commands, while no media url is set.play Use setMedia() to set the media"
is it in some way related?
 

You are changing the media yourself in the error event handler... I do not see why this would cause a problem with the Flash, as your setMedia from the playlist would come after the URL error event media reset on the Flash. My mind boggles as to how the Flash can play 2 media at a time and orphan one of them. Setting the media destroys any old media in the Flash.

Yes, it happend at least to two users, and always with chrome (but could have been happened with other browsers too, I don't know).
Do you think that something like this cannot happen:
1 - an error occured
2 -  I skip to the next song and a new media is set and the play start
3 - the player tried again for the first song, succeeds and set the media and starts playing
?

It does sound like something is up though. So maybe there is a bug in the system for a niche like this where the url fails and the suddenly works again.

My only suggestion right now is that you add a clearMedia command into your error handler to ensure the media is cleared before you change the playlist. I actually think that it might make will not make any difference, but try it and see.

ok; what does this mean exactly?
"Using this clearMedia by itself on the iOS iPhone or iPod Touch will corrupt the built in video player if it is open at the time the command executes."
 
The other thing to consider is that errorAlerts might screw things up. The alerts can mess with some operations. Early in 2.0.0 patches, there was a problem with the alerts causing the Flash to not work in the page. Wondering if it is related.

I'm not using errorAlerts, I'm sending errors via email.


Cheers,

Eugenio
 

Eugenio

unread,
Oct 27, 2011, 4:05:29 PM10/27/11
to jpl...@googlegroups.com
It has just happened again, a user wrote me that the player started playing two songs together and the control on the volume on one of them was lost.
Again, even with this new user, the browser is chrome.

Eugenio

Eugenio

unread,
Nov 3, 2011, 7:39:50 PM11/3/11
to jPlayer: HTML5 Audio & Video for jQuery
Anyone has some clues?
The problem still happens sometime and I don't really know how to
debug it.

Eugenio

Eugenio

unread,
Nov 10, 2011, 3:12:50 PM11/10/11
to jPlayer: HTML5 Audio & Video for jQuery
Hi all,
I'm becoming crazy with this problem :(
During the last days the response time of my media server for some
reason increased and this "double song" problem became more frequent,
I guess the problems could be related.
Does anyone at least can help me trying to understand how to debug the
problem?

Thanks

Eugenio

On 3 Nov, 15:39, Eugenio <eugenio.tacch...@gmail.com> wrote:
> Anyone has some clues?
> The problem still happens sometime and I don't really know how to
> debug it.
>
> Eugenio
>
Reply all
Reply to author
Forward
0 new messages