@applicaster/zapp-react-native-utils 15.0.0-rc.6 → 15.0.0-rc.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.
@@ -35,8 +35,11 @@ export class AnalyticPlayerListener
35
35
  this.handleAnalyticEvent(PLAYBACK_EVENT.complete);
36
36
  };
37
37
 
38
- onError = (err: Error) => {
39
- this.handleAnalyticEvent(PLAYBACK_EVENT.error, err); // TODO: Check error format
38
+ onError = (err: QuickBrickPlayer.PlayerErrorI) => {
39
+ this.handleAnalyticEvent(
40
+ PLAYBACK_EVENT.error,
41
+ err.toObject?.() || { message: err.message }
42
+ );
40
43
  };
41
44
 
42
45
  onPlayerPause = (event) => {
@@ -2,6 +2,27 @@ export const userPreferencesNamespace = "user_preferences";
2
2
 
3
3
  export const skipActionType = "show_skip";
4
4
 
5
+ export class PlayerError
6
+ extends Error
7
+ implements QuickBrickPlayer.PlayerErrorI
8
+ {
9
+ description: string;
10
+
11
+ constructor(message: string, description: string) {
12
+ super(message);
13
+ this.description = description;
14
+
15
+ Object.setPrototypeOf(this, PlayerError.prototype);
16
+ }
17
+
18
+ toObject() {
19
+ return {
20
+ error: this.message,
21
+ message: this.description,
22
+ };
23
+ }
24
+ }
25
+
5
26
  export enum SharedPlayerCallBacksKeys {
6
27
  OnPlayerResume = "onPlayerResume",
7
28
  OnPlayerPause = "onPlayerPause",
@@ -575,24 +575,27 @@ export function routeIsPlayerScreen(currentRoute) {
575
575
  return currentRoute?.includes("/playable");
576
576
  }
577
577
 
578
- export const getNavBarProps =
579
- (currentRiver: ZappRiver, pathname: string, title: string) => () => {
580
- const props = getNavigationPropsV2({
581
- currentRiver,
582
- title,
583
- category: "nav_bar",
584
- });
578
+ export const getNavBarProps = (
579
+ currentRiver: ZappRiver,
580
+ pathname: string,
581
+ title: string
582
+ ) => {
583
+ const props = getNavigationPropsV2({
584
+ currentRiver,
585
+ title,
586
+ category: "nav_bar",
587
+ });
585
588
 
586
- if (props) {
587
- return {
588
- ...props,
589
- id: pathname,
590
- pathname: pathname,
591
- };
592
- }
589
+ if (props) {
590
+ return {
591
+ ...props,
592
+ id: pathname,
593
+ pathname: pathname,
594
+ };
595
+ }
593
596
 
594
- return null;
595
- };
597
+ return null;
598
+ };
596
599
 
597
600
  export const findMenuPlugin = (
598
601
  navigations: ZappNavigation[],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.0.0-rc.6",
3
+ "version": "15.0.0-rc.8",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "15.0.0-rc.6",
30
+ "@applicaster/applicaster-types": "15.0.0-rc.8",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",