February 19, 2005

db updates and onunload

bear with me as i sidestep this absurd ffmpeg-php installation and all its woes and think about 1 more piece. im just throwing this up so i can find these notes later; avoid this if you dont care about me thinking through a small little block of (complex) code.

so.

what i want is to keep track of when people click a thumbnail on the page. because if they click it, they want to watch that segment. which means they found it interesting somehow. so i can create an array in javascript of timecodes. actually, it can be a string. everytime you click an image, the 'onclick' is fired, calls a javascript function that adds that timecode to the string.

then, when 'onunload' is fired, another javascript function is called. this one loads a php file in a hidden iframe that updates the database. all we want is for each timecode to include a counter. (the db will have a primary key, the movie id, the time code and a counter. this could get pretty large.)

so why?

because then we can display the thumbnails based on interest. say a scene has 5 clicks registered with it. then we want to display that thumbnail over one with 1. though this sounds dangerous over time if weighted unfairly, i think thats just a balancing act and a set of ratios.

this way, we can track overall habits/interests of the viewers and turn around use that data invisibly to provide automated 'highlights'.

(between this bit and the ffmpeg-php, looks like the entire system will require a rewrite in a week or so. or basically as soon as ffmpeg-php is running correctly. whee iteration!)

Posted by tripp at February 19, 2005 10:14 PM



Comments

Post a comment




Remember Me?