@streamscloud/streams-analytics-collector 1.0.7 → 1.0.9

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
- pageVideos.set(`${videoId}|${streamId || ''}`, playedPercents);
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
  /**
@@ -210,13 +215,14 @@ class AppEventsTracker {
210
215
  };
211
216
  // Add organization and profile IDs for non-authorized calls if they exist
212
217
  if (!this.useClient) {
213
- if (this.organizationId) {
214
- input.organizationId = this.organizationId;
215
- }
216
218
  if (this.profileId) {
217
219
  input.profileId = this.profileId;
218
220
  }
219
221
  }
222
+ // Add organization ID if it exists
223
+ if (this.organizationId) {
224
+ input.organizationId = this.organizationId;
225
+ }
220
226
  // Choose between client and direct endpoint modes
221
227
  if (this.useClient) {
222
228
  if (!this.client) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/streams-analytics-collector",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -14,22 +14,6 @@
14
14
  "./analytics": {
15
15
  "import": "./dist/analytics/index.js",
16
16
  "types": "./dist/analytics/index.d.ts"
17
- },
18
- "./data-loaders": {
19
- "import": "./dist/data-loaders/index.js",
20
- "types": "./dist/data-loaders/index.d.ts"
21
- },
22
- "./components-data": {
23
- "import": "./dist/components-data/index.js",
24
- "types": "./dist/components-data/index.d.ts"
25
- },
26
- "./services": {
27
- "import": "./dist/services/index.js",
28
- "types": "./dist/services/index.d.ts"
29
- },
30
- "./components": {
31
- "import": "./dist/components/index.js",
32
- "types": "./dist/components/index.d.ts"
33
17
  }
34
18
  },
35
19
  "files": [