@applicaster/zapp-react-native-utils 12.0.11 → 12.0.12-rc.0

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.
@@ -2,7 +2,6 @@
2
2
  import * as ReactNative from "react-native";
3
3
  import { isTV, platformSelect } from "../reactUtils";
4
4
  import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
5
- import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
6
5
 
7
6
  import {
8
7
  QUICK_BRICK_EVENTS,
@@ -10,6 +9,7 @@ import {
10
9
  sendQuickBrickEvent,
11
10
  } from "@applicaster/zapp-react-native-bridge/QuickBrick";
12
11
  import { utilsLogger } from "../logger";
12
+ import { useIsTablet } from "../reactHooks";
13
13
 
14
14
  const { DeviceEventEmitter, NativeModules, NativeEventEmitter } = ReactNative;
15
15
 
@@ -121,8 +121,15 @@ export const removeOrientationChangeListener = (listener: any): void => {
121
121
  */
122
122
  export const isOrientationCompatible = ({
123
123
  orientation,
124
- layoutData: { width, height },
124
+ layoutData: { width, height, isTablet, isTabletPortrait },
125
125
  }) => {
126
+ // We count portrait as compatible, because if default in zapp for mobile layout
127
+ // We count landscape as compatible, because if isTabletPortrait is false,
128
+ // it defaults for device
129
+ if (isTablet && !isTabletPortrait) {
130
+ return true;
131
+ }
132
+
126
133
  const isLandscape = width > height;
127
134
 
128
135
  if (
@@ -146,15 +153,6 @@ export const isOrientationCompatible = ({
146
153
  return true;
147
154
  };
148
155
 
149
- export const useIsOrientationCompatible = (orientation) => {
150
- const { height, width } = ReactNative.useWindowDimensions();
151
-
152
- return isOrientationCompatible({
153
- orientation,
154
- layoutData: { width, height },
155
- });
156
- };
157
-
158
156
  /**
159
157
  * Determine final screen orientation based on device type,
160
158
  * settings and orientation value provided by screen data settings
@@ -724,6 +724,10 @@ export class Player {
724
724
  return null;
725
725
  };
726
726
 
727
+ public hasResumePosition() {
728
+ return false;
729
+ }
730
+
727
731
  public getConfig = () => this.config;
728
732
 
729
733
  // TODO: replace with enum of supported orientations
@@ -54,6 +54,10 @@ export class PlayerNative extends Player {
54
54
  });
55
55
  }
56
56
 
57
+ public hasResumePosition() {
58
+ return true;
59
+ }
60
+
57
61
  getContentPosition = () => {
58
62
  return this.playerState.contentPosition;
59
63
  };
@@ -223,6 +227,7 @@ export class PlayerNative extends Player {
223
227
  onVideoLoad = (event) => {
224
228
  if (this.startPosition) {
225
229
  super.onVideoLoad({ ...event, ignoreContinueWatching: true });
230
+
226
231
  this.seekTo(this.startPosition);
227
232
  this.startPosition = null;
228
233
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "12.0.11",
3
+ "version": "12.0.12-rc.0",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "12.0.11",
31
+ "@applicaster/applicaster-types": "12.0.12-rc.0",
32
32
  "buffer": "^5.2.1",
33
33
  "camelize": "^1.0.0",
34
34
  "create-react-context": "^0.2.3",
@@ -191,21 +191,23 @@ export function useInflatedUrl({
191
191
  const [searchContext] = ZappPipesSearchContext.useZappPipesContext();
192
192
  const [screenContext] = ZappPipesScreenContext.useZappPipesContext();
193
193
 
194
- const url = useMemo(
195
- () =>
196
- mapping
197
- ? getInflatedDataSourceUrl({
198
- source: feedUrl,
199
- contexts: {
200
- entry: entryContext,
201
- screen: screenContext,
202
- search: getSearchContext(searchContext, mapping),
203
- },
204
- mapping,
205
- })
206
- : feedUrl,
207
- [feedUrl, mapping]
208
- );
194
+ const url = useMemo(() => {
195
+ if (!feedUrl) {
196
+ return null;
197
+ }
198
+
199
+ return mapping
200
+ ? getInflatedDataSourceUrl({
201
+ source: feedUrl,
202
+ contexts: {
203
+ entry: entryContext,
204
+ screen: screenContext,
205
+ search: getSearchContext(searchContext, mapping),
206
+ },
207
+ mapping,
208
+ })
209
+ : feedUrl;
210
+ }, [feedUrl, mapping]);
209
211
 
210
212
  if (!feedUrl) {
211
213
  logger.warning({