CustomPip: fix next loosing video

When running in custom pip, video playback is not in the
videoPlayerActivity. When starting next media, it checks if there is a
video playing, and if (appIsStarted()) which returns false when customPip
is running and the VideoPlayerActivity has been killed.

Because of this, when playing the following media in a playqueue with
custom pip, there no vout. To fix this, this adds a check to
service.isInPiPMode before removing video.
This commit is contained in:
Duncan McNamara 2024-11-20 18:07:02 +01:00
parent 83e1f64376
commit f93d4e1e19

View File

@ -494,7 +494,8 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
}
val mw = mediaList.getMedia(index) ?: return
if (mw.type == MediaWrapper.TYPE_VIDEO && !isAppStarted()) videoBackground = true
val isInCustomPiP: Boolean = service.isInPiPMode.value ?: false
if (mw.type == MediaWrapper.TYPE_VIDEO && !isAppStarted() && !isInCustomPiP) videoBackground = true
val isVideoPlaying = mw.type == MediaWrapper.TYPE_VIDEO && player.isVideoPlaying()
setRepeatTypeFromSettings()
if (!videoBackground && isVideoPlaying) mw.addFlags(MediaWrapper.MEDIA_VIDEO)