@24i/bigscreen-sdk 1.0.34-alpha.2563 → 1.0.34-alpha.2566

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.34-alpha.2563",
3
+ "version": "1.0.34-alpha.2566",
4
4
  "description": "SmartApps BIGscreen SDK monorepo",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "homepage": "https://github.com/24i/smartapps-bigscreen-sdk#readme",
39
39
  "dependencies": {
40
- "@24i/appstage-shared-analytics": "1.0.19",
40
+ "@24i/appstage-shared-analytics": "1.0.20-alpha.70",
41
41
  "@24i/appstage-shared-events-manager": "1.0.11",
42
42
  "@24i/appstage-shared-perf-utils": "1.0.11",
43
43
  "@24i/bigscreen-players-engine-base": "3.0.2",
@@ -14,7 +14,7 @@ import type { AnalyticsClient, AnyPayload } from '../../interface';
14
14
  import type {
15
15
  BaseResult,
16
16
  Payload,
17
- TealiumAnalyticsConfiguration,
17
+ TealiumAnalyticsOptions,
18
18
  UtagWindow,
19
19
  } from './types';
20
20
 
@@ -49,7 +49,7 @@ export class TealiumAnalytics implements AnalyticsClient {
49
49
 
50
50
  sessionStartSent = false;
51
51
 
52
- constructor(private config: TealiumAnalyticsConfiguration, private appVersion: string = '') {
52
+ constructor(private config: TealiumAnalyticsOptions, private appVersion: string = '') {
53
53
  this.init();
54
54
  }
55
55
 
@@ -62,7 +62,7 @@ export class TealiumAnalytics implements AnalyticsClient {
62
62
  }
63
63
 
64
64
  prepareDatasetPayload() {
65
- const { entity, language } = this.config.options;
65
+ const { entity, language } = this.config;
66
66
  this.constantPayload = {
67
67
  language,
68
68
  language_service: `${entity} ${language}`,
@@ -94,7 +94,7 @@ export class TealiumAnalytics implements AnalyticsClient {
94
94
  }
95
95
 
96
96
  loadScript() {
97
- const { account, profile, environment } = this.config.options;
97
+ const { account, profile, environment } = this.config;
98
98
  const url = `//tags.tiqcdn.com/utag/${account}/${profile}/${environment}/utag.js`;
99
99
 
100
100
  const script = document.createElement('script');
@@ -24,6 +24,7 @@ export const TEALIUM_TRIGGERS = [
24
24
  AnalyticsTriggers.PLAYBACK_50,
25
25
  AnalyticsTriggers.PLAYBACK_90,
26
26
  AnalyticsTriggers.PLAYBACK_PAUSE,
27
+ AnalyticsTriggers.PLAYBACK_UNPAUSE,
27
28
  AnalyticsTriggers.PLAYBACK_START,
28
29
  AnalyticsTriggers.PLAYBACK_STOP,
29
30
 
@@ -36,7 +37,8 @@ export const TEALIUM_TRIGGERS = [
36
37
  AnalyticsTriggers.FAVORITE_REMOVE,
37
38
 
38
39
  AnalyticsTriggers.SELECT_CONTENT,
39
- 'playback_unpause',
40
+ AnalyticsTriggers.SEARCH_SUCCESS,
41
+ AnalyticsTriggers.SEARCH_FAILED,
40
42
  ];
41
43
 
42
44
  export const AppEvents: { [key: string]: string } = {
@@ -45,6 +47,7 @@ export const AppEvents: { [key: string]: string } = {
45
47
  [AnalyticsTriggers.PLAYBACK_90]: 'media_milestone_90_video',
46
48
  [AnalyticsTriggers.PLAYBACK_STOP]: 'video_stop',
47
49
  [AnalyticsTriggers.PLAYBACK_PAUSE]: 'video_pause',
50
+ [AnalyticsTriggers.PLAYBACK_UNPAUSE]: 'video_resume',
48
51
  [AnalyticsTriggers.PLAYBACK_START]: 'video_play',
49
52
  [AnalyticsTriggers.PLAYER_OPEN]: 'player_x',
50
53
  [AnalyticsTriggers.PLAYER_CLOSE]: 'player_x',
@@ -52,7 +55,8 @@ export const AppEvents: { [key: string]: string } = {
52
55
  [AnalyticsTriggers.FAVORITE_REMOVE]: 'subscribe_to_fav',
53
56
  [AnalyticsTriggers.APP_ERROR]: 'app_events',
54
57
  [AnalyticsTriggers.SELECT_CONTENT]: 'app_events',
55
- [AnalyticsTriggers.SEARCH]: 'search_success',
58
+ [AnalyticsTriggers.SEARCH_SUCCESS]: 'search_success',
59
+ [AnalyticsTriggers.SEARCH_FAILED]: 'search_fail',
56
60
  unpause: 'video_resume',
57
61
  };
58
62
 
@@ -69,6 +73,7 @@ export enum EVENTS {
69
73
  SEARCH_FAILED = 'search_failed',
70
74
  FAVORITE_ADD = 'favorite_add',
71
75
  FAVORITE_REMOVE = 'favorite_remove',
76
+ APP_ERROR = 'app_error',
72
77
  }
73
78
 
74
79
  export enum TrackEventType {
@@ -82,11 +87,13 @@ export const TRIGGER_NAME_TO_TEALIUM_EVENTS: { [K in AnalyticsTriggers]?: EVENTS
82
87
  [AnalyticsTriggers.PLAYBACK_50]: [EVENTS.VIDEO_PROGRESS],
83
88
  [AnalyticsTriggers.PLAYBACK_90]: [EVENTS.VIDEO_PROGRESS],
84
89
  [AnalyticsTriggers.PLAYBACK_PAUSE]: [EVENTS.VIDEO_PAUSE],
90
+ [AnalyticsTriggers.PLAYBACK_UNPAUSE]: [EVENTS.VIDEO_UNPAUSE],
85
91
  [AnalyticsTriggers.PLAYBACK_START]: [EVENTS.VIDEO_START],
86
92
  [AnalyticsTriggers.PLAYBACK_STOP]: [EVENTS.VIDEO_STOP],
87
93
  [AnalyticsTriggers.PLAYER_CLOSE]: [EVENTS.PLAYER_CLOSE],
88
94
  [AnalyticsTriggers.PLAYER_OPEN]: [EVENTS.PLAYER_OPEN],
89
95
  [AnalyticsTriggers.APP_CLOSE]: [EVENTS.VIDEO_STOP, EVENTS.PLAYER_CLOSE],
96
+ [AnalyticsTriggers.APP_ERROR]: [EVENTS.APP_ERROR],
90
97
  [AnalyticsTriggers.FAVORITE_ADD]: [EVENTS.FAVORITE_ADD],
91
98
  [AnalyticsTriggers.FAVORITE_REMOVE]: [EVENTS.FAVORITE_REMOVE],
92
99
  [AnalyticsTriggers.SEARCH]: [EVENTS.SEARCH_SUCCESS, EVENTS.SEARCH_FAILED],
@@ -1,2 +1,3 @@
1
1
  export { TealiumAnalytics } from './TealiumAnalytics';
2
2
  export { TEALIUM_TRIGGERS } from './constants';
3
+ export { TealiumAnalyticsOptions, TealiumAnalyticsConfiguration } from './types';
@@ -14,6 +14,7 @@ import { mapVideoResume } from './mappers/mapVideoResume';
14
14
  import { mapSearchSuccess } from './mappers/mapSearchSuccess';
15
15
  import { mapSearchFailed } from './mappers/mapSearchFailed';
16
16
  import { EventMappingFunction } from './types';
17
+ import { mapAppError } from './mappers/mapAppError';
17
18
 
18
19
  export const EVENTS_MAPPING: Record<EVENTS, EventMappingFunction> = {
19
20
  [EVENTS.SCENE_VIEW]: mapSceneView,
@@ -28,4 +29,5 @@ export const EVENTS_MAPPING: Record<EVENTS, EventMappingFunction> = {
28
29
  [EVENTS.VIDEO_UNPAUSE]: mapVideoResume,
29
30
  [EVENTS.SEARCH_SUCCESS]: mapSearchSuccess,
30
31
  [EVENTS.SEARCH_FAILED]: mapSearchFailed,
32
+ [EVENTS.APP_ERROR]: mapAppError,
31
33
  };
@@ -23,7 +23,7 @@ export const MEDIA_PAYLOAD: Payload = {
23
23
  appVersion: 'v1.0',
24
24
  deviceId: 'ott',
25
25
  deviceType: 'smarttv',
26
- search: '',
26
+ searchTerm: '',
27
27
  };
28
28
 
29
29
  export const TEALIUM_MEDIA_PAYLOAD = {
@@ -0,0 +1,14 @@
1
+ import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
2
+ import { CoreResult, Payload } from '../types';
3
+ import { AppEvents, TrackEventType } from '../constants';
4
+
5
+ export const mapAppError = (
6
+ triggerName: AnalyticsTriggers,
7
+ payload: Payload,
8
+ ): CoreResult => ({
9
+ app_events: AppEvents.app_error,
10
+ event_trigger: triggerName,
11
+ track_event_type: TrackEventType.ACTIVITY,
12
+ video_event: AppEvents.app_error,
13
+ message: payload.message,
14
+ });
@@ -0,0 +1,18 @@
1
+ import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
2
+ import { Payload, SearchResult } from '../types';
3
+ import { AppEvents, TrackEventType } from '../constants';
4
+
5
+ export const mapSearch = (
6
+ triggerName: AnalyticsTriggers,
7
+ payload: Payload,
8
+ ): SearchResult => {
9
+ const searchEventName = payload.searchSuccess
10
+ ? AnalyticsTriggers.SEARCH_SUCCESS
11
+ : AnalyticsTriggers.SEARCH_FAILED;
12
+ return {
13
+ app_events: AppEvents[searchEventName],
14
+ event_trigger: searchEventName,
15
+ track_event_type: TrackEventType.ACTIVITY,
16
+ search_keyword: payload.searchTerm,
17
+ };
18
+ };
@@ -1,13 +1,8 @@
1
1
  import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
2
2
  import { Payload, SearchResult } from '../types';
3
- import { AppEvents, TrackEventType } from '../constants';
3
+ import { mapSearch } from './mapSearch';
4
4
 
5
5
  export const mapSearchFailed = (
6
6
  triggerName: AnalyticsTriggers,
7
7
  payload: Payload,
8
- ): SearchResult => ({
9
- app_events: AppEvents.search,
10
- event_trigger: triggerName,
11
- track_event_type: TrackEventType.ACTIVITY,
12
- search_keyword: payload.search,
13
- });
8
+ ): SearchResult => (mapSearch(triggerName, payload));
@@ -1,13 +1,8 @@
1
1
  import { AnalyticsTriggers } from '@24i/appstage-shared-analytics';
2
2
  import { Payload, SearchResult } from '../types';
3
- import { AppEvents, TrackEventType } from '../constants';
3
+ import { mapSearch } from './mapSearch';
4
4
 
5
5
  export const mapSearchSuccess = (
6
6
  triggerName: AnalyticsTriggers,
7
7
  payload: Payload,
8
- ): SearchResult => ({
9
- app_events: AppEvents.search,
10
- event_trigger: triggerName,
11
- track_event_type: TrackEventType.ACTIVITY,
12
- search_keyword: payload.search,
13
- });
8
+ ): SearchResult => (mapSearch(triggerName, payload));
@@ -32,6 +32,7 @@ export type TealiumAnalyticsConfiguration = {
32
32
  export interface CorePayload {
33
33
  app_id: string;
34
34
  app_type: string;
35
+ message?: string;
35
36
  }
36
37
  export interface MediaPayload {
37
38
  title: string;
@@ -65,7 +66,8 @@ export interface SceneInfo {
65
66
  }
66
67
 
67
68
  export interface SearchInfo {
68
- search?: string,
69
+ searchTerm?: string,
70
+ searchSuccess?: boolean,
69
71
  }
70
72
 
71
73
  export type Payload = CorePayload &
@@ -101,6 +103,7 @@ export type CoreResult = {
101
103
  track_event_type: string,
102
104
  app_events?: string,
103
105
  video_event?: string,
106
+ message?: string,
104
107
  };
105
108
 
106
109
  export type SceneViewResult = CoreResult & {
@@ -8,6 +8,8 @@ type Props = PlayerUICommonProps;
8
8
  export class PauseButton extends Component<Props> implements IFocusable {
9
9
  button = createRef<PlayerInteractable>();
10
10
 
11
+ isPaused = false;
12
+
11
13
  static defaultProps = {
12
14
  className: '',
13
15
  };
@@ -31,10 +33,16 @@ export class PauseButton extends Component<Props> implements IFocusable {
31
33
 
32
34
  onPlaying = () => {
33
35
  this.button.current!.show();
36
+ if (this.isPaused) {
37
+ const { ui } = this.props;
38
+ ui.getPlayer().triggerEvent('unpause');
39
+ }
40
+ this.isPaused = false;
34
41
  };
35
42
 
36
43
  onPause = () => {
37
44
  this.button.current!.hide();
45
+ this.isPaused = true;
38
46
  };
39
47
 
40
48
  focus(options?: FocusOptions) {