The player is probably undefined because it has not been created yet. You must wrap your command in a callback from a ready-made DOM listener. Since you are using jQuery, you can use your .ready () ( jQuery ) method :
$(document).ready(function(){
jwplayer().onPlay(function() {alert('it has started'});
});
jwplayer onPlay(), , , , . , .