如何正确地将视频传递到Shoutem HTML组件?

时间:2018-07-19 07:35:54

标签: react-native shoutem

我想在HTML组件中显示视频,但是当我传递字符串时

let body = '<video src="https://www.youtube.com/watch?v=vJJpnplTBeM" poster="https://img.youtube.com/vi/vJJpnplTBeM/maxresdefault.jpg"></video>';

到组件

return (<ScrollView>
    <Html body={body} style={{}}/>
</ScrollView>);

显示错误No suitable image URL loader found for (null)

如何正确地将视频传递到Shoutem HTML组件?

1 个答案:

答案 0 :(得分:0)

Shoutem的视频组件does what you're trying to do,您只需使用use it即可。

<Video
  source={{ uri: 'https://www.youtube.com/watch?v=myvideo' }}
  poster={'https://mypic.png'}
  height={200}
  width={300}
/>