mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-22 19:58:35 -06:00
updates to cards and trying to get this player to work
This commit is contained in:
@@ -54,8 +54,6 @@ export function Card(props: CardProps) {
|
||||
<TamaguiCard.Background>
|
||||
{props.blurhash && !imageLoaded && (
|
||||
<Blurhash
|
||||
decodeWidth={dimensions.width}
|
||||
decodeHeight={dimensions.height}
|
||||
blurhash={props.blurhash}
|
||||
/>
|
||||
)}
|
||||
@@ -69,7 +67,7 @@ export function Card(props: CardProps) {
|
||||
}
|
||||
imageStyle={{
|
||||
...dimensions,
|
||||
borderRadius: 25
|
||||
borderRadius: props.cornered ? 2 : 25
|
||||
}}
|
||||
onLoadEnd={() => setImageLoaded(true)}
|
||||
/>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import React from "react";
|
||||
import { Text, View, XStack, YStack } from "tamagui";
|
||||
import { Text, XStack, YStack } from "tamagui";
|
||||
import { useActiveTrack } from "react-native-track-player";
|
||||
import { JellifyTrack } from "../../types/JellifyTrack";
|
||||
import { usePlayerContext } from "../../player/provider";
|
||||
import { BottomTabNavigationEventMap, BottomTabNavigationProp } from "@react-navigation/bottom-tabs";
|
||||
import { NavigationHelpers, ParamListBase } from "@react-navigation/native";
|
||||
import { BlurView } from "@react-native-community/blur";
|
||||
|
||||
export function Miniplayer({ navigation }: { navigation : NavigationHelpers<ParamListBase, BottomTabNavigationEventMap> }) : React.JSX.Element {
|
||||
|
||||
@@ -13,12 +14,12 @@ export function Miniplayer({ navigation }: { navigation : NavigationHelpers<Para
|
||||
const { setShowPlayer } = usePlayerContext();
|
||||
|
||||
return (
|
||||
<View backgroundColor="$black5" onPress={() => navigation.navigate("Player")}>
|
||||
<BlurView onPointerDown={() => navigation.navigate("Player")}>
|
||||
<XStack>
|
||||
<YStack>
|
||||
<Text>{activeTrack?.title ?? "Nothing Playing"}</Text>
|
||||
</YStack>
|
||||
</XStack>
|
||||
</View>
|
||||
</BlurView>
|
||||
)
|
||||
}
|
||||
@@ -18,7 +18,13 @@ export default function Navigation(): React.JSX.Element {
|
||||
/>
|
||||
</RootStack.Group>
|
||||
<RootStack.Group screenOptions={{ presentation: 'modal' }}>
|
||||
<RootStack.Screen name="Player" component={Player} />
|
||||
<RootStack.Screen
|
||||
name="Player"
|
||||
component={Player}
|
||||
options={{
|
||||
headerShown: false
|
||||
}}
|
||||
/>
|
||||
</RootStack.Group>
|
||||
</RootStack.Navigator>
|
||||
)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import { JellifyTrack } from "../types/JellifyTrack";
|
||||
import { JellifyServer } from "../types/JellifyServer";
|
||||
import { TrackType } from "react-native-track-player";
|
||||
import { Api } from "@jellyfin/sdk";
|
||||
import { getDynamicHlsApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
import { QueuingType } from "../enums/queuing-type";
|
||||
|
||||
export function mapDtoToTrack(api: Api, item: BaseItemDto) {
|
||||
export function mapDtoToTrack(api: Api, item: BaseItemDto, queuingType?: QueuingType) {
|
||||
|
||||
return {
|
||||
url: `${api.basePath}/Audio/${item.Id!}/universal?TranscodingProtocol=hls?EnableRemoteMedia=true?EnableRedirection=true`,
|
||||
@@ -13,6 +12,11 @@ export function mapDtoToTrack(api: Api, item: BaseItemDto) {
|
||||
headers: {
|
||||
"X-Emby-Token": api.accessToken
|
||||
|
||||
}
|
||||
},
|
||||
title: item.Name,
|
||||
album: item.Album,
|
||||
artist: item.Artists?.join(", "),
|
||||
duration: item.RunTimeTicks,
|
||||
QueuingType: queuingType ?? QueuingType.DirectlyQueued
|
||||
} as JellifyTrack
|
||||
}
|
||||
11
package-lock.json
generated
11
package-lock.json
generated
@@ -12,6 +12,7 @@
|
||||
"@gcores/react-native-carplay": "^1.1.12",
|
||||
"@georstat/react-native-image-cache": "^3.1.0",
|
||||
"@jellyfin/sdk": "^0.10.0",
|
||||
"@react-native-community/blur": "^4.4.1",
|
||||
"@react-native-community/masked-view": "^0.1.11",
|
||||
"@react-native-masked-view/masked-view": "^0.3.1",
|
||||
"@react-navigation/bottom-tabs": "^6.6.1",
|
||||
@@ -5869,6 +5870,16 @@
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/@react-native-community/blur": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@react-native-community/blur/-/blur-4.4.1.tgz",
|
||||
"integrity": "sha512-XBSsRiYxE/MOEln2ayunShfJtWztHwUxLFcSL20o+HNNRnuUDv+GXkF6FmM2zE8ZUfrnhQ/zeTqvnuDPGw6O8A==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
"react-native": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@react-native-community/cli": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-14.0.0.tgz",
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"@gcores/react-native-carplay": "^1.1.12",
|
||||
"@georstat/react-native-image-cache": "^3.1.0",
|
||||
"@jellyfin/sdk": "^0.10.0",
|
||||
"@react-native-community/blur": "^4.4.1",
|
||||
"@react-native-community/masked-view": "^0.1.11",
|
||||
"@react-native-masked-view/masked-view": "^0.3.1",
|
||||
"@react-navigation/bottom-tabs": "^6.6.1",
|
||||
|
||||
@@ -2,7 +2,6 @@ import { createContext, ReactNode, SetStateAction, useContext, useState } from "
|
||||
import { JellifyTrack } from "../types/JellifyTrack";
|
||||
import { storage } from "../constants/storage";
|
||||
import { MMKVStorageKeys } from "../enums/mmkv-storage-keys";
|
||||
import { useActiveTrack, useProgress } from "react-native-track-player";
|
||||
import { findPlayQueueIndexStart } from "./mutators/helpers";
|
||||
import { add, remove, removeUpcomingTracks, setupPlayer } from "react-native-track-player/lib/src/trackPlayer";
|
||||
import _ from "lodash";
|
||||
|
||||
Reference in New Issue
Block a user