I am trying to detect click event on mediaelement pause button
var player = new MediaElementPlayer('.player_1');
$('body').on('click', '.mejs-pause', function (e) {
$('.items').append('<li>paused</li>');
});
I also tried with mejs-pause button
and few other combos but cant detect the event .
Any help is appreciated
You need to add an event
listener to MEJS initialization script on success
setting like :
var player = new MediaElementPlayer('.player_1', {
success: function (mediaElement, domObject) {
mediaElement.addEventListener('pause', function () {
// do something here
$('.items').append('<li>paused</li>');
}, false);
}
});
See your forked JSFIDDLE