mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-19 19:14:51 +00:00
prevent PiP for audio only playback
Changelog: changed
This commit is contained in:
parent
67e9d44295
commit
9b11f47072
2 changed files with 7 additions and 5 deletions
|
@ -446,7 +446,7 @@ class VideoDetailFragment() : MainFragment() {
|
|||
val viewDetail = _viewDetail;
|
||||
Logger.i(TAG, "onUserLeaveHint preventPictureInPicture=${viewDetail?.preventPictureInPicture} isCasting=${StateCasting.instance.isCasting} isBackgroundPictureInPicture=${Settings.instance.playback.isBackgroundPictureInPicture()} allowBackground=${viewDetail?.allowBackground}");
|
||||
|
||||
if(viewDetail?.preventPictureInPicture == false && !StateCasting.instance.isCasting && Settings.instance.playback.isBackgroundPictureInPicture() && !viewDetail.allowBackground) {
|
||||
if(viewDetail?.preventPictureInPicture == false && !StateCasting.instance.isCasting && Settings.instance.playback.isBackgroundPictureInPicture() && !viewDetail.allowBackground && !viewDetail.audioOnly) {
|
||||
_leavingPiP = false;
|
||||
|
||||
val params = _viewDetail?.getPictureInPictureParams();
|
||||
|
|
|
@ -194,6 +194,8 @@ class VideoDetailView : ConstraintLayout {
|
|||
|
||||
val currentUrl get() = video?.url ?: _searchVideo?.url ?: _url;
|
||||
|
||||
val audioOnly get() = _lastVideoSource == null;
|
||||
|
||||
private var _liveChat: LiveChatManager? = null;
|
||||
private var _videoResumePositionMilliseconds : Long = 0L;
|
||||
|
||||
|
@ -1084,13 +1086,13 @@ class VideoDetailView : ConstraintLayout {
|
|||
if(StateCasting.instance.isCasting)
|
||||
return;
|
||||
|
||||
if(allowBackground)
|
||||
StatePlayer.instance.startOrUpdateMediaSession(context, video);
|
||||
else {
|
||||
if (allowBackground) {
|
||||
StatePlayer.instance.startOrUpdateMediaSession(context, video)
|
||||
} else {
|
||||
when (Settings.instance.playback.backgroundPlay) {
|
||||
0 -> handlePause();
|
||||
1 -> {
|
||||
if (video?.isLive != true && Settings.instance.playback.backgroundSwitchToAudio && _lastVideoSource !== null) {
|
||||
if (video?.isLive != true && Settings.instance.playback.backgroundSwitchToAudio && audioOnly) {
|
||||
_player.switchToAudioMode()
|
||||
}
|
||||
StatePlayer.instance.startOrUpdateMediaSession(context, video);
|
||||
|
|
Loading…
Add table
Reference in a new issue