问题描述
问题:
在我的本机应用程序中,我使用了rn-fetch-blob fs.readstream。但是在读取流stream.onEnd后不会触发。
我已经这样使用了。
options = {
title: strings('picker.q-v-pick'),takePhotoButtonTitle: strings('picker.tphoto'),chooseFromLibraryButtonTitle: strings('picker.cgallery'),cancelButtonTitle: strings('picker.cancel'),mediaType: 'video',durationLimit: question.question.duration,videoQuality: Platform.OS === 'android' ? 'medium' : 'low',storageOptions: {
skipBackup: true,path: 'images',},};
ImagePicker.launchCamera(options,(response) => {
if (response.didCancel) {
console.log('User cancelled image picker');
} else if (response.error) {
console.log('ImagePicker Error: ',response.error);
} else if (response.customButton) {
console.log('User tapped custom button: ',response.customButton);
} else {
RNFetchBlob.fs.readStream(response.path,'base64').then((stream) => {
let bitData = '';
stream.open();
stream.onData((chunk) => {
// console.log(chunk);
bitData += chunk;
});
stream.onEnd(() => {
console.log('HIIi');
console.log(bitData,'uuu');
});
// response['data'] = data;
// response['type'] = 'mp4';
// response['fileName'] = 'videomulti.mp4';
// setFileObject(response);
});
}
});
stream.open和onData函数被触发,但是stream.OnEnd不触发,有人可以帮助我解决此问题吗?我对此一无所知。非常感谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)