Merge pull request #171 from SDWebImage/fix_rare_webimage_animating

Fix the rare cases that WebImage will lost animation when visibility changes.
This commit is contained in:
DreamPiggy 2021-02-25 21:39:54 +08:00 committed by GitHub
commit 0fe0ff5846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -82,12 +82,7 @@ public final class ImagePlayer : ObservableObject {
self.player = imagePlayer
// Setup poster frame
if let cgImage = animatedImage.cgImage {
currentFrame = PlatformImage(cgImage: cgImage, scale: animatedImage.scale, orientation: .up)
} else {
currentFrame = .empty
}
imagePlayer.startPlaying()
}
}
}