@applicaster/zapp-react-native-ui-components 15.1.19 → 15.1.20-alpha.3704390340

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.
@@ -145,7 +145,9 @@ export const prepareEntry = (entry: ZappEntry) => {
145
145
  return entry;
146
146
  }
147
147
 
148
- return isVideoUrl(src) ? entry : null;
148
+ const playable = isVideoUrl(src);
149
+
150
+ return playable ? entry : null;
149
151
  };
150
152
 
151
153
  const getPlayableEntry = (entry) => {
@@ -246,12 +248,23 @@ const LiveImageComponent = (props: LiveImageProps) => {
246
248
 
247
249
  const isCurrentlyFocused = useTrackCurrentAutoScrollingElement(componentId);
248
250
 
249
- const { playerPluginId, screenConfig, preloadHooks } =
250
- getPlayerConfig(player_screen_id, actionIdentifier) ?? {};
251
-
252
- const playableEntry = playerPluginId ? getPlayableEntry(item) : null;
251
+ const rivers = appStore.get("rivers");
253
252
  const plugins = appStore.get("plugins");
254
253
 
254
+ // New object identities here restart PlayerLiveImage's register effect,
255
+ // which throws away the in-flight player and runs preload hooks again.
256
+ const playerConfig = React.useMemo(
257
+ () => getPlayerConfig(player_screen_id, actionIdentifier),
258
+ [player_screen_id, actionIdentifier, rivers, plugins]
259
+ );
260
+
261
+ const { playerPluginId, screenConfig, preloadHooks } = playerConfig ?? {};
262
+
263
+ const playableEntry = React.useMemo(
264
+ () => (playerPluginId ? getPlayableEntry(item) : null),
265
+ [playerPluginId, item?.id]
266
+ );
267
+
255
268
  const playerPlugin = findPluginByIdentifier(playerPluginId, plugins);
256
269
 
257
270
  const isShouldRender =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "15.1.19",
3
+ "version": "15.1.20-alpha.3704390340",
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": "15.1.19",
32
- "@applicaster/zapp-react-native-bridge": "15.1.19",
33
- "@applicaster/zapp-react-native-redux": "15.1.19",
34
- "@applicaster/zapp-react-native-utils": "15.1.19",
31
+ "@applicaster/applicaster-types": "15.1.20-alpha.3704390340",
32
+ "@applicaster/zapp-react-native-bridge": "15.1.20-alpha.3704390340",
33
+ "@applicaster/zapp-react-native-redux": "15.1.20-alpha.3704390340",
34
+ "@applicaster/zapp-react-native-utils": "15.1.20-alpha.3704390340",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "react-native-sortables": "1.7.1",