Hi,
I am implementing JW VR Player. My question is how to set fullscreen when the device is rotated to landscape
Here is my code:
@Override
public void onConfigurationChanged(Configuration newConfig) {
// Set fullscreen when the device is rotated to landscape
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE & !mVrVideoView.isFullscreen()) {
mVrVideoView.toggleFullscreen(true);
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT & mVrVideoView.isFullscreen()) {
mVrVideoView.toggleFullscreen(false);
}
super.onConfigurationChanged(newConfig);
}
@Override
public void onFullscreenToggled() {
mCoordinatorLayout.setFitsSystemWindows(!mCoordinatorLayout.getFitsSystemWindows());
}
Current result: When rotating device to landscape, it shows cardboard instruction, when click on back button, video view displays in landscape but not full screen, have padding on top and bottom.
Expected result: similar to clicking on full screen button, video view displays in landscape with fullscreen, no padding.
↧