Apparently, media events (those related to audio or video, such as play , pause , timeupdate , etc.) do not become bubbling. You can find an explanation for this in the answer to this question .
Therefore, using my solution, I captured the timeupdate event,
$.createEventCapturing(['timeupdate']); $('body').on('timeupdate', '.audioPlayerJS audio', updateTime);
code for capturing an event (taken from another SO answer):
$.createEventCapturing = (function () { var special = $.event.special; return function (names) { if (!document.addEventListener) { return; } if (typeof names == 'string') { names = [names]; } $.each(names, function (i, name) { var handler = function (e) { e = $.event.fix(e); return $.event.dispatch.call(this, e); }; special[name] = special[name] || {}; if (special[name].setup || special[name].teardown) { return; } $.extend(special[name], { setup: function () { this.addEventListener(name, handler, true); }, teardown: function () { this.removeEventListener(name, handler, true); } }); }); }; })();
source share