Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video Player Orientation Incorrect with <= KitKat OS devices #101

Open
ghostknow opened this issue Sep 2, 2018 · 2 comments
Open

Video Player Orientation Incorrect with <= KitKat OS devices #101

ghostknow opened this issue Sep 2, 2018 · 2 comments
Labels
bug stale Closed due to inactivity or lack or resources

Comments

@ghostknow
Copy link

Anyone have idea to solve this problem?

@petrogad
Copy link

Hey @ghostknow -

Pretty sure I just ran into this exact same issue on iPhone X's.

Looking at the package's default props, it's defaulting videos to a particular size which may not be right. I had to get my screens dimensions then pass that in as those props to correct the issue.

Here is a rough idea of what I did:

import React, {PureComponent} from 'react';
import {View} from 'react-native'
Import {View, Dimensions} from 'react-native';
import VideoPlayer from 'react-native-video-player';

const dimensions = Dimensions.get('window');

class MyVideoWrapper extends PureComponent {
  	state = {
		width: dimensions.width,
		height: dimensions.height
	};

       render() {
              <View onLayout=this.updateLayout}>
                     <VideoPlayer
                            video={{uri: yourSource}}
                            videoHeight={parseInt(this.state.height, 10)}
                            videoWidth={parseInt(this.state.width, 10)}
                     />
              </View>
       }

       updateLayout = () => {
              const {width, height} = Dimensions.get('window');
              this.setState({width, height});
       }
}

Copy link
Contributor

github-actions bot commented Jan 8, 2025

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.

@github-actions github-actions bot added the stale Closed due to inactivity or lack or resources label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Closed due to inactivity or lack or resources
Projects
None yet
Development

No branches or pull requests

3 participants