@applicaster/quick-brick-player 12.0.0-alpha.3849101242 → 12.0.0-alpha.3893335783

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": "12.0.0-alpha.3849101242",
3
+ "version": "12.0.0-alpha.3893335783",
4
4
  "description": "Quick Brick Player",
5
5
  "main": "./src/index.ts",
6
6
  "types": "index.d.ts",
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "homepage": "https://github.com/applicaster/quickbrick#readme",
38
38
  "dependencies": {
39
- "@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.68",
39
+ "@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.58",
40
40
  "@applicaster/quick-brick-tv-transport-controls": "12.0.0-rc.62",
41
- "@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3849101242",
42
- "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3849101242",
43
- "@applicaster/zapp-react-native-utils": "12.0.0-alpha.3849101242",
41
+ "@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3893335783",
42
+ "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3893335783",
43
+ "@applicaster/zapp-react-native-utils": "12.0.0-alpha.3893335783",
44
44
  "keymirror": "^0.1.1",
45
45
  "query-string": "7.1.3",
46
46
  "react-native-web-linear-gradient": "1.1.2",
@@ -419,7 +419,6 @@ export default function DefaultLayout(props: LayoutProps) {
419
419
  startTimestamp={startTimestamp}
420
420
  endTimestamp={endTimestamp}
421
421
  isDateBasedLiveContent={isDateBasedLiveContent}
422
- onSkipLive={onSkipLive}
423
422
  />
424
423
 
425
424
  {showCounter && timeLeft >= 0 && (
@@ -1,6 +1,7 @@
1
+ // Disabling for now as lint can't recognise typescript definition here
1
2
  /* eslint-disable react/prop-types */
2
3
  import * as React from "react";
3
- import { Animated, StyleSheet, View } from "react-native";
4
+ import { StyleSheet, View } from "react-native";
4
5
  import LinearGradient from "../LinearGradient";
5
6
  import { getDominantColor, getPalettes } from "../../../utils/utils";
6
7
  import { useEffect } from "react";
@@ -10,7 +11,7 @@ type MagicBGProps = {
10
11
  image: string;
11
12
  fallbackUrl?: string;
12
13
  defaultColor: string;
13
- colors: string[];
14
+ colors: string[]; // Updated to type string[] as it holds hex values
14
15
  };
15
16
 
16
17
  const defaultColors = {
@@ -65,46 +66,31 @@ export const MagicBG: React.FC<MagicBGProps> = ({
65
66
  defaultColors.defaultGradientEnd,
66
67
  ]);
67
68
 
68
- const [backgroundColorAnim] = React.useState(new Animated.Value(0)); // from 0 to 1
69
- const [gradientOpacityAnim] = React.useState(new Animated.Value(0)); // from 0 to 1
70
-
71
69
  useEffect(() => {
72
- const animateColors = () => {
73
- Animated.timing(backgroundColorAnim, {
74
- toValue: 1,
75
- duration: 500,
76
- useNativeDriver: false,
77
- }).start();
78
-
79
- Animated.timing(gradientOpacityAnim, {
80
- toValue: 1,
81
- duration: 500,
82
- useNativeDriver: false,
83
- }).start();
84
- };
85
-
86
70
  const fetchColors = async () => {
71
+ // Check if colors are provided and not empty
87
72
  if (colors && colors.length > 0) {
88
- setGradientColors(colors.slice(0, 2));
89
- setDominantColor(colors[0]);
90
- animateColors();
73
+ // Use provided colors for gradient and dominant color
74
+ setGradientColors(colors.slice(0, 2)); // First 2 colors for gradient
75
+ setDominantColor(colors[0]); // First color as dominant
91
76
  } else if (image) {
77
+ // If no colors, try fetching from image
92
78
  try {
93
79
  const { gradientColors, dominantColor } =
94
80
  await fetchPaletteAndDominantColor(image);
95
81
 
96
82
  setGradientColors(gradientColors);
97
83
  setDominantColor(dominantColor);
98
- animateColors();
99
84
  } catch (error) {
85
+ // If image fetch fails, try fallback URL
100
86
  try {
101
87
  const { gradientColors, dominantColor } =
102
88
  await fetchPaletteAndDominantColor(fallbackUrl);
103
89
 
104
90
  setGradientColors(gradientColors);
105
91
  setDominantColor(dominantColor);
106
- animateColors();
107
92
  } catch {
93
+ // If everything fails, use default color
108
94
  setGradientColors([
109
95
  defaultColors.defaultGradientStart,
110
96
  defaultColors.defaultGradientEnd,
@@ -114,6 +100,7 @@ export const MagicBG: React.FC<MagicBGProps> = ({
114
100
  }
115
101
  }
116
102
  } else {
103
+ // If no image or colors, use default color
117
104
  setGradientColors([
118
105
  defaultColors.defaultGradientStart,
119
106
  defaultColors.defaultGradientEnd,
@@ -126,30 +113,11 @@ export const MagicBG: React.FC<MagicBGProps> = ({
126
113
  fetchColors();
127
114
  }, []);
128
115
 
129
- const interpolatedBackgroundColor = backgroundColorAnim.interpolate({
130
- inputRange: [0, 1],
131
- outputRange: ["black", dominantColor],
132
- });
133
-
134
116
  return (
135
- <Animated.View
136
- style={[
137
- styles.container,
138
- { backgroundColor: interpolatedBackgroundColor },
139
- ]}
140
- >
117
+ <View style={[styles.container, { backgroundColor: dominantColor }]}>
141
118
  <View style={styles.fullScreenOverlay} />
142
-
143
- <Animated.View
144
- style={[styles.gradientOverlay, { opacity: gradientOpacityAnim }]}
145
- >
146
- <LinearGradient
147
- colors={gradientColors}
148
- style={StyleSheet.absoluteFill}
149
- />
150
- </Animated.View>
151
-
119
+ <LinearGradient colors={gradientColors} style={styles.gradientOverlay} />
152
120
  {children}
153
- </Animated.View>
121
+ </View>
154
122
  );
155
123
  };
@@ -22,10 +22,6 @@ export const addQueryParam = (
22
22
  return `${urlWithoutQuery}?${updatedQueryString}`;
23
23
  };
24
24
 
25
- export const isValidDate = (dateString: string | undefined): boolean => {
26
- return (
27
- typeof dateString === "string" &&
28
- dateString.trim() !== "" &&
29
- dayjs.utc(dateString).isValid()
30
- );
25
+ export const isValidDate = (dateString: string): boolean => {
26
+ return dateString.trim() !== "" && dayjs.utc(dateString).isValid();
31
27
  };