List all views including watch duration, country etc

How can I get a list containing all details for a video’s view session?
I want to know for how long a viewer has watched a video etc. How many viewers have watches at least 50% of my video? How many have watched more than 95%?

My ideal API response would be something like this.

views: [
    country: 'US',
    browser: 'Safari',
    watchDurationSec: 100,
    startedAt: ...,
    endedAt: ... 
], 
[
    country: 'IT',
    browser: 'Edge',
    watchDurationSec: 10,
    startedAt: ...,
    endedAt: ... 
],
...

We are currently using mux.com where such a list can be retrieved, but mux.com sucks and we’d like to switch over to Cloudflare Stream.

Hi there, we currently don’t have a way of providing per-viewer analytics. However, this is something we are actively working to provide.

The one workaround (until we have an out of the box solution) would be to use the Stream Player API to collect the analytics yourself on the client-side and pass it directly to your backend. Here is a demo that uses our Player API to provide seconds of video watched: https://codepen.io/cfzf/pen/PobOEzq

Hey @matthias-lang you’re asking good questions. We do have this kind of per-view data on our servers and we use it to calculate graphql analytics but we don’t provide it externally because we haven’t yet seen a great use of it. We’d rather provide opinionated and useful information rather than a firehose. @Zaid’s example is a great way where you can collect the right information you want in the right level of accuracy and granularity for you.

Let me ask you another question to add to what @zaid said so we understand what you’re building better and point you the correct direction: What questions are you trying to answer with this data?

How many viewers have watches at least 50% of my video? How many have watched more than 95%?

Would it work for you if we provided this data for you via an API call where we return the numbers directly to you?

What are some other statistics you expect to derive from per-view data?