嵌入到expo-av的视频组件中时,expo-camera返回的视频URL会显示空白屏幕

问题描述

我尝试使用expo-camera捕获视频,一旦录制了视频,因为我们得到了一个视频uri,我用这个uri来显示预览,显示预览时我使用了expo的视频组件-av, 但是视频组件显示空白屏幕。有人可以提出修复建议吗?

  const takeVideo = async ()=>{
  
    if(cameraRef)
    {
        setIsRecording(true);
      
       
        let res = await cameraRef.recordAsync();
        
       
        console.log(res);

        setVideoUri(res.uri);
        setVideoModalVisible(true);
        setIsRecording(false);

        
    }

  }


  const VideoPreview = (props)=>{

   
    return (
      
       <Modal visible={videoModalVisible}>
       <View style={{ flex: 1,margin: 50,paddingTop: 20,flexDirection: "column",justifyContent: "flex-start",alignItems: "center",backgroundColor: "white" }}>
 
 
       <Video
        source={{ uri: videoUri }}
        rate={1.0}
        volume={1.0}
        isMuted={false}
        resizeMode="cover"
        shouldplay = {false}
        isLooping = {false}
      
        useNativeControls
        style={{width:width*0.75,height:height*0.5}}
      />
         <View style={{ flexDirection: "column" }}>
 
           <Button mode="contained" style={{ margin: 5 }} onPress={() => { sendFile(videoUri,"video"); }}>Send</Button>
 
           <Button mode="contained" style={{ margin: 5 }} onPress={() => { setVideoModalVisible(false) }}>Close</Button>
 
         </View>
 
 
       </View>
 
     </Modal>
 
    );

  }

这些是我使用的代码。请有人提出解决方案。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

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