Преглед изворни кода

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 година
родитељ
комит
d66bdcb48b
1 измењених фајлова са 4 додато и 2 уклоњено
  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;