views:

15

answers:

1

Hi all,

I need to make a video viewed counter. I have .MOV files using embeded/Object tags and application is ASP.NET. Is there any way that I can count hits on the videos using Jquery?

A: 

Cant you attach a javascript event handler to the div that only contains the video. When that area is clicked on increase a counter by 1 and only allow that function to be triggered once per page lifecycle. I expect when you trigger the function you will need to make an AJAX request to update a database or something by 1 and then remove the old counter using the dom, append the new value.

Jonathan Stowell
good idea. Thanks
Tam
but how can I get name of the video with this method? Any ideas? there are few pages where there will be many videos.
Tam
Sorry been at Glastonbury for the last week. If you wrap the embedded movie tags in div tags give it an id and then you can get that div using JQuery and just attach a click handler to it. To get the name of the video you could even use the videos name as the div id perhaps.
Jonathan Stowell