From aaec8161167a37e1b85df7256ea721175957f885 Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 20 Jun 2025 11:02:06 -0500 Subject: [PATCH] background playback fix Changelog: changed --- .../fragment/mainactivity/main/VideoDetailView.kt | 6 ++++++ .../futo/platformplayer/views/video/FutoVideoPlayerBase.kt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt index e9be9fd6..fc3dfbb7 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt @@ -933,6 +933,12 @@ class VideoDetailView : ConstraintLayout { return@let it.config.reduceFunctionsInLimitedVersion && BuildConfig.IS_PLAYSTORE_BUILD else false; } ?: false; + + // stop playing in the background if limited version + if (isLimitedVersion && allowBackground) { + _player.switchToVideoMode() + allowBackground = false + } val buttons = listOf(RoundButton(context, R.drawable.ic_add, context.getString(R.string.add), TAG_ADD) { (video ?: _searchVideo)?.let { _slideUpOverlay = UISlideOverlays.showAddToOverlay(it, _overlayContainer) { diff --git a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt index 43ed541d..45993240 100644 --- a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt +++ b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayerBase.kt @@ -795,7 +795,7 @@ abstract class FutoVideoPlayerBase : RelativeLayout { @OptIn(UnstableApi::class) private fun loadSelectedSources(play: Boolean, resume: Boolean): Boolean { - val sourceVideo = if(!isAudioMode || _lastAudioMediaSource == null) _lastVideoMediaSource else null; + val sourceVideo = _lastVideoMediaSource val sourceAudio = _lastAudioMediaSource; val sourceSubs = _lastSubtitleMediaSource;