mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
fix(Player): save watch position when playback ends
This fixes an issue, where the watch position would not correctly be saved as the fully watched video. This could occur when the last part of a video was skipped by a sponsorblock segment.
This commit is contained in:
parent
b4d7a9b8a5
commit
2a2ad88655
@ -94,8 +94,13 @@ abstract class AbstractPlayerService : MediaLibraryService(), MediaLibrarySessio
|
||||
override fun onPlaybackStateChanged(playbackState: Int) {
|
||||
super.onPlaybackStateChanged(playbackState)
|
||||
|
||||
if (playbackState == Player.STATE_READY) {
|
||||
isTransitioning = false
|
||||
when (playbackState) {
|
||||
Player.STATE_ENDED -> {
|
||||
exoPlayer?.let { PlayerHelper.saveWatchPosition(it, videoId) }
|
||||
}
|
||||
Player.STATE_READY -> {
|
||||
isTransitioning = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user