【问题标题】:Add TouchableOpacity for react-native-video-controls为 react-native-video-controls 添加 TouchableOpacity
【发布时间】:2019-06-17 17:56:56
【问题描述】:

全部,

我们正在开发一个具有视频功能的 react-native 应用,我们正在使用 react-native-video-controls 模块来处理它。

一个用例是我们必须在网格中显示视频文件,当我们点击每个项目时,它应该像在什么应用程序中一样以完整模式播放。

我们可以调整手柄中视频播放器的大小并设置播放按钮吗?因此,当单击播放按钮时,它应该以完整模式打开。

无法实现视频按钮。

  <VideoPlayer 
    onPress={()=> { this.props.playMedia(this.props.content) }} 
    source={{ uri: this.props.content }} 
    disableVolume 
    disableFullscreen
    paused={true} 
    fullscreen={false} 
    disableSeekbar 
    disableVolume 
    disableTimer 
    disableBack 
    onPlay={() => { this.props.playMedia(this.props.content) }} >
         {/* <TouchableOpacity 
               onPress={() => { console.log(this.props.content); 
                          this.props.playMedia(this.props.content) 
                        }} >
             </TouchableOpacity> 
          */}
</VideoPlayer>

【问题讨论】:

  • 您是否尝试过绕过具有高度、宽度或弹性的样式来调整 VideoPlayer 组件的大小?

标签: android ios react-native video-player


【解决方案1】:

您可以创建具有绝对定位的可触摸不透明度,而不是通过更改 VideoPlayer 中的“暂停”道具值来播放视频

【讨论】:

    猜你喜欢
    • 2019-05-29
    • 1970-01-01
    • 2018-02-05
    • 1970-01-01
    • 2020-04-08
    • 1970-01-01
    • 2018-08-20
    • 2019-07-13
    • 2018-09-11
    相关资源
    最近更新 更多