Procházet zdrojové kódy

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 před 5 roky
rodič
revize
d66bdcb48b
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  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;