Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit 9492736

Browse files
authored
Request for thumbnail image when playing videos (#93)
1 parent 76d44b7 commit 9492736

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Source/ViewableController.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,16 @@ class ViewableController: UIViewController {
242242
}
243243
}
244244
case .video:
245+
let autoplayVideo = self.dataSource?.viewableControllerShouldAutoplayVideo(self) ?? false
246+
if !autoplayVideo {
247+
viewable.media { image, error in
248+
if let image = image {
249+
self.imageView.image = image
250+
}
251+
}
252+
}
253+
245254
self.videoView.prepare(using: viewable) {
246-
let autoplayVideo = self.dataSource?.viewableControllerShouldAutoplayVideo(self) ?? false
247255
if autoplayVideo {
248256
self.videoView.play()
249257
} else {

0 commit comments

Comments
 (0)