mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
Added restart icon and change miniplayer to it when video is finished.
This commit is contained in:
parent
b9451e001a
commit
88c72a45f7
@ -816,13 +816,20 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
if (binding.player.autoplayEnabled) playNextVideo()
|
if (binding.player.autoplayEnabled) playNextVideo()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playbackState == Player.STATE_READY) {
|
when (playbackState) {
|
||||||
// media actually playing
|
Player.STATE_READY -> {
|
||||||
transitioning = false
|
// media actually playing
|
||||||
binding.playImageView.setImageResource(R.drawable.ic_pause)
|
transitioning = false
|
||||||
} else {
|
binding.playImageView.setImageResource(R.drawable.ic_pause)
|
||||||
// player paused in any state
|
}
|
||||||
binding.playImageView.setImageResource(R.drawable.ic_play)
|
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
|
// save the watch position when paused
|
||||||
|
10
app/src/main/res/drawable/ic_restart.xml
Normal file
10
app/src/main/res/drawable/ic_restart.xml
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user