@applicaster/quick-brick-player 14.0.0-rc.38 → 14.0.0-rc.39

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.38",
3
+ "version": "14.0.0-rc.39",
4
4
  "description": "Quick Brick Player",
5
5
  "main": "./src/index.ts",
6
6
  "types": "index.d.ts",
@@ -37,9 +37,9 @@
37
37
  "dependencies": {
38
38
  "@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.37",
39
39
  "@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.37",
40
- "@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.38",
41
- "@applicaster/zapp-react-native-ui-components": "14.0.0-rc.38",
42
- "@applicaster/zapp-react-native-utils": "14.0.0-rc.38",
40
+ "@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.39",
41
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-rc.39",
42
+ "@applicaster/zapp-react-native-utils": "14.0.0-rc.39",
43
43
  "query-string": "7.1.3",
44
44
  "shaka-player": "4.3.5",
45
45
  "typeface-montserrat": "^0.0.54",
@@ -32,14 +32,15 @@ const directionStyles = (isLandscape: boolean): ViewStyle => {
32
32
  type AnimatedModalProps = {
33
33
  enabled?: boolean;
34
34
  pip?: boolean;
35
+ fullscreen?: boolean;
35
36
  content?: (
36
- opacity: Animated.Value | Animated.AnimatedInterpolation
37
+ opacity: Animated.Value | Animated.AnimatedInterpolation<number>
37
38
  ) => ReactElement;
38
39
  collapsedContent?: (
39
- opacity: Animated.Value | Animated.AnimatedInterpolation
40
+ opacity: Animated.Value | Animated.AnimatedInterpolation<number>
40
41
  ) => ReactElement;
41
42
  extraContent?: (
42
- opacity: Animated.Value | Animated.AnimatedInterpolation
43
+ opacity: Animated.Value | Animated.AnimatedInterpolation<number>
43
44
  ) => ReactElement;
44
45
  aspectRatio?: number;
45
46
  isTabletPortrait?: boolean;
@@ -61,6 +62,7 @@ export function VideoPlayerModal({
61
62
  isTabletPortrait,
62
63
  style,
63
64
  pip = false,
65
+ fullscreen = false,
64
66
  }: AnimatedModalProps) {
65
67
  const isTablet = useIsTablet();
66
68
 
@@ -91,65 +93,78 @@ export function VideoPlayerModal({
91
93
 
92
94
  const insets = useSafeAreaInsets();
93
95
 
96
+ const isFullScreenOrPIP = fullscreen || pip;
97
+
94
98
  // Interpolated opacities for smooth cross-fade
95
- const collapsedOpacity = translateY.interpolate({
96
- inputRange: [MODAL_COLLAPSE_START, height - collapsedHeight],
97
- outputRange: [0, 1],
98
- extrapolate: "clamp",
99
- });
100
-
101
- const expandedOpacity = translateY.interpolate({
102
- inputRange: [0, height - collapsedHeight],
103
- outputRange: [1, 0],
104
- extrapolate: "clamp",
105
- });
106
-
107
- const xPosition = translateY.interpolate({
108
- inputRange: [height * VIDEO_TRANSITION_THRESHOLD, height - collapsedHeight],
109
- outputRange: [0, -(width - width * SCALE_FACTOR) / 2],
110
- extrapolate: "clamp",
111
- });
99
+ const collapsedOpacity = !isFullScreenOrPIP
100
+ ? translateY.interpolate({
101
+ inputRange: [MODAL_COLLAPSE_START, height - collapsedHeight],
102
+ outputRange: [0, 1],
103
+ extrapolate: "clamp",
104
+ })
105
+ : new Animated.Value(0);
106
+
107
+ const expandedOpacity = !isFullScreenOrPIP
108
+ ? translateY.interpolate({
109
+ inputRange: [0, height - collapsedHeight],
110
+ outputRange: [1, 0],
111
+ extrapolate: "clamp",
112
+ })
113
+ : new Animated.Value(1);
114
+
115
+ const xPosition = !isFullScreenOrPIP
116
+ ? translateY.interpolate({
117
+ inputRange: [
118
+ height * VIDEO_TRANSITION_THRESHOLD,
119
+ height - collapsedHeight,
120
+ ],
121
+ outputRange: [0, -(width - width * SCALE_FACTOR) / 2],
122
+ extrapolate: "clamp",
123
+ })
124
+ : new Animated.Value(0);
112
125
 
113
126
  const vidHeight = width / aspectRatio;
114
127
 
115
- const yPosition = translateY.interpolate({
116
- inputRange: [height * VIDEO_TRANSITION_THRESHOLD, height - collapsedHeight],
117
- outputRange: [
118
- 0,
119
- isTablet && isTabletLandscape
120
- ? -(
121
- (-PROGRESS_BAR_HEIGHT + SCREEN_HEIGHT - vidHeight * SCALE_FACTOR) /
122
- 2
123
- )
124
- : -(
125
- PROGRESS_BAR_HEIGHT +
126
- insets.top / 2 +
127
- (SCREEN_WIDTH / aspectRatio -
128
- (SCREEN_WIDTH / aspectRatio) * SCALE_FACTOR) /
129
- 2
130
- ),
131
- ],
132
- extrapolate: "clamp",
133
- });
134
-
135
- const scalePosition = translateY.interpolate({
136
- inputRange: [
137
- SCREEN_HEIGHT * VIDEO_TRANSITION_THRESHOLD,
138
- SCREEN_HEIGHT - collapsedHeight,
139
- ],
140
- outputRange: [1, SCALE_FACTOR],
141
- extrapolate: "clamp",
142
- });
143
-
144
- const borderTopRadiusAnimated = translateY.interpolate({
145
- inputRange: [0, SCREEN_HEIGHT - collapsedHeight],
146
- outputRange: [MODAL_RADIUS, 0],
147
- extrapolate: "clamp",
148
- });
149
-
150
- if (pip) {
151
- return content(new Animated.Value(1));
152
- }
128
+ const yPosition = !isFullScreenOrPIP
129
+ ? translateY.interpolate({
130
+ inputRange: [
131
+ height * VIDEO_TRANSITION_THRESHOLD,
132
+ height - collapsedHeight,
133
+ ],
134
+ outputRange: [
135
+ 0,
136
+ isTablet && isTabletLandscape
137
+ ? -((-PROGRESS_BAR_HEIGHT + height - vidHeight * SCALE_FACTOR) / 2)
138
+ : -(
139
+ PROGRESS_BAR_HEIGHT +
140
+ insets.top / 2 +
141
+ (SCREEN_WIDTH / aspectRatio -
142
+ (SCREEN_WIDTH / aspectRatio) * SCALE_FACTOR) /
143
+ 2
144
+ ),
145
+ ],
146
+ extrapolate: "clamp",
147
+ })
148
+ : new Animated.Value(0);
149
+
150
+ const scalePosition = !isFullScreenOrPIP
151
+ ? translateY.interpolate({
152
+ inputRange: [
153
+ height * VIDEO_TRANSITION_THRESHOLD,
154
+ height - collapsedHeight,
155
+ ],
156
+ outputRange: [1, SCALE_FACTOR],
157
+ extrapolate: "clamp",
158
+ })
159
+ : new Animated.Value(1);
160
+
161
+ const borderTopRadiusAnimated = !isFullScreenOrPIP
162
+ ? translateY.interpolate({
163
+ inputRange: [0, height - collapsedHeight],
164
+ outputRange: [MODAL_RADIUS, 0],
165
+ extrapolate: "clamp",
166
+ })
167
+ : new Animated.Value(0);
153
168
 
154
169
  return (
155
170
  <PanGestureHandler
@@ -164,8 +179,8 @@ export function VideoPlayerModal({
164
179
  {
165
180
  borderTopLeftRadius: borderTopRadiusAnimated,
166
181
  borderTopRightRadius: borderTopRadiusAnimated,
167
- transform: [{ translateY }],
168
- height: SCREEN_HEIGHT,
182
+ transform: [{ translateY: isFullScreenOrPIP ? 0 : translateY }],
183
+ height: height,
169
184
  },
170
185
  ]}
171
186
  >
@@ -177,7 +192,7 @@ export function VideoPlayerModal({
177
192
  {
178
193
  borderTopLeftRadius: borderTopRadiusAnimated,
179
194
  borderTopRightRadius: borderTopRadiusAnimated,
180
- height: SCREEN_HEIGHT,
195
+ height: height,
181
196
  },
182
197
  ]}
183
198
  >
@@ -215,21 +230,23 @@ export function VideoPlayerModal({
215
230
  ) : null}
216
231
  </Animated.View>
217
232
 
218
- <Animated.View
219
- pointerEvents={collapsed ? "box-none" : "none"}
220
- style={[
221
- styles.collapsedBarContainer,
222
- { opacity: collapsedOpacity },
223
- ]}
224
- >
225
- <Pressable
226
- testID="collapsedBarWrapper"
227
- onPress={expand}
228
- style={styles.collapsedBarWrapper}
233
+ {!isFullScreenOrPIP ? (
234
+ <Animated.View
235
+ pointerEvents={collapsed ? "box-none" : "none"}
236
+ style={[
237
+ styles.collapsedBarContainer,
238
+ { opacity: collapsedOpacity },
239
+ ]}
229
240
  >
230
- {collapsedContent}
231
- </Pressable>
232
- </Animated.View>
241
+ <Pressable
242
+ testID="collapsedBarWrapper"
243
+ onPress={expand}
244
+ style={styles.collapsedBarWrapper}
245
+ >
246
+ {collapsedContent}
247
+ </Pressable>
248
+ </Animated.View>
249
+ ) : null}
233
250
  </Animated.View>
234
251
  </Animated.View>
235
252
  </PanGestureHandler>
@@ -1036,6 +1036,7 @@ export default class VideoPlayer extends React.Component<
1036
1036
  isTabletPortrait={isTabletPortrait}
1037
1037
  aspectRatio={aspectRatio}
1038
1038
  pip={this.state.piped}
1039
+ fullscreen={fullscreen}
1039
1040
  style={{
1040
1041
  tabletLandscapeWidth: getTabletWidth(
1041
1042
  this.getPluginConfiguration().tablet_landscape_sidebar_width,