Skip to content

Instantly share code, notes, and snippets.

@fatihkurcenli
Last active February 11, 2022 13:49
Show Gist options
  • Save fatihkurcenli/cf8040bfd502fecaffadd908d5e8dfd4 to your computer and use it in GitHub Desktop.
Save fatihkurcenli/cf8040bfd502fecaffadd908d5e8dfd4 to your computer and use it in GitHub Desktop.
MainActivity.xml
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="250dp"
android:focusable="true"
android:keepScreenOn="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
app:controller_layout_id="@layout/exo_player_control_view"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintTop_toTopOf="@+id/frameLayout"
app:resize_mode="fill">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" />
</com.google.android.exoplayer2.ui.PlayerView>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment