ber*_*eal 5 react-native react-native-android react-native-video
我正在尝试在 react-native-video 中播放视频,但我只听到声音。我检查了文件是否有效(尝试了很少),所有回调都是在播放过程中触发的。为了缩小问题的范围,我做了以下示例:
<View style={{flex: 1, backgroundColor: 'grey', alignItems: 'stretch'}}>
<View style={{backgroundColor: 'blue', flex: 1}}/>
<Video
style={{flex: 1}}
source={{
uri: 'path/to/the/file.mp4',
type: 'mp4'
}}
resizeMode={"stretch"}
rate={1.0}
volume={1.0}
muted={false}
onProgress={console.log}
onLoadStart={console.log}
onLoad={console.log}
onEnd={console.log}
onError={console.log}
onBuffer={console.log}/>
<View style={{backgroundColor: 'green', flex: 1}}/>
</View>
Run Code Online (Sandbox Code Playgroud)
以便预期视频被其他具有蓝色和绿色背景的视图包围,并且父视图的背景为灰色。
这是我看到的:
所以图片不显示。在真实设备上尝试了相同的结果。会是什么呢?
更新,更多研究:添加controls={true}使控件在点击灰色区域后出现。
| 归档时间: |
|
| 查看次数: |
1379 次 |
| 最近记录: |