React-native-youtube: [Android] Video is played with wrong aspect ratio in some cases

Created on 28 Nov 2018  路  4Comments  路  Source: davidohayon669/react-native-youtube

Platform: Android only
Versions:

  • react-native v55
  • react-navigation v2.12.1
  • react-native-youtube v1.1.0

Example of vertical video: https://www.youtube.com/watch?v=qr64OXFDD7A

I'm building a catalog of handpicked videos, and the whole app is basically 2 screens: a list and details (player) view.

Reproducing steps:

  1. Play random 9x16 video
  2. Navigate to list and open next video (which is vertical)

Actual: Video is stretched
screenshot 2018-11-28 13 58 24

Expected: Video played with proper aspect ratio
screenshot 2018-11-28 14 01 26

The workaround: navigate away from the screen (player control is unmounted) and return back to the exact same video (player control is mounted again) - now the video is refreshed and plays with proper aspect ratio as expected.

I may be wrong, but It feels like video player on Android (which is singleton?) doesn't refresh video metadata in this particular case, and does that when the video is played for the second time.

  • Is there a way to reset player instance?
  • Or maybe the way to force reloading the video metadata?
  • Any other hacks and tricks to force a player to stretch the video properly

Most helpful comment

Did anyone find the solution for this issue? I am also having same problem.

All 4 comments

Same problem

A somehow similar outcome is observed when entering fullscreen mode and returning back: https://github.com/inProgress-team/react-native-youtube/issues/345
Still didn't managed to fix the issue.

Did anyone find the solution for this issue? I am also having same problem.

you can check if c9a0c38c1799f7cfb7d3ad9435ad834c52ba56d8 does the trick for you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

berdof picture berdof  路  4Comments

jokopurnomoa picture jokopurnomoa  路  5Comments

alz10 picture alz10  路  4Comments

nhcuong95 picture nhcuong95  路  5Comments

savioseb picture savioseb  路  4Comments