mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
feat: play downloads
This commit is contained in:
@@ -5,7 +5,7 @@ import ContextMenu from "react-native-context-menu-view";
|
||||
import { useRouter } from "expo-router";
|
||||
import { Image, Text, View } from "tamagui";
|
||||
|
||||
// import { useDownloadManager } from "~/hooks/DownloadManagerContext";
|
||||
import { useDownloadManager } from "~/hooks/DownloadManagerContext";
|
||||
import { usePlayerStore } from "~/stores/player/store";
|
||||
|
||||
export interface ItemData {
|
||||
@@ -19,7 +19,7 @@ export interface ItemData {
|
||||
export default function Item({ data }: { data: ItemData }) {
|
||||
const resetVideo = usePlayerStore((state) => state.resetVideo);
|
||||
const router = useRouter();
|
||||
// const { startDownload } = useDownloadManager();
|
||||
const { startDownload } = useDownloadManager();
|
||||
|
||||
const { title, type, year, posterUrl } = data;
|
||||
|
||||
@@ -41,10 +41,10 @@ export default function Item({ data }: { data: ItemData }) {
|
||||
e: NativeSyntheticEvent<ContextMenuOnPressNativeEvent>,
|
||||
) => {
|
||||
console.log(e.nativeEvent.name);
|
||||
// startDownload(
|
||||
// "https://samplelib.com/lib/preview/mp4/sample-5s.mp4",
|
||||
// "mp4",
|
||||
// ).catch(console.error);
|
||||
startDownload(
|
||||
"https://samplelib.com/lib/preview/mp4/sample-5s.mp4",
|
||||
"mp4",
|
||||
).catch(console.error);
|
||||
};
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user