mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fixed online subs resetting progress
This commit is contained in:
parent
86aed5b830
commit
5724c894ca
2 changed files with 11 additions and 8 deletions
|
@ -206,12 +206,15 @@ class CS3IPlayer : IPlayer {
|
|||
)
|
||||
} else {
|
||||
when (subtitleHelper.subtitleStatus(subtitle)) {
|
||||
SubtitleStatus.REQUIRES_RELOAD -> {
|
||||
Log.i(TAG, "setPreferredSubtitles REQUIRES_RELOAD")
|
||||
return@let true
|
||||
// reloadPlayer(context)
|
||||
}
|
||||
SubtitleStatus.IS_ACTIVE -> {
|
||||
|
||||
// Uncommenting this will lead to online subtitles resetting player to 00:00 on reload
|
||||
|
||||
// SubtitleStatus.REQUIRES_RELOAD -> {
|
||||
// Log.i(TAG, "setPreferredSubtitles REQUIRES_RELOAD")
|
||||
// return@let true
|
||||
// // reloadPlayer(context)
|
||||
// }
|
||||
SubtitleStatus.IS_ACTIVE, SubtitleStatus.REQUIRES_RELOAD -> {
|
||||
Log.i(TAG, "setPreferredSubtitles IS_ACTIVE")
|
||||
|
||||
trackSelector.setParameters(
|
||||
|
@ -519,6 +522,7 @@ class CS3IPlayer : IPlayer {
|
|||
mediaItem
|
||||
)
|
||||
|
||||
println("PLAYBACK POS $playbackPosition")
|
||||
return exoPlayerBuilder.build().apply {
|
||||
setPlayWhenReady(playWhenReady)
|
||||
seekTo(currentWindow, playbackPosition)
|
||||
|
|
|
@ -375,8 +375,7 @@ class GeneratorPlayer : FullScreenPlayer() {
|
|||
setSubtitles(subtitleData)
|
||||
|
||||
// this is used instead of observe, because observe is too slow
|
||||
val subs = currentSubs.toMutableSet()
|
||||
subs.add(subtitleData)
|
||||
val subs = currentSubs + subtitleData
|
||||
player.setActiveSubtitles(subs)
|
||||
player.reloadPlayer(ctx)
|
||||
|
||||
|
|
Loading…
Reference in a new issue