问题描述
在FeathersJS中,将增量实现为here的最简单方法是什么:
import React,{ useState,useEffect } from 'react';
import { Button,View,Platform } from 'react-native';
import * as ImagePicker from 'expo-image-picker';
import { Video } from 'expo-av';
import Constants from 'expo-constants';
export default function ImagePickerExample() {
const [image,setVideo] = useState(null);
useEffect(() => {
(async () => {
if (Platform.OS !== 'web') {
const { status } = await ImagePicker.requestCameraRollPermissionsAsync();
if (status !== 'granted') {
alert('Sorry,we need camera roll permissions to make this work!');
}
}
})();
},[]);
const pickVideo = async () => {
let result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Videos,allowsEditing: true,aspect: [4,3],quality: 1,});
console.log(result);
if (!result.cancelled) {
setImage(result.uri);
}
};
return (
<View style={{ flex: 1,alignItems: 'center',justifyContent: 'center' }}>
<Button title="Pick an Video from camera roll" onPress={pickImage} />
{Video && <Video source={{ uri: video }} style={{ width: 200,height: 200 }} />}
</View>``
);
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)