ShariqMush / react-native-fullscreenvideo-player

A video player for React Native with controls
14 stars 34 forks source link

How to open fullscreen in Portrait instead in landscape #8

Open Ilario17 opened 6 years ago

Ilario17 commented 6 years ago

I can't find an option to stay in portrait.

Thanks

ShariqMush commented 6 years ago

@Ilario17 I have forced the screen to be locked in the portrait mode in fullscreen because I think that is the main point of having it fullscreen is because you want to see it in landscape otherwise you would just simply look at the normal rn player which is just easier to implement if you need portrait. If you really want to do this then you will have to change the code in the native java files I made for the fullscreen.

Ilario17 commented 6 years ago

@ShariqMush I'm using react-native-video-player because is really easy to setup, like thumbnail image. I add VideoPlayer inside an item in FlatList so the player is square. In iOS there isn't problem because the fullscreen button show the video in portrait mode, but I want to replicate this behavior in Android. Can you just add a props 'portrait' or 'landscape' ? If not, what I should change in java files? Thanks

sanu23kumar commented 4 years ago

Hey @Ilario17 Delete this line from VideoActivity.java

26 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

And change the manifest new line to

Now your view can autorotate.