My video is not displayed in full screen on my Android device. There is always some empty space at the top and at the bottom. Is it possible to display it in full screen?
![image0-2](https://learn-attachment.microsoft.com/api/attachments/30edb3d3-2a8c-44c1-bf98-2010d1f9e23a?platform=QnA)
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<mediamanager.platforms.android.video.VideoView
android:id="@+id/exoplayerview_activity_video"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:layout_centerInParent="true" />
</RelativeLayout>
styles.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="android:colorPrimary">#2196F3</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="android:colorPrimaryDark">#1976D2</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="android:colorAccent">#FF4081</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal. -->
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowActionModeOverlay">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
</resources>
VideoDialog.cs:
public class VideoDialog : Dialog
{
public VideoDialog(Context context, int themeResId) : base(context, themeResId)
{
}
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
Window.RequestFeature(WindowFeatures.NoTitle);
WindowCompat.SetDecorFitsSystemWindows(Window, false);
WindowInsetsControllerCompat windowInsetsController = new WindowInsetsControllerCompat(Window, Window.DecorView);
windowInsetsController.Hide(WindowInsetsCompat.Type.NavigationBars());
windowInsetsController.SystemBarsBehavior = WindowInsetsControllerCompat.BehaviorShowTransientBarsBySwipe;
View view = LayoutInflater.From(Context).Inflate(Resource.Layout.activity_main, null);
SetContentView(view);
Window.SetBackgroundDrawable(new ColorDrawable());
Window.SetLayout(WindowManagerLayoutParams.MatchParent, WindowManagerLayoutParams.MatchParent);
}
}
Game1.cs:
public async void ShowTheVideo()
{
VideoDialog customDialog = new VideoDialog(activity1, Android.Resource.Style.ThemeDeviceDefaultDialogNoActionBar);
customDialog.SetCancelable(false);
customDialog.Show();
await CrossMediaManager.Android.PlayFromResource(TestPluginMedia.Resource.Raw.Testvideo1.ToString());
CrossMediaManager.Current.MediaItemFinished += (s, e) =>
{
customDialog.Cancel();
};
}