question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Rotation Issue

See original GitHub issue

Hi I have the player working in an app. On Android though, when I rotate the screen from portrait to landscape the video is squashed in the bottom half of the screen (see image). The player works fine with iOS

<View style={styles.fullScreen}>
      <Video 
             ref="VIDEO_WINDOW"
             source={{uri: this.state.source}}
             style={styles.fullScreen}
             rate={this.state.rate}
             paused={this.state.paused}
             volume={this.state.volume}
             muted={this.state.muted}
             resizeMode={this.state.resizeMode}
             onLoad={this.onLoad}
             onProgress={this.onProgress}
             onEnd={this._onEnd}
             repeat={false} />
         </View>

resizeMode = ‘contain’

Styles:

fullScreen: {
    position: 'absolute',
    top: 0,
    left: 0,
    bottom: 0,
    right: 0,
  },

screenshot_2016-01-21-10-37-55

PS - I’ve tried this on a Samsung Galaxy S3 (Android 4.4) and a Moto G (Android 5.0.2)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
vinayrcommented, Apr 19, 2016

I use a workaround like this -

  _onLayout = event => {
    const { width, height } = event.nativeEvent.layout;
    if (width > height) {
      this.setState({resizeMode: 'stretch'});
    } else {
      this.setState({resizeMode: 'contain'});
    }
  }
0reactions
zchwyngcommented, Oct 20, 2021

Closing this since it’s outdated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix It When Android Screen Won't Rotate - Lifewire
To turn off screen rotation on Android, tap Settings > Display > Auto-rotate screen > turn off Auto-rotate screen. How do I split...
Read more >
7 ways to fix Android screen rotation not working-Carlcare
7 ways to fix Android screen rotation not working · Restart your phone · Check Auto-rotation settings · Calibrate phone's sensors · Check...
Read more >
My Android Won't Auto-Rotate - What to Do - Technipages
Another reason why your Android device is not auto rotating is either because the G-sensor or the accelerometer is malfunctioning. First, run some...
Read more >
Auto Rotate Not Working on Android? Try These Fixes
7 Ways to Fix Auto Rotate Not Working on Android · Enable Auto-Rotate Feature on Android · Restart Your Android Mobile · Stop...
Read more >
How to Fix the Android Screen Rotation Not Working Issue
1. Turn Auto-Rotate On · 2. Restart Your Phone · 3. Check Third-Party Apps · 4. Calibrate Sensors on Your Android Phone ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found