Re: jPlayer stops playing after an arbitrary amount of time (Chrome 21.0.1180.79)

2,771 views
Skip to first unread message

Karl Karlsen

unread,
Oct 5, 2012, 5:40:34 AM10/5/12
to jpl...@googlegroups.com
Hi,

Did you give it a try? Did it change anything? :)

On Friday, September 28, 2012 10:25:48 AM UTC+2, Marko Tukiainen wrote:
I've been having the same problem, but with mp4 video playback. I have a web application that plays mp4 videos from start to finish and then switches to the next one. Subsequent calls are made simply with calling jPlayer("play"). It works great, except that after a random amount of time (could be minutes, hours, days or never) the videos will no longer play. Instead the console shows the error "Failed to load resource" and the mp4 file name, and there's obviously no video playback happening. This occurs both on Windows and on Linux. 

I did run across this thread: http://code.google.com/p/chromium/issues/detail?id=144113 which suggests that if Keepalive is off on the server (as it is in my case) then these errors may show up. There didn't seem to be any conclusive answer, however I'm going to give it a try and see if it changes anything. 

Also, could this exception / error be caught using javascript, so that something could be done to retry loading the video?

Marko Tukiainen

unread,
Oct 5, 2012, 8:09:48 AM10/5/12
to jpl...@googlegroups.com
I did, but I haven't gotten anything conclusive out of it. So far the videos have kept on playing, however I did change my code a bit as well. I'm going to leave a couple of clients on for a few days and see if they get stuck. 

Marko

Matthew Crider

unread,
Oct 29, 2012, 9:33:01 PM10/29/12
to jpl...@googlegroups.com
I'm seeing this a lot too (and randomly) on Flapcast.com.  Is there a way to cache the whole audio file?  It seems that jPlayer only buffers a bit of the audio stream and I'm thinking continuous requests to the server hosting the audio file causes the server to eventually stop sending data.  But I'm not 100% on that..

-Matt

On Sunday, August 19, 2012 11:21:02 PM UTC-10, Karl Karlsen wrote:
Hi,

We're using jPlayer on this site, among others. We've been getting reports lately that the player stops after a couple of minutes when using Chrome.

I tested it, and it stopped 4 minutes 57 seconds in. The console shows 

Is this an error with the player, or the server setup? If it's the latter, what can we do to fix it?

Mark Panaghiston

unread,
Oct 30, 2012, 8:13:18 AM10/30/12
to jpl...@googlegroups.com
In this case jPlayer will be using an <audio> element to play the audio, or <video> or video, and jPlayer itself does not do any thing past using the W3C Media Element API Spec... As in, for the HTML5 solution, it creates the media element, sets its SRC to an appropriate format and then plays it.

In Chrome I have noticed that it seems to download on demand more than other browsers. As in, most standard browsers appear to download the whole media file after it has been requested. Yes, they will handle range requests if you jump ahead of the buffered point. With Chrome it seems to download/buffer the next minute or so with a little hysteresis so that the buffer dropping to say 30s buffer triggers it to buffer up to 60 sec again.

There is the preload:"auto" option. It is a hint to the  browser and maybe this hint will make Chrome download the whole file.

Trevor Squillario

unread,
Apr 17, 2013, 11:28:59 AM4/17/13
to jpl...@googlegroups.com
Yea I've been running into this issue for as long as I can remember with MiniSub (https://github.com/tsquillario/MiniSub) I've switched sound libraries too, using jPlayer currently tho. As a workaround I modified the error event to restart the file from the current time and it has been working pretty well, there is a very short blip in the stream but it keeps going which is the desired result.

        error: function(event) {
            var time = $(player1).data("jPlayer").status.currentTime;
            $(player1).jPlayer("play", time);
        }

poompah

unread,
Nov 18, 2013, 6:07:39 AM11/18/13
to jpl...@googlegroups.com
Thats an elegant workaround Trevor.

I was trying to find a way to force the download using Ajax. This actually does work to a degree -- but what seems to happen is the play STILL stalls (even with preload set to "none").
What I found was by downloading the mp3 first the play could be restarted and plays without a problem. Your code allows the play to fail and then restart without any user interaction or having to jump back to the start.
Using your code alone the stalling and restarting may happen several times during play -- which is not ideal -- as chrome still has a problem calling the entire file.

What I have done is put in a chrome-specific Ajax call immediately after jPlayer is initiated (with your code included):

$(window).load(function(){
    var is_chrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1;
    if (is_chrome) {
$.ajax("audio.mp3")
    }
});

FOR KEVIN
Trevors code is added immediately after the other options in your jPlayer initialization call -- so like this:

    $(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
   ready: function () {
$(this).jPlayer("setMedia", {
   mp3: "audio.mp3",
   ogg: "audio.ogg"
});
   },
   swfPath: "/js/",
   supplied: "mp3, ogg"
here--->
});
    });

Just next to where is says "here---->"

Mark Panaghiston

unread,
Nov 18, 2013, 2:03:26 PM11/18/13
to jpl...@googlegroups.com
Interesting...

I'd use this code as it is more generic, without IDs and using the event object since it is available:

