Sfoglia il codice sorgente

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 anni fa
parent
commit
d66bdcb48b
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  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;