@applicaster/quick-brick-player 12.0.0-alpha.3425722002 → 12.0.0-alpha.3479552302
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.
|
|
3
|
+
"version": "12.0.0-alpha.3479552302",
|
|
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.
|
|
39
|
+
"@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.33",
|
|
40
40
|
"@applicaster/quick-brick-tv-transport-controls": "11.0.0-rc.133",
|
|
41
|
-
"@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.
|
|
42
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.
|
|
43
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
41
|
+
"@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3479552302",
|
|
42
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3479552302",
|
|
43
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.3479552302",
|
|
44
44
|
"keymirror": "^0.1.1",
|
|
45
45
|
"query-string": "7.1.3",
|
|
46
46
|
"react-native-web-linear-gradient": "1.1.2",
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
NAMESPACE,
|
|
25
25
|
} from "./utils";
|
|
26
26
|
import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
|
|
27
|
-
import { getLiveUrl } from "../Utils";
|
|
27
|
+
import { addQueryParam, getLiveUrl } from "../Utils";
|
|
28
28
|
import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
|
|
29
29
|
|
|
30
30
|
const { log_debug } = createLogger({
|
|
@@ -144,9 +144,9 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
144
144
|
const isTablet = useIsTablet();
|
|
145
145
|
|
|
146
146
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
// TODO: Have generic place for live url from configuration. Currently its hardcoded for client.
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
const feedUrl = getLiveUrl(entry?.extensions?.live?.channel_src ?? "");
|
|
151
151
|
|
|
152
152
|
const { title, summary } = useTitleSummaryOverlay(
|
|
@@ -195,7 +195,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
195
195
|
});
|
|
196
196
|
|
|
197
197
|
setSleepTimerDate(0);
|
|
198
|
-
player?.pause();
|
|
199
198
|
|
|
200
199
|
await localStorage.removeItem("sleep", NAMESPACE);
|
|
201
200
|
};
|
|
@@ -456,17 +455,20 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
456
455
|
if (configuration.magic_background) {
|
|
457
456
|
const baseUrl = entry?.extensions?.audio_player_background_image ?? "";
|
|
458
457
|
|
|
459
|
-
|
|
458
|
+
const queryParamName =
|
|
459
|
+
configuration.audio_player_background_image_query || "width";
|
|
460
|
+
|
|
461
|
+
const queryParamValue = 15;
|
|
460
462
|
|
|
461
|
-
|
|
462
|
-
// configuration.audio_player_background_image_query || "width";
|
|
463
|
-
//
|
|
464
|
-
// const queryParamValue = 15;
|
|
465
|
-
//
|
|
466
|
-
// const url = addQueryParam(baseUrl, queryParamName, queryParamValue);
|
|
463
|
+
const url = addQueryParam(baseUrl, queryParamName, queryParamValue);
|
|
467
464
|
|
|
468
465
|
return (
|
|
469
|
-
<MagicBG
|
|
466
|
+
<MagicBG
|
|
467
|
+
image={url}
|
|
468
|
+
fallbackUrl={baseUrl}
|
|
469
|
+
colors={entry?.extensions?.backgroundColors}
|
|
470
|
+
defaultColor="#000000"
|
|
471
|
+
>
|
|
470
472
|
{MainContent}
|
|
471
473
|
</MagicBG>
|
|
472
474
|
);
|
|
@@ -11,9 +11,10 @@ type MagicBGProps = {
|
|
|
11
11
|
image: string;
|
|
12
12
|
fallbackUrl?: string;
|
|
13
13
|
defaultColor: string;
|
|
14
|
+
colors: string[]; // Updated to type string[] as it holds hex values
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
+
const defaultColors = {
|
|
17
18
|
overlay: "rgba(0, 0, 0, 0.35)",
|
|
18
19
|
defaultGradientStart: "rgba(0, 0, 0, 0.25)",
|
|
19
20
|
defaultGradientEnd: "rgba(0, 0, 0, 0)",
|
|
@@ -25,7 +26,7 @@ const styles = StyleSheet.create({
|
|
|
25
26
|
},
|
|
26
27
|
fullScreenOverlay: {
|
|
27
28
|
...StyleSheet.absoluteFillObject,
|
|
28
|
-
backgroundColor:
|
|
29
|
+
backgroundColor: defaultColors.overlay,
|
|
29
30
|
},
|
|
30
31
|
gradientOverlay: {
|
|
31
32
|
position: "absolute",
|
|
@@ -54,46 +55,63 @@ export const MagicBG: React.FC<MagicBGProps> = ({
|
|
|
54
55
|
children,
|
|
55
56
|
image,
|
|
56
57
|
fallbackUrl = "",
|
|
58
|
+
colors = [],
|
|
57
59
|
defaultColor,
|
|
58
60
|
}) => {
|
|
59
61
|
const [dominantColor, setDominantColor] =
|
|
60
62
|
React.useState<string>(defaultColor);
|
|
61
63
|
|
|
62
64
|
const [gradientColors, setGradientColors] = React.useState<string[]>([
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
defaultColors.defaultGradientStart,
|
|
66
|
+
defaultColors.defaultGradientEnd,
|
|
65
67
|
]);
|
|
66
68
|
|
|
67
69
|
useEffect(() => {
|
|
68
70
|
const fetchColors = async () => {
|
|
69
|
-
if
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
setDominantColor(dominantColor);
|
|
77
|
-
} catch (error) {
|
|
71
|
+
// Check if colors are provided and not empty
|
|
72
|
+
if (colors && colors.length > 0) {
|
|
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
|
|
76
|
+
} else if (image) {
|
|
77
|
+
// If no colors, try fetching from image
|
|
78
78
|
try {
|
|
79
79
|
const { gradientColors, dominantColor } =
|
|
80
|
-
await fetchPaletteAndDominantColor(
|
|
80
|
+
await fetchPaletteAndDominantColor(image);
|
|
81
81
|
|
|
82
82
|
setGradientColors(gradientColors);
|
|
83
83
|
setDominantColor(dominantColor);
|
|
84
|
-
} catch {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
} catch (error) {
|
|
85
|
+
// If image fetch fails, try fallback URL
|
|
86
|
+
try {
|
|
87
|
+
const { gradientColors, dominantColor } =
|
|
88
|
+
await fetchPaletteAndDominantColor(fallbackUrl);
|
|
89
|
+
|
|
90
|
+
setGradientColors(gradientColors);
|
|
91
|
+
setDominantColor(dominantColor);
|
|
92
|
+
} catch {
|
|
93
|
+
// If everything fails, use default color
|
|
94
|
+
setGradientColors([
|
|
95
|
+
defaultColors.defaultGradientStart,
|
|
96
|
+
defaultColors.defaultGradientEnd,
|
|
97
|
+
]);
|
|
98
|
+
|
|
99
|
+
setDominantColor(defaultColor);
|
|
100
|
+
}
|
|
91
101
|
}
|
|
102
|
+
} else {
|
|
103
|
+
// If no image or colors, use default color
|
|
104
|
+
setGradientColors([
|
|
105
|
+
defaultColors.defaultGradientStart,
|
|
106
|
+
defaultColors.defaultGradientEnd,
|
|
107
|
+
]);
|
|
108
|
+
|
|
109
|
+
setDominantColor(defaultColor);
|
|
92
110
|
}
|
|
93
111
|
};
|
|
94
112
|
|
|
95
113
|
fetchColors();
|
|
96
|
-
}, [
|
|
114
|
+
}, []);
|
|
97
115
|
|
|
98
116
|
return (
|
|
99
117
|
<View style={[styles.container, { backgroundColor: dominantColor }]}>
|
package/src/Player/index.tsx
CHANGED
|
@@ -853,11 +853,10 @@ export default class VideoPlayer extends React.Component<
|
|
|
853
853
|
!!this.props.controller?.supportsNativeControls?.();
|
|
854
854
|
|
|
855
855
|
const controls = isAppleTV()
|
|
856
|
-
? supportsNativeControls && isInlineTV && !this.getPlayNextData()
|
|
856
|
+
? supportsNativeControls && !isInlineTV && !this.getPlayNextData()
|
|
857
857
|
: supportsNativeControls && !this.getPlayNextData();
|
|
858
858
|
|
|
859
|
-
const shouldUseNativeControls =
|
|
860
|
-
controls && supportsNativeControls && !docked;
|
|
859
|
+
const shouldUseNativeControls = controls && !docked;
|
|
861
860
|
|
|
862
861
|
platformSpecificProps = {
|
|
863
862
|
...platformSpecificProps,
|