-
Notifications
You must be signed in to change notification settings - Fork 171
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
Orientation #510
Comments
What if we consider using the following code snippet? Auto Rotate @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
// Portrait orientation
// Add your code here to handle portrait mode
} else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
// Landscape orientation
// Add your code here to handle landscape mode
}
} Rotate Based on click // Assuming you have a button with the ID "toggleOrientationButton"
Button toggleOrientationButton = findViewById(R.id.toggleOrientationButton);
toggleOrientationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int currentOrientation = getResources().getConfiguration().orientation;
if (currentOrientation == Configuration.ORIENTATION_PORTRAIT) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}
}); |
Yes we can try |
@HHQuraishi Thank you for your guidance. |
The videos play either in device orientation or in the best suited orientation for the current video. I can play landscape videos in landscape as well as portrait videos in landscape with device orientation and auto rotation turned on. If you still have issues, please post more detailed steps to reproduce such issue. |
|
I am a student and still learning |
The videos play only in portrait mode.
Even if the auto rotate is turned on the orientation does not change.
The text was updated successfully, but these errors were encountered: