Answer the question
In order to leave comments, you need to log in
How to resize videos in react-native-video-player?
Hey! I'm using react-native-video-player and I've run into a problem where in landscape orientation the video goes out of view and also pushes the navigation controls down.
I am using the following code:
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import VideoPlayer from 'react-native-video-player';
export default class VideoPage extends Component {
render() {
return (
<View>
<VideoPlayer
video={{ uri: 'file:///storage/emulated/0/Download/sample_video.mp4' }}
videoWidth={1280}
videoHeight={720}
/>
</View>
);
}
}
Answer the question
In order to leave comments, you need to log in
You can do it, but you need to solve the problem with changing the orientation from landscape to portrait
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import VideoPlayer from 'react-native-video-player';
export default class VideoPage extends Component {
render() {
return (
<View style={{height: 650, width: 1300, paddingLeft: 155}}>
<VideoPlayer
video={{ uri: 'file:///storage/emulated/0/Download/sample_video.mp4' }}
/>
</View>
);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question