media3/exoplayer 不是全屏

问题描述 投票:0回答:0

我正在尝试使用 media3/exoplayer 创建全屏播放器,但播放器和屏幕之间存在间隙;见下图:

这是我的activity,很简单,三年前还可以,现在重写项目遇到这个问题

<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:keepScreenOn="true"
    tools:context=".view.MainActivity">

    <androidx.media3.ui.PlayerView
        android:id="@+id/player_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:use_controller="false" />

</RelativeLayout>

我有这个风格的申请

styles.xml

<?xml version="1.0" encoding="utf-8"?>

<resources>
    <style name="Theme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
        <item name="android:windowBackground">@drawable/background_splash</item>
    </style>
</resources>

我做错了什么?视频是1080p

android exoplayer
© www.soinside.com 2019 - 2024. All rights reserved.