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(); cleanupPlaybackTracker();
Logger.i(TAG, "Keep screen on unset onClose") Logger.i(TAG, "Keep screen on unset onClose")
fragment.activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); fragment.activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
clearChapters()
}; };
StatePlayer.instance.autoplayChanged.subscribe(this) { StatePlayer.instance.autoplayChanged.subscribe(this) {
@@ -999,6 +1000,12 @@ class VideoDetailView : ConstraintLayout {
_cast.stopAllGestures(); _cast.stopAllGestures();
} }
private fun clearChapters() {
_chapters = null
_player.setChapters(null)
_cast.setChapters(null)
}
fun showChaptersUI(){ fun showChaptersUI(){
video?.let { video?.let {
try { try {
@@ -1330,6 +1337,7 @@ class VideoDetailView : ConstraintLayout {
_lastVideoSource = null; _lastVideoSource = null;
_lastAudioSource = null; _lastAudioSource = null;
_lastSubtitleSource = null; _lastSubtitleSource = null;
clearChapters()
} }
fun setVideo(url: String, resumeSeconds: Long = 0, playWhenReady: Boolean = true) { fun setVideo(url: String, resumeSeconds: Long = 0, playWhenReady: Boolean = true) {
Logger.i(TAG, "setVideo url=$url resumeSeconds=$resumeSeconds playWhenReady=$playWhenReady") Logger.i(TAG, "setVideo url=$url resumeSeconds=$resumeSeconds playWhenReady=$playWhenReady")
@@ -1340,6 +1348,7 @@ class VideoDetailView : ConstraintLayout {
_searchVideo = null; _searchVideo = null;
video = null; video = null;
cleanupPlaybackTracker(); cleanupPlaybackTracker();
clearChapters()
_url = url; _url = url;
_videoResumePositionMilliseconds = resumeSeconds * 1000; _videoResumePositionMilliseconds = resumeSeconds * 1000;
_rating.visibility = View.GONE; _rating.visibility = View.GONE;
@@ -1550,6 +1559,7 @@ class VideoDetailView : ConstraintLayout {
} }
val me = this; val me = this;
clearChapters()
if (video is JSVideoDetails) { if (video is JSVideoDetails) {
fragment.lifecycleScope.launch(Dispatchers.IO) { fragment.lifecycleScope.launch(Dispatchers.IO) {
try { try {