@applicaster/quick-brick-player 13.0.0-rc.138 → 13.0.0-rc.139
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 +5 -5
- package/src/Player/AudioLayer/Layout/PlayerImage/AnimatedImage.tsx +2 -6
- package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +2 -5
- package/src/Player/AudioLayer/Layout/PlayerImage/hooks/index.ts +2 -0
- package/src/Player/AudioLayer/Layout/PlayerImage/hooks/useBackgroundImage.ts +46 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "13.0.0-rc.
|
|
3
|
+
"version": "13.0.0-rc.139",
|
|
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": "13.0.0-rc.
|
|
38
|
+
"@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.139",
|
|
39
39
|
"@applicaster/quick-brick-tv-transport-controls": "13.0.0-rc.136",
|
|
40
|
-
"@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.
|
|
41
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-rc.
|
|
42
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-rc.
|
|
40
|
+
"@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.139",
|
|
41
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-rc.139",
|
|
42
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-rc.139",
|
|
43
43
|
"query-string": "7.1.3",
|
|
44
44
|
"react-native-web-linear-gradient": "1.1.2",
|
|
45
45
|
"shaka-player": "4.3.5",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
2
|
import { Image, Animated, StyleSheet, ImageStyle } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
5
4
|
import {
|
|
6
5
|
useModalAnimationContext,
|
|
7
6
|
PlayerAnimationStateEnum,
|
|
@@ -10,7 +9,7 @@ import {
|
|
|
10
9
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
11
10
|
import { PlayerAnimationStateT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext";
|
|
12
11
|
|
|
13
|
-
import { useChangePlayerState } from "./hooks";
|
|
12
|
+
import { useChangePlayerState, useBackgroundImage } from "./hooks";
|
|
14
13
|
|
|
15
14
|
const styles = StyleSheet.create({
|
|
16
15
|
container: {
|
|
@@ -30,10 +29,7 @@ type Props = PropsWithChildren<{
|
|
|
30
29
|
export const AnimatedImage = ({ entry, style, imageWidth, docked }: Props) => {
|
|
31
30
|
const heightAnim = React.useRef(new Animated.Value(imageWidth)).current;
|
|
32
31
|
|
|
33
|
-
const source =
|
|
34
|
-
() => ({ uri: imageSrcFromMediaItem(entry, undefined) }),
|
|
35
|
-
[entry]
|
|
36
|
-
);
|
|
32
|
+
const source = useBackgroundImage({ entry });
|
|
37
33
|
|
|
38
34
|
const { minimisedHeight } = useModalAnimationContext();
|
|
39
35
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Image, ImageStyle } from "react-native";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { useBackgroundImage } from "./hooks";
|
|
5
5
|
|
|
6
6
|
type Props = {
|
|
7
7
|
entry: ZappEntry;
|
|
@@ -9,10 +9,7 @@ type Props = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const FlexImage = ({ entry, style }: Props) => {
|
|
12
|
-
const source =
|
|
13
|
-
() => ({ uri: imageSrcFromMediaItem(entry, undefined) }),
|
|
14
|
-
[entry]
|
|
15
|
-
);
|
|
12
|
+
const source = useBackgroundImage({ entry });
|
|
16
13
|
|
|
17
14
|
if (!source) return null;
|
|
18
15
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useZStore } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
3
|
+
import { getBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
|
|
4
|
+
|
|
5
|
+
const audioPlayerImageKeySelector = (config) => config?.audio_player_image_key;
|
|
6
|
+
|
|
7
|
+
const audioPlayerBackgroundImageSelector = (config) =>
|
|
8
|
+
config?.audio_player_background_image;
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
entry: ZappEntry;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type Return = {
|
|
15
|
+
uri: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const useBackgroundImage = ({ entry }: Props): Return => {
|
|
19
|
+
const configuration = useZStore("playerConfiguration");
|
|
20
|
+
|
|
21
|
+
const audio_player_image_key = configuration(audioPlayerImageKeySelector);
|
|
22
|
+
|
|
23
|
+
const audio_player_background_image = configuration(
|
|
24
|
+
audioPlayerBackgroundImageSelector
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const pluginConfiguration = React.useMemo(
|
|
28
|
+
() => ({
|
|
29
|
+
audio_player_image_key,
|
|
30
|
+
audio_player_background_image,
|
|
31
|
+
}),
|
|
32
|
+
[audio_player_image_key, audio_player_background_image]
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const source = React.useMemo(
|
|
36
|
+
() => ({
|
|
37
|
+
uri: getBackgroundImage({
|
|
38
|
+
entry,
|
|
39
|
+
plugin_configuration: pluginConfiguration,
|
|
40
|
+
}),
|
|
41
|
+
}),
|
|
42
|
+
[entry, pluginConfiguration]
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return source;
|
|
46
|
+
};
|