瀏覽代碼

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 年之前
父節點
當前提交
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];