Hi Doug,
I am continuing to prepare some logic on how to understand recorded video events to correctly calculate the time a user spent on a video viewing. It means in both variants, either using a separate browser tab (always with a new session identification) or as a modal dialog inside the same browser tab (with a different private token, but with the exact session identification and when “endedAt” property is updated even after many hours of break between two separate viewings, using two different private tokens).
The problem is that when opening a video, starting its viewing, and closing the browser tab, all during the first 10 seconds, the properties loadedAt
and endedAt
on the AnalyticVideo level have the same value. (I don’t know the exact time limit, it seems to be more than 10 secs but less than 20 secs.)
loadedAt: 2021-02-07T18:05:12.000Z
endedAt: 2021-02-07T18:05:12.000Z
Details on the video session events look like the following example. You can see that there is only the event type ready
. The problem resume is that it’s impossible the determine how long the video was played or even if it was starting that play at all.
AnalyticSessionEvent {
session: AnalyticSession {
sessionId: 'ps65u0rQwccDnQ08wCcaLG5W',
loadedAt: null,
endedAt: null
},
resource: AnalyticResource { type: null, id: null },
events: [
AnalyticEvent {
type: 'ready',
emittedAt: 2021-02-07T18:05:12.000Z,
at: 0,
from: null,
to: null
}
]
}
When the browser tab is closed is a bit later (or minutes/hours later), you can see that there is a difference between loadedAt
and endedAt
. It looks like that the difference is approximately equal to the time the video was viewed.
loadedAt: 2021-02-07T23:35:45.000Z
endedAt: 2021-02-07T23:36:46.000Z
Details on the video session events look like the following example. You can see that there is the event type ready
and play
, but the time difference between them is tiny. The problem resume is that it’s impossible to determine how long the video was played, even if it was many minutes. It’s a bit of mystery what was the moment that was used to update the property “endedAt” to the value of 2021-02-07T23:36:46.000Z when there is no corresponding event for it.
AnalyticSessionEvent {
session: AnalyticSession {
sessionId: 'ps7DOzsitdNBKsUgoE5jh4Pw',
loadedAt: null,
endedAt: null
},
resource: AnalyticResource { type: null, id: null },
events: [
AnalyticEvent {
type: 'ready',
emittedAt: 2021-02-07T23:35:45.000Z,
at: 0,
from: null,
to: null
},
AnalyticEvent {
type: 'play',
emittedAt: 2021-02-07T23:35:46.000Z,
at: 0,
from: null,
to: null
}
]
}
Both cases complicate the correct calculation of the elapsed viewing time.
Milos