Page 1 of 1

Pay per view script

Posted: Sat Aug 22, 2009 9:42 am
by narh
Hi All,

I'm looking for a php script to help me track how long a user watches a streaming video. I am looking to use a simple php flv streaming player to play the videos so no expensive windows streaming server.

The idea is, when the user clicks the video to watch I will know their user id and video id from the database. No problem. I can check if they have credit etc...easy!

But how do I track how long they are viewing the video remembering they could close the window, jump to another page, stop the video? Once I know how long they have viewed the video I can update their account.
I tried searching online but only found one php script for adult chat pay per view...not want I'm looking for.

So any ideas will be much appreciated.
Thanks

Re: Pay per view script

Posted: Wed Aug 26, 2009 12:35 am
by paqman
Well PHP is server side, so it only executes each time the user refreshes their page, or goes to another page. You could use AJAX to update their account every time interval quite easily, but if the user disables Javascript they'll be able to watch and you won't have a clue how long they are watching. I'm not sure there's an easy way to do this