jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

Error events not triggering in Flash fallback #219

Closed nebulousGirl closed 9 years ago

nebulousGirl commented 10 years ago

The error events don't trigger in the Flash version. HTML5 works just fine.

Here's my code:

this.$player.jPlayer({
        ready: function() {},
        error: function(event) {
             console.log('Error!');
        },
        swfPath: "/assets/jquery/jPlayer",
        supplied: "mp3",
        solution: "flash, html",
        smoothPlayBar: true,
        keyEnabled: true,
        cssSelectorAncestor: '#jp_container',
        errorAlerts: false,
        warningAlerts: false,
        cssSelector: {
            title: '.jp-current-track'
        }
    });
JQ-Yang commented 10 years ago

edit jquery.jplayer.js line 1479 from

this.element.trigger(event);

to

var self = this;
setTimeout(function(){self.element.trigger(event);});

I think it will be work

nebulousGirl commented 10 years ago

It was not related to the code base. My music file was being redirected with a 302 status that the html version was not able to read and hence, displayed the error message.

However, the Flash version was still reading the file even though it was not valid a valid file... So, it seems to be a glitch with the SWF.

thepag commented 9 years ago

The flash error message tells you if the url was valid. If your fail url gave a 404 error then it would understand. Maybe your site 404 page is pretty and you forgot to add the 404 code to header.