mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
code structure
This commit is contained in:
parent
27fcf05347
commit
b0ca6baafd
@ -177,6 +177,11 @@ class PlayerFragment : BaseFragment() {
|
|||||||
*/
|
*/
|
||||||
private lateinit var nowPlayingNotification: NowPlayingNotification
|
private lateinit var nowPlayingNotification: NowPlayingNotification
|
||||||
|
|
||||||
|
/**
|
||||||
|
* history of played videos in the current lifecycle
|
||||||
|
*/
|
||||||
|
val videoIds = mutableListOf<String>()
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
arguments?.let {
|
arguments?.let {
|
||||||
@ -752,6 +757,7 @@ class PlayerFragment : BaseFragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
videoIds += videoId!!
|
||||||
}
|
}
|
||||||
run()
|
run()
|
||||||
}
|
}
|
||||||
@ -1060,10 +1066,18 @@ class PlayerFragment : BaseFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// next and previous buttons
|
// next and previous buttons
|
||||||
playerBinding.next.visiblity = if (skipButtonsEnabled) View.VISIBLE else View.INVISIBLE
|
playerBinding.skipPrev.visibility = if (
|
||||||
playerBinding.next.visibility = if (skipButtonsEnabled) View.VISIBLE else View.INVISIBLE
|
skipButtonsEnabled && videoIds.indexOf(videoId!!) != 0
|
||||||
|
) View.VISIBLE else View.INVISIBLE
|
||||||
|
playerBinding.skipNext.visibility = if (skipButtonsEnabled) View.VISIBLE else View.INVISIBLE
|
||||||
|
|
||||||
playerBinding.next.setOnClickListener {
|
playerBinding.skipPrev.setOnClickListener {
|
||||||
|
val index = videoIds.indexOf(videoId!!) - 1
|
||||||
|
videoId = videoIds[index]
|
||||||
|
playVideo()
|
||||||
|
}
|
||||||
|
|
||||||
|
playerBinding.skipNext.setOnClickListener {
|
||||||
playNextVideo()
|
playNextVideo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user