开机画面视频动画大小问题

我正在尝试显示带有公司徽标的动画视频,但对于尺寸应为多少感到困惑。当宽度完全适合时,高度会导致错误,而当高度完全适合时,宽度会导致错误。我正在将以下尺寸用于视频。

  

1280 * 1920

以下是XML代码

<androidx.constraintlayout.widget.ConstraintLayout
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:background="@color/white"
tools:context=".view.activites.Splashactivity"
>

   <VideoView
      android:id="@+id/splash_VideoView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintBottom_toBottomOf="parent"  />

</androidx.constraintlayout.widget.ConstraintLayout>

以下是用于显示视频的Kotlin代码。

 try {

        val path = "android.resource://" + packageName + "/" + R.raw.instored_splash_video
        splash_VideoView.setVideoURI(Uri.parse(path))
        splash_VideoView.start()

        splash_VideoView.setOnCompletionListener {

            jump()  //change the screen

        }

    }
    catch (e: Exception)
    {
        Log.d("SplashVideoExcept","$e")
        jump()  //change the screen
    }

我需要在各种设备上显示视频,这有可能吗?

jjydjy 回答:开机画面视频动画大小问题

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3044635.html

大家都在问