Every second counted
A video analytics engine that computes watch time from evidence, not a number you take on trust.
Interactive preview · sample data
Overview
Last 30 days
Unique watch time
12,482h
+18.4%
Top content
Unique hours- Designing for trust3,284h
- The first 90 seconds2,410h
- Inside the write path1,982h
A watch-time engine
Not just a counter
Watchline turns playback events into reliable watch-time metrics. It tracks which parts of a video were watched, how much was rewatched, and how long someone spent watching.
The client collects evidence. The server computes the numbers, handles retries, and keeps a log so every total can be audited or rebuilt.
It works alongside your video player. This site demonstrates the UI; the repository contains the engine and APIs.
How the pieces connect
Playback events
Client ranges + durable outbox
Server validation
Check bounds + remove duplicates
Evidence + totals
Saved together in one transaction
Read & repair
Query totals, audit, rebuild
An optional broker handles event delivery after the write. It never decides whether watch time counts.
See how it worksBuilt for imperfect playback.
- Go offline. Resume later.
- A durable client outbox queues playback evidence for delivery. Request and segment keys keep retries from adding extra credit.
- Rewatch without inflating completion.
- The server merges overlapping ranges. A repeat counts toward total watched, not as new content watched.
- Check a number. Rebuild if needed.
- The append-only log keeps the evidence behind every total. Audit for drift, preview a repair, then apply and verify it.
Watch 0–20s, then 10–30s of a 60-second video.
- Total
- 40s
- Unique
- 30s
- Rewatch
- 10s
Illustrative example · 50% completion, not 67%.
Built with purpose.
TypeScript
Shared types across the client, API, and engine.
Next.js
Pages and API routes in one application.
React
Interactive previews and the watch-time lab.
Tailwind CSS
Responsive layouts with shared design tokens.
SQLite
Evidence and totals saved in one transaction.
Apache Kafka
Optional event delivery; in-memory broker by default.
Know what you’re measuring.
Four metrics. Distinct meanings. Completion is the share of the video watched at least once.
Try the watch math- Unique watched
- Each part of the video, counted once.
- Total watched
- All accepted playback, including rewatches.
- Rewatch
- Total watched minus unique watched.
- Engaged wall clock
- Accepted time spent watching, independent of playback speed.
A few useful answers.
Follow the evidence.
Explore the architecture, then read the code behind it.
See a heartbeat request
const res = await fetch("/api/analytics/heartbeat", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({ identity, segments }),
});Example request · not sent from this demo.