mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Seek back to last position
This commit is contained in:
parent
079fc949f1
commit
84b3786f17
@ -434,6 +434,7 @@ class PlayerFragment : Fragment() {
|
||||
val builder: AlertDialog.Builder? = activity?.let {
|
||||
AlertDialog.Builder(it)
|
||||
}
|
||||
var lastPosition = exoPlayer.currentPosition
|
||||
builder!!.setTitle(R.string.choose_quality_dialog)
|
||||
.setItems(
|
||||
videosNameArray,
|
||||
@ -455,6 +456,8 @@ class PlayerFragment : Fragment() {
|
||||
.setSubtitleConfigurations(subtitle)
|
||||
.build()
|
||||
exoPlayer.setMediaItem(mediaItem)
|
||||
|
||||
|
||||
} else {
|
||||
val dataSourceFactory: DataSource.Factory =
|
||||
DefaultHttpDataSource.Factory()
|
||||
@ -483,6 +486,7 @@ class PlayerFragment : Fragment() {
|
||||
MergingMediaSource(videoSource, audioSource)
|
||||
exoPlayer.setMediaSource(mergeSource)
|
||||
}
|
||||
exoPlayer.seekTo(lastPosition);
|
||||
view.findViewById<TextView>(R.id.quality_text).text =
|
||||
videosNameArray[which]
|
||||
}
|
||||
|
@ -4,8 +4,4 @@ import android.app.Application
|
||||
|
||||
class myApp : Application() {
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
var seekTo : Long? = 0
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user