mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +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 {
|
val builder: AlertDialog.Builder? = activity?.let {
|
||||||
AlertDialog.Builder(it)
|
AlertDialog.Builder(it)
|
||||||
}
|
}
|
||||||
|
var lastPosition = exoPlayer.currentPosition
|
||||||
builder!!.setTitle(R.string.choose_quality_dialog)
|
builder!!.setTitle(R.string.choose_quality_dialog)
|
||||||
.setItems(
|
.setItems(
|
||||||
videosNameArray,
|
videosNameArray,
|
||||||
@ -455,6 +456,8 @@ class PlayerFragment : Fragment() {
|
|||||||
.setSubtitleConfigurations(subtitle)
|
.setSubtitleConfigurations(subtitle)
|
||||||
.build()
|
.build()
|
||||||
exoPlayer.setMediaItem(mediaItem)
|
exoPlayer.setMediaItem(mediaItem)
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
val dataSourceFactory: DataSource.Factory =
|
val dataSourceFactory: DataSource.Factory =
|
||||||
DefaultHttpDataSource.Factory()
|
DefaultHttpDataSource.Factory()
|
||||||
@ -483,6 +486,7 @@ class PlayerFragment : Fragment() {
|
|||||||
MergingMediaSource(videoSource, audioSource)
|
MergingMediaSource(videoSource, audioSource)
|
||||||
exoPlayer.setMediaSource(mergeSource)
|
exoPlayer.setMediaSource(mergeSource)
|
||||||
}
|
}
|
||||||
|
exoPlayer.seekTo(lastPosition);
|
||||||
view.findViewById<TextView>(R.id.quality_text).text =
|
view.findViewById<TextView>(R.id.quality_text).text =
|
||||||
videosNameArray[which]
|
videosNameArray[which]
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,4 @@ import android.app.Application
|
|||||||
|
|
||||||
class myApp : Application() {
|
class myApp : Application() {
|
||||||
|
|
||||||
companion object {
|
|
||||||
@JvmField
|
|
||||||
var seekTo : Long? = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user