@24i/bigscreen-sdk 1.0.51 → 1.0.53

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/bigscreen-sdk",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "SmartApps BIGscreen SDK monorepo",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,7 +7,7 @@ export const mapAdLoaded = (triggerName: AnalyticsTriggers, payload: Payload): A
7
7
  action: triggerName,
8
8
  event_trigger: triggerName,
9
9
  thing_id: payload.assetId || '',
10
- attribution_id: payload.attributionId || null,
10
+ attribution_id: payload.attributionId || '',
11
11
  player_advertisment_name: '', // TODO: adPayload?.adName,
12
12
  player_advertisment_position: 0, // TODO: adPayload?.adPosition,
13
13
  });
@@ -10,7 +10,7 @@ export const mapAdSkipped = (
10
10
  action: triggerName,
11
11
  event_trigger: triggerName,
12
12
  thing_id: payload.assetId || '',
13
- attribution_id: payload.attributionId || null,
13
+ attribution_id: payload.attributionId || '',
14
14
  player_advertisment_name: '', // TODO: adPayload?.adName,
15
15
  player_advertisment_position: 0, // TODO: adPayload?.adPosition,
16
16
  });
@@ -10,6 +10,6 @@ export const mapBuffering = (
10
10
  action: triggerName,
11
11
  event_trigger: triggerName,
12
12
  thing_id: payload.assetId || '',
13
- attribution_id: payload.attributionId || null,
13
+ attribution_id: payload.attributionId || '',
14
14
  source_page: payload.sceneName,
15
15
  });
@@ -1,6 +1,6 @@
1
1
  import { SECOND_IN_MS } from '@24i/bigscreen-sdk/utils';
2
2
  import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
3
- import { EVENTS, HUNDRED_PERCENT } from '../constants';
3
+ import { DefaultScreens, EVENTS, HUNDRED_PERCENT } from '../constants';
4
4
  import { PlayerCloseResult, Payload } from '../types';
5
5
  import { mapBase } from './mapBase';
6
6
 
@@ -16,8 +16,9 @@ export const mapPlayerClose = (
16
16
  ...mapBase(payload),
17
17
  action: EVENTS.PLAYER_CLOSE,
18
18
  event_trigger: triggerName,
19
+ source_page: DefaultScreens.PLAYBACK,
19
20
  thing_id: payload.assetId || '',
20
- attribution_id: payload.attributionId || null,
21
+ attribution_id: payload.attributionId || '',
21
22
  duration,
22
23
  progress_pct: progressPercent,
23
24
  };
@@ -12,6 +12,6 @@ export const mapPlayerOpen = (
12
12
  event_trigger: triggerName,
13
13
  source_page: DefaultScreens.PLAYBACK,
14
14
  thing_id: payload.assetId || '',
15
- attribution_id: payload.attributionId || null,
15
+ attribution_id: payload.attributionId || '',
16
16
  source_rail: '', // TODO: payload.payload.asset.sectionLabel,
17
17
  });
@@ -11,5 +11,5 @@ export const mapSceneView = (
11
11
  event_trigger: triggerName,
12
12
  source_page: payload.sceneName,
13
13
  thing_id: payload.assetId || '',
14
- attribution_id: payload.attributionId || null,
14
+ attribution_id: payload.attributionId || '',
15
15
  });
@@ -11,7 +11,7 @@ export const mapScroll = (triggerName: AnalyticsTriggers, payload: Payload): Scr
11
11
  event_trigger: triggerName,
12
12
  source_page: payload.sceneName,
13
13
  thing_id: payload.assetId || '',
14
- attribution_id: payload.attributionId || null,
14
+ attribution_id: payload.attributionId || '',
15
15
  percent_scrolled: percentScrolled,
16
16
  };
17
17
  };
@@ -1,6 +1,6 @@
1
1
  import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
2
2
  import { SECOND_IN_MS } from '@24i/bigscreen-sdk/utils';
3
- import { EVENTS } from '../constants';
3
+ import { DefaultScreens, EVENTS } from '../constants';
4
4
  import { Payload, VideoCompleteResult } from '../types';
5
5
  import { mapBase } from './mapBase';
6
6
 
@@ -14,8 +14,9 @@ export const mapVideoComplete = (
14
14
  action: EVENTS.VIDEO_COMPLETE,
15
15
  event_trigger: triggerName,
16
16
  thing_id: payload.assetId || '',
17
- attribution_id: payload.attributionId || null,
17
+ attribution_id: payload.attributionId || '',
18
18
  progress_pct: 90,
19
19
  duration: assetDuration,
20
+ source_page: DefaultScreens.PLAYBACK,
20
21
  };
21
22
  };
@@ -1,6 +1,6 @@
1
1
  import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
2
2
  import { SECOND_IN_MS } from '@24i/bigscreen-sdk/utils';
3
- import { EVENTS, HUNDRED_PERCENT } from '../constants';
3
+ import { DefaultScreens, EVENTS, HUNDRED_PERCENT } from '../constants';
4
4
  import { VideoPauseResult, Payload } from '../types';
5
5
  import { mapBase } from './mapBase';
6
6
 
