Przeglądaj źródła

VLCPlaybackController: only restore playbackposition when less than 95% were viewed

Otherwise a user might be unable to rewatch content because it would immediatly close the controller again
Carola Nitz 6 lat temu
rodzic
commit
c3f4d8e400
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      Sources/VLCPlaybackController.m

+ 2 - 1
Sources/VLCPlaybackController.m

@@ -1096,7 +1096,8 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
     if (!media) return;
 
     CGFloat lastPosition = media.progress;
-    if (_mediaPlayer.position < lastPosition) {
+    // .95 prevents the controller from opening and closing immediatly when restoring state
+    if (lastPosition < .95 && _mediaPlayer.position < lastPosition) {
         NSInteger continuePlayback;
         if (media.type == VLCMLMediaTypeAudio)
             continuePlayback = [[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingContinueAudioPlayback] integerValue];