First of all, as the documentation points out, you can't set an event handler until JW Player is ready for it. If you set it too early, it won't work, and you won't even get an error message. If you have a function called playerReady, it'll automatically be called by JW Player. That's a great place to setup your handlers.
Next, when JW Player calls playerReady, it's supposed to pass an obj containing the ID for the HTML DOM object. In my experience, it doesn't. Hence, you have to lookup the object manually. See my previous post about the fact that you can't use jQuery's $() to lookup the object, but should instead stick with document.getElementById.
Last of all, remember that when you give JW Player your JavaScript callback, you have to pass the function's name as a string. It feels natural to pass a function pointer or even to have an inline function, but that doesn't work (nor will you get an error message).
In summary, here's the code:
function playerReady(obj) {
document.getElementById('player-embed').addModelListener(
"TIME", "handleTimeEvent");
}
function handleTimeEvent(e) {
console.log(window.timeEvent.duration);
console.log(window.timeEvent.position);
}


