我正在将react-native-video用于视频播放器,但未显示视频列表的预览。
请检查
<Video
ref={ref => this._video = ref}
source={{ uri: "https://www.radiantmediaplayer.com/media/bbb-360p.mp4" }}
resizeMode={'cover'}
repeat={true}
paused = {true}
style={{
height: 200,
width: 200,
}}
onLoad={() => {
this._video.seek(2);
}} />
<Video
ref={ref => this._video = ref}
source={{ uri: "https://www.radiantmediaplayer.com/media/bbb-360p.mp4" }}
resizeMode={'cover'}
repeat={true}
paused = {true}
style={{
height: 200,
width: 200,
}}
onLoad={() => {
this._video.seek(2);
}} />
<Video
ref={ref => this._video = ref}
source={{ uri: "https://www.radiantmediaplayer.com/media/bbb-360p.mp4" }}
resizeMode={'cover'}
repeat={true}
paused = {true}
style={{
height: 200,
width: 200,
}}
onLoad={() => {
this._video.seek(2);
}} />
仅显示第一个视频的预览。
如果不可能,那么任何人都可以向我建议其他任何一个通过url进行视频预览的库。
谢谢!
答案 0 :(得分:0)
最后,我通过在每个标签中添加唯一的“ ref”找到了解决此问题的方法
<Video
ref={ref => this._video1 = ref}
source={{ uri: "https://www.radiantmediaplayer.com/media/bbb-360p.mp4" }}
resizeMode={'cover'}
repeat={true}
paused = {true}
style={{
height: 200,
width: 200,
}}
onLoad={() => {
this._video1.seek(2);
}} />
<Video
ref={ref => this._video2 = ref}
source={{ uri: "https://www.radiantmediaplayer.com/media/bbb-360p.mp4" }}
resizeMode={'cover'}
repeat={true}
paused = {true}
style={{
height: 200,
width: 200,
}}
onLoad={() => {
this._video2.seek(2);
}} />
谢谢!