Added restart icon and change miniplayer to it when video is finished.

This commit is contained in:
GilesMunn 2022-11-12 16:31:44 +00:00
parent b9451e001a
commit 88c72a45f7
2 changed files with 24 additions and 7 deletions

View File

@ -816,13 +816,20 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
if (binding.player.autoplayEnabled) playNextVideo()
}
if (playbackState == Player.STATE_READY) {
// media actually playing
transitioning = false
binding.playImageView.setImageResource(R.drawable.ic_pause)
} else {
// player paused in any state
binding.playImageView.setImageResource(R.drawable.ic_play)
when (playbackState) {
Player.STATE_READY -> {
// media actually playing
transitioning = false
binding.playImageView.setImageResource(R.drawable.ic_pause)
}
Player.STATE_ENDED -> {
// video has finished
binding.playImageView.setImageResource(R.drawable.ic_restart)
}
else -> {
// player in any other state
binding.playImageView.setImageResource(R.drawable.ic_play)
}
}
// save the watch position when paused

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M11.707,1.707 L7.414,6 11.707,10.293V7A0.292,0.292 0,0 1,12 6.707c3.468,0 6.293,2.825 6.293,6.293 0,3.468 -2.825,6.293 -6.293,6.293 -3.368,0 -6.107,-2.67 -6.264,-6H4.322C4.479,17.416 7.838,20.707 12,20.707 16.262,20.707 19.707,17.262 19.707,13 19.707,8.738 16.262,5.293 12,5.293A0.292,0.292 0,0 1,11.707 5Z" />
</vector>