android - 为 react-native-video-controls 添加 TouchableOpacity
问题描述
全部,
我们正在开发一个具有视频功能的 react-native 应用程序,并且我们正在使用 react-native-video-controls 模块来处理它。
一个用例是我们必须在网格中显示视频文件,当我们单击每个项目时,它应该像在什么应用程序中一样以完整模式播放。
我们可以在手柄中调整视频播放器的大小并设置播放按钮吗?因此,当单击播放按钮时,它应该以完整模式打开。
无法实现 Button 视频。
<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 中的“暂停”道具值来播放视频
推荐阅读
- vb.net - 如何在 vb.net 中保存用户输入
- oracle - 如何使用 SQLPLUS 直接连接到 Oracle 数据库链接
- excel - Excel - 从单列中获取年份范围
- ios - 从“数据”强制转换?to 'Data' 只解开可选项;你的意思是使用'!'?
- python - Python 中的通用 3D 体积图
- google-chrome - Chrome 上的 PowerApps 登录问题
- arrays - 如何在swift 4中计算数组的所有模式?
- node.js - 如何使用 nodejs 和 mongoose 从 mongodb 集合中删除数据
- ios - 试图将从 Firebase 加载的 UICollectionView 中的图像传递给另一个 VC
- c# - 在 api 中提供可选同步方法的优雅方式?