error: function(event) {
   var time = event.jPlayer.status.currentTime;
   $(this).jPlayer("play", time);

HariSuresh Dosapati

unread,
Dec 2, 2013, 2:15:41 PM12/2/13
to jpl...@googlegroups.com
Having the same problem with jPlayer using Chrome.

Video stops after a while, tried the error handler function and the its not working good.

Would like to understand, is this a issue with Chrome or Video Hosting server ?

I see the demo videos are playing nice - http://jplayer.org/latest/demo-03-video/

how come those videos work and not ours , when we integrated with in our application?

Any ideas and suggestions are appreciated.

Jasper Lingers

unread,
Mar 19, 2014, 6:32:41 AM3/19/14
to jpl...@googlegroups.com
I got the same problem with video playback.
I look at the backend, seeing the file is being downloadedn.
When the download is done, eventually the playback stalls.
I tried your fix with the timer to play it again at the moment it stalled, but this is just fricking annoying.
It happens too fast and such, why is the software not speed-limiting the buffering for example, or let stand keep playing after the buffering of the whole file is done ?
This happens with and without HTTP_RANGE option enabled or disabled....

Jasper Lingers

unread,
Mar 19, 2014, 6:43:42 AM3/19/14
to jpl...@googlegroups.com
Used a default Mp4 file via direct NGINX with MP4 module enabled and disabled.
Default configuration of your demo, but still doing the same as my system.
jPlayer just stalls after buffering of the file is completely done, and the connection is broken for buffering.
Something tells me this is a huge bug and needs to be addressed imho.

The timer fix that has been given up, does work, but will not when your close to the ending, it keeps stalling every few seconds, horrible...
Please let me and others know what else we could try, like, is there not a way to only let it buffer what is needed, or a "download limiter" or something ?
Maybe make it so that it keeps playing even though buffering was done ?

Jasper Lingers

unread,
Mar 19, 2014, 7:22:54 AM3/19/14
to jpl...@googlegroups.com
Tried it with jPlayer 2.5.5, same problems.
Flash seems to be ok with it.
When the buffering is completed, it keeps playing till the end, so something is up with HTML5 version in combination with when buffering is done.

Mark Panaghiston

unread,
Mar 19, 2014, 7:51:47 AM3/19/14
to jpl...@googlegroups.com
You should compare how Chrome plays the media when accessed directly. jPlayer does not really do much other than put a wrapper around the html player in the browser allowing you to make your own GUI and to issue commands to change the media and so on.

If Chrome has the same problems when accessed directly, then it must be something about either the media encoding or the server response that Chrome does not like.

Jasper Lingers

unread,
Mar 19, 2014, 8:16:49 AM3/19/14
to jpl...@googlegroups.com
Good point.
I will test it on FireFox too.

Video encoding is not the problem.
This works fine, and since Im a pro video encoder, I doubt my test-encodes have trouble ;)

I will look into using other browsers, maybe indeed a Chrome problem.

Jasper Lingers

unread,
Mar 19, 2014, 8:19:25 AM3/19/14
to jpl...@googlegroups.com
Another update.
Tested in FireFox.
The difference I notice from Chrome and FF, is that Chrome shows the suspend event triggered a lot on the inspector.
Video playback goes further properly, not seeing any interruptions with FireFox, so this looks like a Chrome problem.

Can we address this problem to chrome ?
Or should I try to post about it ?

Jasper Lingers

unread,
Mar 19, 2014, 10:22:22 AM3/19/14
to jpl...@googlegroups.com
Here comes another update after testing.
I have now in use a transcoder that transcodes MP4/MKV to WEBM.
Now Flash wants to use HTTP_RANGE properly, which is a positive thing.
But sadly, I figured also out the same video playback stopping happens also with the FLASH variant in Chrome.
I am going to test it now out again in FireFox to see if the Flash and HTML variant keeps playing the file after it completed buffering fully (complete file transfer).
Now I am really concerned that both the HTML5 and Flash players have a bug in Chrome only, which is awkward at the most.

Will let you know.

Jasper Lingers

unread,
Mar 19, 2014, 10:27:42 AM3/19/14
to jpl...@googlegroups.com
And I conclude here.
Chrome is the problem that video/audio playback after completing buffering, that is quits playing after a bit.
FireFox works both in Flash and non-Flash properly, playing WEBM format without problems.
Now I will test Internet Explorer, but yah, this isn't looking good for Chrome :/

Jonathan2

unread,
Mar 19, 2014, 10:43:14 AM3/19/14
to jpl...@googlegroups.com
I know that this has piggybacked onto an old thread and so you're probably using a later version than the 21.0.1180.79 mentioned in the subject, but I do want to check you are on AT LEAST current, stable version 33.0.1750.154 of Chrome. See http://googlechromereleases.blogspot.co.uk/

Jasper Lingers

unread,
Mar 19, 2014, 11:26:17 AM3/19/14
to jpl...@googlegroups.com
I did test it on that version yes.
Latest Chrome version still has the problem.

Jasper Lingers

unread,
Mar 20, 2014, 7:28:54 AM3/20/14
to jpl...@googlegroups.com
I checked out several players.
Projekktor also seems to be affected.

I did come across JWplayer who didn't seem to be affected.
From what I read, they use a suspend-function that prevents the buffer completely filled at ones, some kind of speed limiting the downloaded data, but I'm not sure how they can do this as you said, html5 is only being wrapped.
Google hasn't been responsive about this problem I have determined, so I'm kinda unsure what to do further.

Cheers.

Mark Panaghiston

unread,
Mar 20, 2014, 4:53:56 PM3/20/14
to jpl...@googlegroups.com
Just a couple of technical points @Jasper...

WebM format cannot play in Flash. Both Chrome and Firefox can play WebM in HTML5 natively. Google bought all the rights to WebM and then said anyone could use it!

Flash cannot support the RANGE requests.

Jasper Lingers

unread,
Mar 21, 2014, 8:24:11 AM3/21/14
to jpl...@googlegroups.com
Yes, I got that understanding.
Im transcoding now all original files to a streamable (header at start), and fixed bandwidth speed format (MP4).
The playback of the video stops after the player completed downloading the file.
This happens both in Chrome stable and Chrome BETA (Version 33.0.1750.154 beta-m)
It's really awkward, since I don't have this issue with FireFox and Internet Explorer.
Reply all
Reply to author
Forward
0 new messages