当在模式中使用React-Native-Video时不显示控制

问题描述

在我的RN应用程序中,我使用react-native-video。在屏幕内使用时,它可以正常工作。控件是可见的。但是,当我在模式模块中尝试该视频时,该视频有效,但是控件未显示

这是代码

视频播放器组件。

const VideoModal = ({ active,data,onClose }: IProps) => (
  <Modal
    visible={active}
    // fullScreen={true}
    // animationType='slide'
    onRequestClose={() => onClose()}>
    {/* <View style={styles.modalContentContainer}> */}
    <VideoPlayer source={data.source} />
    {/* </View> */}
  </Modal>
);

模式。

 <VideoModal
        active={videoModalActive}
        data={{
          source:
            'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',// 'file:///storage/emulated/0/Movies/campaignVideo.mp4',}}
        onClose={toggleVideoModal}
      />

这样调用模式。

zip.addLocalFolder(`/path/to/folder`,`./`);
var data = zip.toBuffer();
fs.writeFile(`path/to/download.zip`,function (err) {
    if (err) return console.log(err);
    res.download(`path/to/download.zip`)
});

为什么仅在模态上运行时才隐藏控件?

解决方法

"react-native-video" 有这个问题,在 Modal 中没有显示控件。

使用: npm i react-native-video-controls 它服务于目的。

For more details check here