fix player web
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { useIsFocused, useRoute } from "@react-navigation/native";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import { BlurView } from "expo-blur";
|
||||
import { VideoView, useVideoPlayer } from "expo-video";
|
||||
import React, {
|
||||
@@ -22,6 +21,7 @@ import {
|
||||
usersRef,
|
||||
} from "../../config/firebase";
|
||||
import useDataFromRef from "../../hooks/useDataFromRef";
|
||||
import useSharedAudioPlayer from "../../hooks/useSharedAudioPlayer";
|
||||
import { Routes } from "../../navigation";
|
||||
import { navigate } from "../../navigation/NavigationService";
|
||||
import { useUser } from "../../providers/UserDataProvider";
|
||||
@@ -116,7 +116,11 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => {
|
||||
const creatorName = item?.userName;
|
||||
|
||||
const audioPlayer = useSharedAudioPlayer(audioSource || undefined, {
|
||||
id: item?.id ? `playback-${item.id}` : audioSource?.uri ? `playback-${audioSource.uri}` : undefined,
|
||||
id: item?.id
|
||||
? `playback-${item.id}`
|
||||
: audioSource?.uri
|
||||
? `playback-${audioSource.uri}`
|
||||
: undefined,
|
||||
title: typeof item?.title === "string" ? item.title : "",
|
||||
artist: typeof item?.userName === "string" ? item.userName : "",
|
||||
artwork: item?.coverUrl || null,
|
||||
@@ -217,57 +221,6 @@ const PlaybackItem = ({ item, isActive, userCache, getUserByUid }) => {
|
||||
backgroundColor: "black",
|
||||
}}
|
||||
>
|
||||
{(projectTitle || creatorName) && (
|
||||
<View
|
||||
pointerEvents="none"
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: Platform.select({ ios: 64, default: 48 }),
|
||||
left: 24,
|
||||
right: 24,
|
||||
zIndex: 12,
|
||||
}}
|
||||
>
|
||||
<BlurView
|
||||
tint="dark"
|
||||
intensity={Platform.OS !== "ios" ? 20 : 30}
|
||||
style={{
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 12,
|
||||
borderRadius: 18,
|
||||
backgroundColor: "rgba(0,0,0,0.45)",
|
||||
gap: 4,
|
||||
overflow: "hidden",
|
||||
}}
|
||||
>
|
||||
{projectTitle ? (
|
||||
<Text
|
||||
numberOfLines={1}
|
||||
style={{
|
||||
color: Palette.white,
|
||||
fontSize: 18,
|
||||
fontFamily: FONT_FAMILY.InterSemiBold,
|
||||
}}
|
||||
>
|
||||
{projectTitle}
|
||||
</Text>
|
||||
) : null}
|
||||
{creatorName ? (
|
||||
<Text
|
||||
numberOfLines={1}
|
||||
style={{
|
||||
color: Palette.white,
|
||||
fontSize: 14,
|
||||
fontFamily: FONT_FAMILY.InterMedium,
|
||||
opacity: 0.9,
|
||||
}}
|
||||
>
|
||||
{creatorName}
|
||||
</Text>
|
||||
) : null}
|
||||
</BlurView>
|
||||
</View>
|
||||
)}
|
||||
{!!videoUrl ? (
|
||||
<VideoView
|
||||
player={videoPlayer}
|
||||
|
||||
Reference in New Issue
Block a user