ソースを参照

MediaLibraryService: Generate new thumbnail at last playback position

Closes #390
Soomin Lee 5 年 前
コミット
527d348475
1 ファイル変更5 行追加1 行削除
  1. 5 1
      SharedSources/MediaLibraryService.swift

+ 5 - 1
SharedSources/MediaLibraryService.swift

@@ -401,7 +401,11 @@ extension MediaLibraryService {
         mlMedia.subtitleTrackIndex = Int64(player.indexOfCurrentSubtitleTrack)
         mlMedia.chapterIndex = Int64(player.indexOfCurrentChapter)
         mlMedia.titleIndex = Int64(player.indexOfCurrentTitle)
-        //create a new thumbnail
+
+        if mlMedia.type() == .video {
+            mlMedia.requestThumbnail(of: .thumbnail, desiredWidth: 320,
+                                     desiredHeight: 200, atPosition: player.playbackPosition)
+        }
     }
 }