@@ -17,8 +17,9 @@ export const mapVideoPause = (
17
17
  action: EVENTS.VIDEO_PAUSE,
18
18
  event_trigger: triggerName,
19
19
  thing_id: payload.assetId || '',
20
- attribution_id: payload.attributionId || null,
20
+ attribution_id: payload.attributionId || '',
21
21
  duration: overallDuration,
22
22
  progress_pct: progressPercent,
23
+ source_page: DefaultScreens.PLAYBACK,
23
24
  };
24
25
  };
@@ -1,7 +1,7 @@
1
1
  import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
2
2
  import { SECOND_IN_MS } from '@24i/bigscreen-sdk/utils';
3
3
  import { Payload, VideoProgressResult } from '../types';
4
- import { EVENTS, HUNDRED_PERCENT } from '../constants';
4
+ import { DefaultScreens, EVENTS, HUNDRED_PERCENT } from '../constants';
5
5
  import { mapBase } from './mapBase';
6
6
 
7
7
  export const mapVideoProgress = (
@@ -17,8 +17,9 @@ export const mapVideoProgress = (
17
17
  action: EVENTS.VIDEO_PROGRESS,
18
18
  event_trigger: triggerName,
19
19
  thing_id: payload.assetId || '',
20
- attribution_id: payload.attributionId || null,
20
+ attribution_id: payload.attributionId || '',
21
21
  progress_pct: progressPercent,
22
22
  duration: durationInSeconds,
23
+ source_page: DefaultScreens.PLAYBACK,
23
24
  };
24
25
  };
@@ -25,7 +25,7 @@ export const mapVideoStart = (
25
25
  action: EVENTS.VIDEO_START,
26
26
  event_trigger: triggerName,
27
27
  thing_id: payload.assetId || '',
28
- attribution_id: payload.attributionId || null,
28
+ attribution_id: payload.attributionId || '',
29
29
  duration: assetDuration,
30
30
  progress_pct: progressPercent,
31
31
  source_page: DefaultScreens.PLAYBACK,
@@ -23,7 +23,7 @@ export const mapVideoStop = (
23
23
  action: EVENTS.VIDEO_STOP,
24
24
  event_trigger: triggerName,
25
25
  thing_id: payload.assetId || '',
26
- attribution_id: payload.attributionId || null,
26
+ attribution_id: payload.attributionId || '',
27
27
  progress_pct: progressPercent,
28
28
  duration,
29
29
  source_page: DefaultScreens.PLAYBACK,
@@ -67,57 +67,52 @@ export type CoreResult = BaseResult & {
67
67
  export type SceneViewResult = CoreResult & {
68
68
  source_page: string;
69
69
  thing_id: string;
70
- attribution_id: string | null;
70
+ attribution_id: string;
71
71
  };
72
72
  export type BufferingResult = SceneViewResult;
73
73
 
74
74
  export type ScrollResult = SceneViewResult & {
75
75
  percent_scrolled: string;
76
76
  };
77
- export type VideoProgressResult = CoreResult & {
78
- thing_id: string;
79
- attribution_id: string | null;
80
- progress_pct: number;
81
- duration: number;
82
- };
83
-
84
77
  export type PlayerOpenResult = CoreResult & {
85
78
  thing_id: string;
86
- attribution_id: string | null;
79
+ attribution_id: string;
87
80
  source_page: string;
88
81
  source_rail?: string | null;
89
82
  };
90
83
 
91
- export type VideoStartResult = CoreResult & {
84
+ export type VideoBaseResult = CoreResult & {
92
85
  thing_id: string;
93
- attribution_id: string | null;
86
+ attribution_id: string;
94
87
  duration: number;
95
88
  progress_pct: number;
96
89
  source_page: string;
97
- source_rail?: string | null;
98
90
  };
99
91
 
100
- export type VideoPauseResult = CoreResult & {
101
- thing_id: string;
102
- attribution_id: string | null;
103
- duration: number;
104
- progress_pct: number;
92
+ export type VideoStartResult = VideoBaseResult & {
93
+ source_rail?: string | null;
105
94
  };
106
95
 
96
+ export type VideoPauseResult = VideoBaseResult;
97
+
98
+ export type VideoStopResult = VideoStartResult;
99
+
100
+ export type VideoProgressResult = VideoBaseResult;
101
+
102
+ export type VideoCompleteResult = VideoBaseResult;
103
+
104
+ export type PlayerCloseResult = VideoBaseResult;
105
+
107
106
  export type AdLoadedResult = CoreResult & {
108
107
  thing_id: string;
109
- attribution_id: string | null;
108
+ attribution_id: string;
110
109
  player_advertisment_name: string;
111
110
  player_advertisment_position: number;
112
111
  };
113
112
 
114
113
  export type AdSkippedResult = CoreResult & {
115
114
  thing_id: string;
116
- attribution_id: string | null;
115
+ attribution_id: string;
117
116
  player_advertisment_name: string;
118
117
  player_advertisment_position: number;
119
118
  };
120
-
121
- export type VideoCompleteResult = VideoPauseResult;
122
- export type VideoStopResult = VideoStartResult;
123
- export type PlayerCloseResult = VideoPauseResult;