Question

I'm not sure what this could be... it's kind of hard to debug.

Basically when using jPlayer, each track ends a few seconds too early (mp3 format only).

I'm using S3/Cloudfront CDN for distribution, but I don't think that has anything to do with it (unless there is some weird header issue that could create symptoms like this). Ive tried it on about 5 different mp3's so far, all to the same effect.

Also, the .progress-bar doesn't get to 100% either, it ends at about 95% and then goes to the next playlist item.

var fnmApp = (function() {

    var player = function() {

        var options = {
            swfPath       : '<%= asset_path 'Jplayer.swf' %>'
          , supplied      : 'mp3'
          , solution      : 'html,flash'
          , wmode         : 'transparent'
          , smoothPlayBar : false
        };

        var fnmPlaylist = new jPlayerPlaylist({
            jPlayer: '#fnmp'
          , cssSelectorAncestor: '#fnmp-container'
        }, mixtapePlaylist, options); 

        $('.fnmp-container .jp-gui a').click(function(e) {
            e.preventDefault();
        });
    };

    return {
        player: player
    };

})();
Était-ce utile?

La solution

Streaming MP3 files over HTTP is a bit problematic because it isn't typically possible to know how big that file is (in time or samples) until it is completely downloaded, and frames counted. Most players get around this by estimating time and then either updating that estimate as playback continues or simply rolling past the end of the file, should there still be data to play even after the original estimated length.

It sounds like what is happening is that the original estimated length is being used for the playback length. This is likely a bug with whatever is playing back audio, or the codec it is using. With jPlayer, you could be using either Flash or the browser via HTML5 for playback. Since forcing Flash over HTML5 is working in your case, I believe this is a bug in the build of Chrome that you are using. Unfortunately, there is no direct way to fix this problem, since it is out of your control. You can only work around it.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top