Skip to content

Instantly share code, notes, and snippets.

@realpacific
Last active May 17, 2019 05:41
Show Gist options
  • Save realpacific/4f7638f98df4a4c948b3c377e0ddb045 to your computer and use it in GitHub Desktop.
Save realpacific/4f7638f98df4a4c948b3c377e0ddb045 to your computer and use it in GitHub Desktop.
Layout for video player UI
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="url"
type="String"/>
<variable
name="callback"
type="com.realpacific.videodemo.PlayerStateCallback"/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/item_video_exoplayer"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:resize_mode="fill"
app:video_url="@{url}"
app:on_state_change="@{callback}"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment