This commit is contained in:
Koen J
2026-04-22 15:09:51 +02:00
parent 0f7fb9059b
commit 22b5adc4b8
@@ -905,6 +905,7 @@ class VideoDetailView : ConstraintLayout {
cleanupPlaybackTracker();
Logger.i(TAG, "Keep screen on unset onClose")
fragment.activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
clearChapters()
};
StatePlayer.instance.autoplayChanged.subscribe(this) {
@@ -999,6 +1000,12 @@ class VideoDetailView : ConstraintLayout {
_cast.stopAllGestures();
}
private fun clearChapters() {
_chapters = null
_player.setChapters(null)
_cast.setChapters(null)
}
fun showChaptersUI(){
video?.let {
try {
@@ -1330,6 +1337,7 @@ class VideoDetailView : ConstraintLayout {
_lastVideoSource = null;
_lastAudioSource = null;
_lastSubtitleSource = null;
clearChapters()
}
fun setVideo(url: String, resumeSeconds: Long = 0, playWhenReady: Boolean = true) {
Logger.i(TAG, "setVideo url=$url resumeSeconds=$resumeSeconds playWhenReady=$playWhenReady")
@@ -1340,6 +1348,7 @@ class VideoDetailView : ConstraintLayout {
_searchVideo = null;
video = null;
cleanupPlaybackTracker();
clearChapters()
_url = url;
_videoResumePositionMilliseconds = resumeSeconds * 1000;
_rating.visibility = View.GONE;
@@ -1550,6 +1559,7 @@ class VideoDetailView : ConstraintLayout {
}
val me = this;
clearChapters()
if (video is JSVideoDetails) {
fragment.lifecycleScope.launch(Dispatchers.IO) {
try {