mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-02 22:30:40 +00:00
Fixed resume not always working.
This commit is contained in:
parent
7cfa6c163f
commit
73b048d4c5
2 changed files with 3 additions and 3 deletions
|
@ -1698,7 +1698,7 @@ class VideoDetailView : ConstraintLayout {
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
_player.setArtwork(null);
|
_player.setArtwork(null);
|
||||||
_player.setSource(videoSource, audioSource, _playWhenReady, false);
|
_player.setSource(videoSource, audioSource, _playWhenReady, false, resume = resumePositionMs > 0);
|
||||||
if(subtitleSource != null)
|
if(subtitleSource != null)
|
||||||
_player.swapSubtitles(fragment.lifecycleScope, subtitleSource);
|
_player.swapSubtitles(fragment.lifecycleScope, subtitleSource);
|
||||||
_player.seekTo(resumePositionMs);
|
_player.seekTo(resumePositionMs);
|
||||||
|
|
|
@ -327,8 +327,8 @@ abstract class FutoVideoPlayerBase : RelativeLayout {
|
||||||
return _chapters?.let { chaps -> chaps.find { pos.toDouble() / 1000 > it.timeStart && pos.toDouble() / 1000 < it.timeEnd && (toIgnore.isEmpty() || !toIgnore.contains(it)) } };
|
return _chapters?.let { chaps -> chaps.find { pos.toDouble() / 1000 > it.timeStart && pos.toDouble() / 1000 < it.timeEnd && (toIgnore.isEmpty() || !toIgnore.contains(it)) } };
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSource(videoSource: IVideoSource?, audioSource: IAudioSource? = null, play: Boolean = false, keepSubtitles: Boolean = false) {
|
fun setSource(videoSource: IVideoSource?, audioSource: IAudioSource? = null, play: Boolean = false, keepSubtitles: Boolean = false, resume: Boolean = false) {
|
||||||
swapSources(videoSource, audioSource,false, play, keepSubtitles);
|
swapSources(videoSource, audioSource,resume, play, keepSubtitles);
|
||||||
}
|
}
|
||||||
fun swapSources(videoSource: IVideoSource?, audioSource: IAudioSource?, resume: Boolean = true, play: Boolean = true, keepSubtitles: Boolean = false): Boolean {
|
fun swapSources(videoSource: IVideoSource?, audioSource: IAudioSource?, resume: Boolean = true, play: Boolean = true, keepSubtitles: Boolean = false): Boolean {
|
||||||
var videoSourceUsed = videoSource;
|
var videoSourceUsed = videoSource;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue