Pay per view script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
narh
Forum Newbie
Posts: 1
Joined: Sat Aug 22, 2009 9:20 am

Pay per view script

Post 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
User avatar
paqman
Forum Contributor
Posts: 125
Joined: Sun Nov 14, 2004 7:41 pm
Location: Burnaby, BC, Canada

Re: Pay per view script

Post 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
Post Reply