rn-fetch-blob fs.readStream无法正常工作

问题描述

问题:

在我的本机应用程序中,我使用了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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...