import {useState} from 'react' import {Button, Dimensions, Pressable, Text, View} from 'react-native' import DocumentPicker, { DocumentPickerResponse, types, } from 'react-native-document-picker' import Video from 'react-native-video' import {backgroundColor} from './constants' const buttonWidth = '45%' export default function App() { const [files, setFiles] = useState([]) const [selected, setSelected] = useState(0) const [paused, setPaused] = useState(false) const [width, setWidth] = useState(0) const height = Dimensions.get('screen').height const pick = async () => { const picked = await DocumentPicker.pickMultiple({type: types.video}) setSelected(0) console.log(`Picked ${picked.length} files.`) setFiles(picked) } const prev = () => { if (selected <= 0) return setSelected(selected - 1) setPaused(false) } const next = () => { if (selected >= files.length - 1) return setSelected(selected + 1) setPaused(false) } return ( {files.length > 0 ? ( setPaused(!paused)}> {files[selected].name} ({selected + 1}/ {files.length})