@applicaster/quick-brick-player 14.0.0-rc.86 → 14.0.0-rc.87

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-player",
3
- "version": "14.0.0-rc.86",
3
+ "version": "14.0.0-rc.87",
4
4
  "description": "Quick Brick Player",
5
5
  "main": "./src/index.ts",
6
6
  "types": "index.d.ts",
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "homepage": "https://github.com/applicaster/quickbrick#readme",
37
37
  "dependencies": {
38
- "@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.83",
38
+ "@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.87",
39
39
  "@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.71",
40
- "@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.86",
41
- "@applicaster/zapp-react-native-ui-components": "14.0.0-rc.86",
42
- "@applicaster/zapp-react-native-utils": "14.0.0-rc.86",
40
+ "@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.87",
41
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-rc.87",
42
+ "@applicaster/zapp-react-native-utils": "14.0.0-rc.87",
43
43
  "query-string": "7.1.3",
44
44
  "shaka-player": "4.3.5",
45
45
  "typeface-montserrat": "^0.0.54",
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { LayoutChangeEvent, View } from "react-native";
2
+ import { Animated, LayoutChangeEvent, View } from "react-native";
3
3
 
4
4
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
5
5
  import { toBooleanWithDefaultTrue } from "@applicaster/zapp-react-native-utils/booleanUtils";
@@ -8,6 +8,7 @@ import { FlexImage } from "./FlexImage";
8
8
 
9
9
  import { styles } from "./styles";
10
10
  import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
11
+ import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
11
12
 
12
13
  type Props = {
13
14
  entry: ZappEntry;
@@ -29,15 +30,34 @@ export const PlayerImage = (props: Props) => {
29
30
  configuration.audio_player_artwork_border_radius
30
31
  );
31
32
 
33
+ const { yTranslate } = useModalAnimationContext();
34
+
35
+ const isModalExpanded = yTranslate.current.interpolate({
36
+ inputRange: [0, 1], // this should be end with `1` only when it's in initial state ( 0pos), otherwise `0`
37
+ outputRange: [1, 0],
38
+ });
39
+
40
+ // do not use styles.shadow when isModalExpanded is 0
41
+
42
+ const animatedStyle = {
43
+ opacity: isModalExpanded,
44
+ };
45
+
32
46
  return (
33
47
  <View style={styles.alignItemsCenter}>
48
+ {/* Using an Animated.View to apply shadow to the image */}
49
+ <Animated.View
50
+ style={[
51
+ animatedStyle,
52
+ shouldShowShadow ? styles.shadow : undefined,
53
+ { borderRadius },
54
+ ]}
55
+ />
34
56
  <View
35
57
  onLayout={onLayoutImage}
36
- style={[shouldShowShadow ? styles.shadow : undefined, { borderRadius }]}
58
+ style={[styles.defaultImageWrapperView, { borderRadius }]}
37
59
  >
38
- <View style={[styles.defaultImageWrapperView, { borderRadius }]}>
39
- <FlexImage entry={entry} style={styles.backgroundImageContainer} />
40
- </View>
60
+ <FlexImage entry={entry} style={styles.backgroundImageContainer} />
41
61
  </View>
42
62
  </View>
43
63
  );
@@ -23,7 +23,12 @@ export const styles = StyleSheet.create({
23
23
  overflow: "hidden",
24
24
  },
25
25
  shadow: {
26
- borderColor: "transparent",
26
+ zIndex: 0,
27
+ position: "absolute",
28
+ top: 0,
29
+ left: 0,
30
+ right: 0,
31
+ bottom: 0,
27
32
  shadowColor: SHADOW_COLOR,
28
33
  shadowOffset: { width: 0, height: 24 },
29
34
  shadowOpacity: platformSelect({
@@ -67,12 +67,16 @@ export function VideoPlayerModal({
67
67
  () =>
68
68
  isTablet && !isTabletPortrait
69
69
  ? style.tabletLandscapeWidth
70
- : getWindowWidth(),
70
+ : getWindowWidth(isTablet, !isTabletPortrait),
71
71
  // eslint-disable-next-line react-hooks/exhaustive-deps
72
72
  []
73
73
  );
74
74
 
75
- const height = useMemo(() => getWindowHeight(), []); // remember initial height, ignore rotation changes
75
+ const height = useMemo(
76
+ () => getWindowHeight(isTablet, !isTabletPortrait),
77
+ []
78
+ ); // remember initial height, ignore rotation changes
79
+
76
80
  const MODAL_COLLAPSE_START = height * MODAL_COLLAPSE_RATIO;
77
81
 
78
82
  const { minimised_height: minimisedHeight } = useConfiguration();
@@ -92,7 +96,9 @@ export function VideoPlayerModal({
92
96
 
93
97
  const insets = useSafeAreaInsets();
94
98
 
95
- const [isFullScreenMode, setFullScreenMode] = React.useState(false);
99
+ const [isFullScreenMode, setFullScreenMode] = React.useState(
100
+ fullscreen || pip
101
+ );
96
102
 
97
103
  React.useEffect(() => {
98
104
  const listener = addOrientationChangeListener(({ toOrientation }) => {
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useMemo, useRef } from "react";
3
3
  import { State } from "react-native-gesture-handler";
4
4
 
5
5
  import { VideoModalMode } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
6
+ import { useAnimationStateStore } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/utils";
6
7
  import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
7
8
  import {
8
9
  ANIMATION_DURATION,
@@ -73,7 +74,13 @@ export const useVideoModalState = () => {
73
74
 
74
75
  const onHandlerStateChange = useCallback(
75
76
  (event: any) => {
76
- const { state: newState, translationY } = event.nativeEvent;
77
+ const { state: newState, oldState, translationY } = event.nativeEvent;
78
+
79
+ if (newState === State.ACTIVE || oldState === State.ACTIVE) {
80
+ useAnimationStateStore.setState({
81
+ isAnimationInProgress: newState === State.ACTIVE,
82
+ });
83
+ }
77
84
 
78
85
  // Update gesture state tracking
79
86
  gestureStateRef.current = newState;
@@ -13,9 +13,20 @@ export const isOldAndroidDevice =
13
13
  isAndroidPlatform() &&
14
14
  !isAndroidVersionAtLeast(SAFE_AREA_BREAKING_API_VERSION);
15
15
 
16
- export const getWindowHeight = (): number => {
16
+ export const getWindowHeight = (
17
+ isTablet: boolean,
18
+ landscape: boolean
19
+ ): number => {
17
20
  const windowDimensions = Dimensions.get("window");
18
21
 
22
+ if (isTablet && landscape) {
23
+ return windowDimensions.height;
24
+ }
25
+
26
+ if (windowDimensions.width > windowDimensions.height) {
27
+ return windowDimensions.width;
28
+ }
29
+
19
30
  return windowDimensions.height;
20
31
  };
21
32
 
@@ -25,9 +36,20 @@ export const getScreenHeight = (): number => {
25
36
  return screenDimensions.height;
26
37
  };
27
38
 
28
- export const getWindowWidth = (): number => {
39
+ export const getWindowWidth = (
40
+ isTablet: boolean,
41
+ landscape: boolean
42
+ ): number => {
29
43
  const windowDimensions = Dimensions.get("window");
30
44
 
45
+ if (isTablet && landscape) {
46
+ return windowDimensions.width;
47
+ }
48
+
49
+ if (windowDimensions.width > windowDimensions.height) {
50
+ return windowDimensions.height;
51
+ }
52
+
31
53
  return windowDimensions.width;
32
54
  };
33
55