我正在为视频播放器使用反应原生视频,但它不显示视频列表的预览。
请检查此
<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 进行视频预览。
谢谢!
最后,
我通过在每个标签中添加唯一的"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);
}} />
谢谢!