Posted on: 2/9/2014 8:08:30 PM | Views : 708

I am trying to build a website that will play videos and  I am trying to figure out, how to keep track of the current time of the video when the user has closed the browser window.
I am using flowplayer and I wrote the followng functio. but this function is not firing up when I close the window. later I found that unload function is depricated.
I watch videos on netflix and pluralsight website. Any idea how these websites store how much video the user has watched. 
I am tyring to create a solution similar to pluralsight but diffferent content.
Thanks for your help. 
$(window).unload(function () { var api = flowplayer(), currentPos; // get the current position, default to 0 currentPos = api.ready ? api.video.time : 0; console.log(currentPos.toString()); $.ajax({ type: "POST", ...

Go to the complete details ...