Просмотр исходного кода

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 лет назад
Родитель
Сommit
c3f4d8e400
1 измененных файлов с 2 добавлено и 1 удалено
  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];