@applicaster/zapp-react-native-ui-components 14.0.34 → 14.0.36

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.
@@ -338,11 +338,15 @@ const PlayerContainerComponent = (props: Props) => {
338
338
  setIsLoadingNextVideo(false);
339
339
 
340
340
  const resumeTime = Number(item?.extensions?.resumeTime);
341
+ const activePlayer = playerManager.getActivePlayer();
341
342
 
342
- // Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast
343
+ // Сhecking that the player itself knows where to start playing, and there is no need to call seekTo after returning from the Сhromecast.
344
+ // Live streams and a missing/zero resume position are skipped: seeking to 0 on
345
+ // a live stream pulls playback off the live edge into a buffer-starvation seek loop.
343
346
  if (
344
- !playerManager.getActivePlayer()?.hasResumePosition() &&
345
- !isNaN(resumeTime)
347
+ !activePlayer?.hasResumePosition() &&
348
+ resumeTime > 0 &&
349
+ !activePlayer?.isLive()
346
350
  ) {
347
351
  player?.seekTo(resumeTime);
348
352
  }
@@ -16,6 +16,7 @@ import { useShallow } from "zustand/react/shallow";
16
16
  import { useScreenContextV2 } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
17
17
  import { useSafeAreaInsets } from "react-native-safe-area-context";
18
18
  import { useLoadPipesDataDispatch } from "@applicaster/zapp-react-native-utils/reactHooks";
19
+ import { useGetUrlInflater } from "@applicaster/zapp-react-native-utils/reactHooks/feed/useInflatedUrl";
19
20
 
20
21
  const BRIGHTNESS_THRESHOLD = 160;
21
22
  const ABOVE_DEFAULT_COLOR = "gray";
@@ -64,35 +65,51 @@ export const usePullToRefresh = (
64
65
 
65
66
  const [refreshing, setRefreshing] = React.useState(false);
66
67
 
67
- const feeds: string[] = React.useMemo(
68
+ const feedSources = React.useMemo(
68
69
  () =>
69
70
  (riverComponents || [])
70
- .map((riverComponent) => path(["data", "source"], riverComponent))
71
- .filter((feed) => !isNilOrEmpty(feed)),
71
+ .map((riverComponent) => ({
72
+ source: path(["data", "source"], riverComponent),
73
+ mapping: path(["data", "mapping"], riverComponent),
74
+ }))
75
+ .filter(({ source }) => !isNilOrEmpty(source)),
72
76
  [riverComponents]
73
77
  );
74
78
 
75
- const feedsLength = feeds.length;
79
+ const feedsLength = feedSources.length;
76
80
 
77
81
  const [requestsCompletedCounter, setRequestsCompletedCounter] =
78
82
  React.useState(0);
79
83
 
80
84
  const loadPipesDataDispatcher = useLoadPipesDataDispatch();
85
+ const urlInflater = useGetUrlInflater();
81
86
 
82
87
  React.useEffect(() => {
83
88
  // will not work for pipes v1 on 1st level screens
84
89
  if (refreshing && !isPipesV1) {
85
- feeds.forEach((feed) => {
86
- loadPipesDataDispatcher(feed, {
87
- silentRefresh: true,
88
- clearCache: true,
89
- callback: () => {
90
- setRequestsCompletedCounter(R.inc);
91
- },
92
- });
90
+ feedSources.forEach(({ source, mapping }) => {
91
+ const inflatedUrl = urlInflater(source, mapping);
92
+
93
+ if (inflatedUrl) {
94
+ loadPipesDataDispatcher(inflatedUrl, {
95
+ silentRefresh: true,
96
+ clearCache: true,
97
+ callback: () => {
98
+ setRequestsCompletedCounter(R.inc);
99
+ },
100
+ });
101
+ } else {
102
+ setRequestsCompletedCounter(R.inc);
103
+ }
93
104
  });
94
105
  }
95
- }, [refreshing, isPipesV1, feeds, loadPipesDataDispatcher]);
106
+ }, [
107
+ refreshing,
108
+ isPipesV1,
109
+ feedSources,
110
+ loadPipesDataDispatcher,
111
+ urlInflater,
112
+ ]);
96
113
 
97
114
  React.useEffect(() => {
98
115
  if (requestsCompletedCounter === feedsLength) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "14.0.34",
3
+ "version": "14.0.36",
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": "14.0.34",
32
- "@applicaster/zapp-react-native-bridge": "14.0.34",
33
- "@applicaster/zapp-react-native-redux": "14.0.34",
34
- "@applicaster/zapp-react-native-utils": "14.0.34",
31
+ "@applicaster/applicaster-types": "14.0.36",
32
+ "@applicaster/zapp-react-native-bridge": "14.0.36",
33
+ "@applicaster/zapp-react-native-redux": "14.0.36",
34
+ "@applicaster/zapp-react-native-utils": "14.0.36",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",