Pārlūkot izejas kodu

VLCPlaybackService: Disable video track only when playing in background

When paused, there is no need to disable video tracks when entering
background.

If the video track is disabled while paused, it will lead to a
unnecessary black screen for the user.

Closes #730
Soomin Lee 5 gadi atpakaļ
vecāks
revīzija
d66bdcb48b
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4 2
      Sources/VLCPlaybackService.m

+ 4 - 2
Sources/VLCPlaybackService.m

@@ -1230,7 +1230,7 @@ NSString *const VLCPlaybackServicePlaybackPositionUpdated = @"VLCPlaybackService
 {
     _preBackgroundWrapperView = _videoOutputViewWrapper;
 
-    if (!_renderer && _mediaPlayer.audioTrackIndexes.count > 0)
+    if (!_renderer && _mediaPlayer.audioTrackIndexes.count > 0 && [_mediaPlayer isPlaying])
         [self setVideoTrackEnabled:false];
 
     if (_renderer) {
@@ -1249,7 +1249,9 @@ NSString *const VLCPlaybackServicePlaybackPositionUpdated = @"VLCPlaybackService
         [_backgroundDummyPlayer stop];
     }
 
-    [self setVideoTrackEnabled:true];
+    if (_mediaPlayer.currentVideoTrackIndex == -1) {
+        [self setVideoTrackEnabled:true];
+    }
 
     if (_shouldResumePlaying) {
         _shouldResumePlaying = NO;