@streamscloud/streams-analytics-collector 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -58,9 +58,14 @@ class AppEventsTracker {
|
|
|
58
58
|
this.videosByPage.set(pageId, new Map());
|
|
59
59
|
}
|
|
60
60
|
// Update the played percentage for this video on this page
|
|
61
|
+
// Only store the maximum percentage in case of looping videos
|
|
61
62
|
const pageVideos = this.videosByPage.get(pageId);
|
|
62
63
|
if (pageVideos) {
|
|
63
|
-
|
|
64
|
+
const videoKey = `${videoId}|${streamId || ''}`;
|
|
65
|
+
const currentMaxPercent = pageVideos.get(videoKey) || 0;
|
|
66
|
+
// Store only the maximum played percentage value
|
|
67
|
+
// This ensures we don't decrease progress when video loops
|
|
68
|
+
pageVideos.set(videoKey, Math.max(currentMaxPercent, playedPercents));
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
/**
|