Youtube Api Full Screen Portrait Mode Videos Android
Solution 1:
You can see in this SO answer the solution on how to retain the full-screen mode even if the phone is in portrait mode.
On an orientation change, the onCreate method is called. You could try adding this line within the Activity in question in your Manifest file to prevent the onCreate call.
android:configChanges="orientation|keyboardHidden|screenSize|layoutDirection"
and it might maintain the fullscreen status of youtube for you.
You can also try overriding the onConfigurationChanged
method:
@Override//reconfigure display properties on screen rotationpublicvoidonConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
//Checks the orientation of the screenif (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT)
{
// handle change here
}
elseif (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)
{
// or here
}
}
You can also read this documentation:
Flag for
setFullscreenControlFlags(int)
to enable automatic control of the orientation.The behavior is to force landscape orientation when entering fullscreen and switching back to the original orientation setting when leaving fullscreen. The implementation will also exit fullscreen automatically when the device is rotated back to portrait orientation. This should generally be set unless the application is locked in landscape orientation or you require fullscreen in portrait orientation.
Hope this helps!
Post a Comment for "Youtube Api Full Screen Portrait Mode Videos Android"