I am trying to show youtube player in fullscreen in landscape mode but it is not working. I put
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION);
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE);
But exception is coming :
java.lang.IllegalArgumentException: Can not set FULLSCREEN_FLAG_FULLSCREEN_WHEN_DEVICE_LANDSCAPE without setting FULLSCREEN_FLAG_CONTROL_ORIENTATION
03-21 16:10:09.892: E/AndroidRuntime(15996): at com.google.android.youtube.player.internal.r$a.handleMessage(Unknown Source)
The flags parameter to setFullscreenControlFlags
is a bitmask, so you should do a bitwise OR of all the flags you want and set them with a single call to setFullscreenControlFlags
instead of using multiple calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With