Попробуйте react-native-video
пакет для воспроизведения Vimeo
видео в проекте React Native.
Для установки с npm
npm install --save react-native-video
или используя yarn
:
yarn add react-native-video
Стоит отметить проблемы, которые могут возникнуть в ссылках ниже.
https://stackoverflow.com/a/52976151/5519329
https://stackoverflow.com/a/39982973/5519329
Код:
import Video from 'react-native-video';
<Video source={{uri: "your url"}} // Can be a URL or a local file.
ref={(ref) => {
this.player = ref
}} // Store reference
onBuffer={this.onBuffer} // Callback when remote video is buffering
onEnd={this.onEnd} // Callback when playback finishes
onError={this.videoError} // Callback when video cannot be loaded
style={styles.backgroundVideo} />
// Later on in your styles..
var styles = StyleSheet.create({
backgroundVideo: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
},
});