HACKER Q&A
📣 arunnanda

Tracking video player viewer statistics


As part of an embeddable video player I'm starting to build, I need to have some way of keeping track of viewer behavior.

The easy way is to integrate something like Mux (YC Winter 2016). The even easier way is to just use an existing player like video js. But I want to start off by building my own solution.

I have the basic player working (still some race conditions to be resolved), so now I am starting to look at tracking viewing behavior. I need to know things like timestamp till which a viewer has watched the video, at what timestamps they paused/played/forwarded it, when they wanted to seek to an earlier time and rewatch a part of it, etc. etc.

Say I start a timer when the viewer presses play. Then for each (milli)second I can check the timestamp of the video - this will let me track if some parts of the video were replayed or fast forwarded. Whenever the viewer presses play/pause/forward, I record the event. I send this info to the server every 1 or 2 or 5 seconds and do the analytics.

Since I haven't done this sort of thing before, I would love to have some inputs on if this ^ is the right approach.

Does it make sense to treat this data as a timeseries data? If not (even if it is), what else is a good way to organize this data?

I assume something like Cassandra (which I haven't used much) is much better suited for this than Postgres (which I am comfortable with). Is this right?


  👤 trasz Accepted Answer ✓
>As part of an embeddable video player I'm starting to build, I need to have some way of keeping track of viewer behavior.

Wrong.