@applicaster/zapp-react-native-ui-components 16.0.0-alpha.7343517668 → 16.0.0-alpha.7501599877

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.
@@ -92,7 +92,7 @@ export function CellRendererResolver({
92
92
  component,
93
93
  styles,
94
94
  cellStyles,
95
- cellOptions,
95
+ cellOptions: { ...cellOptions, component },
96
96
  ...cellOptions, // fallback for existing plugins
97
97
  });
98
98
  }
@@ -2,6 +2,8 @@ import * as R from "ramda";
2
2
  import * as React from "react";
3
3
  import { v4 as uuid } from "uuid";
4
4
 
5
+ import { isHorizontalList } from "@applicaster/zapp-react-native-utils/componentsUtils";
6
+ import { isVideoPreviewEnabled } from "@applicaster/zapp-react-native-ui-components/Components/MasterCell/utils";
5
7
  import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
6
8
  import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
7
9
  import { useScreenState } from "@applicaster/zapp-react-native-utils/screenState";
@@ -35,8 +37,8 @@ type MasterCellBuilderOptions = {
35
37
  containerStyle: any;
36
38
  cellOptions?: {
37
39
  isRTL?: boolean;
38
- generateId?: () => string;
39
40
  skipButtons?: boolean;
41
+ component?: ZappComponent;
40
42
  };
41
43
  };
42
44
 
@@ -47,7 +49,7 @@ export function masterCellBuilder({
47
49
  containerStyle = defaultContainerStyle,
48
50
  cellOptions = {},
49
51
  }: MasterCellBuilderOptions) {
50
- const { generateId = uuid, skipButtons = false } = cellOptions;
52
+ const { skipButtons = false, component } = cellOptions;
51
53
 
52
54
  const componentsMap = R.merge(defaultComponents, components);
53
55
  const { View } = componentsMap;
@@ -100,8 +102,22 @@ export function masterCellBuilder({
100
102
 
101
103
  const wrapperRef = React.useRef(null);
102
104
 
103
- const cellUUID = React.useMemo<string>(generateId, [
104
- generateId,
105
+ const cellUUID = React.useMemo<string>(() => {
106
+ const isLiveImage = isVideoPreviewEnabled({
107
+ enable_video_preview: component?.rules?.enable_video_preview,
108
+ player_screen_id: component?.rules?.player_screen_id,
109
+ });
110
+
111
+ const isHL = isHorizontalList(component);
112
+
113
+ return isHL && isLiveImage
114
+ ? `${component?.id}-${component?.styles?.cell_plugin_configuration_id}`
115
+ : uuid();
116
+ }, [
117
+ component?.id,
118
+ component?.styles?.cell_plugin_configuration_id,
119
+ component?.rules?.enable_video_preview,
120
+ component?.rules?.player_screen_id,
105
121
  screenId,
106
122
  item?.id,
107
123
  ]);
@@ -344,11 +344,15 @@ const PlayerContainerComponent = (props: Props) => {
344
344
  setIsLoadingNextVideo(false);
345
345
 
346
346
  const resumeTime = Number(item?.extensions?.resumeTime);
347
+ const activePlayer = playerManager.getActivePlayer();
347
348
 
348
- // Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast
349
+ // Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast.
350
+ // Live streams and a missing/zero resume position are skipped: seeking to 0 on
351
+ // a live stream pulls playback off the live edge into a buffer-starvation seek loop.
349
352
  if (
350
- !playerManager.getActivePlayer()?.hasResumePosition() &&
351
- !isNaN(resumeTime)
353
+ !activePlayer?.hasResumePosition() &&
354
+ resumeTime > 0 &&
355
+ !activePlayer?.isLive()
352
356
  ) {
353
357
  player?.seekTo(resumeTime);
354
358
  }
@@ -163,6 +163,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
163
163
  >
164
164
  <View
165
165
  onLayout={[Function]}
166
+ style={{}}
166
167
  >
167
168
  <View />
168
169
  </View>
@@ -174,6 +175,7 @@ exports[`componentsMap renders renders components map correctly 1`] = `
174
175
  >
175
176
  <View
176
177
  onLayout={[Function]}
178
+ style={{}}
177
179
  />
178
180
  </View>
179
181
  <View
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "16.0.0-alpha.7343517668",
3
+ "version": "16.0.0-alpha.7501599877",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "16.0.0-alpha.7343517668",
32
- "@applicaster/zapp-react-native-bridge": "16.0.0-alpha.7343517668",
33
- "@applicaster/zapp-react-native-redux": "16.0.0-alpha.7343517668",
34
- "@applicaster/zapp-react-native-utils": "16.0.0-alpha.7343517668",
31
+ "@applicaster/applicaster-types": "16.0.0-alpha.7501599877",
32
+ "@applicaster/zapp-react-native-bridge": "16.0.0-alpha.7501599877",
33
+ "@applicaster/zapp-react-native-redux": "16.0.0-alpha.7501599877",
34
+ "@applicaster/zapp-react-native-utils": "16.0.0-alpha.7501599877",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",