
Trouble disableling default play/pause on click - JW7+AngularJS
Hi,
I want to disable the default behavior in which the mouse click toggles between play and pause.
Unfortunately, I am not sure if my issue has to do with JWPlayer or with the fact that I am using it within AngularJS.
I am using the following directive
https://github.com/ampervue/ngJWPlayer/blob/master/src/jwplayer.directive.js
where inside the _renderJWPlayerElement function, and after the player.setup, I want to add:
player.on('click', function(event) {
var currentTime = player.getPosition();
$log.log('click', event.clientX, event.clientY, currentTime);
// Do something here
// Try to disable default behavior with
// BEGIN: NOT WORKING
event.preventDefault();
// END: NOT WORKING
});
But the event.preventDefault() produces the following error:
There was an error calling back an event handler for "click". Error: Illegal invocation
and I still get the default behavior.
Any help will be appreciated. Thanks,