Fix the rare cases that WebImage will lost animation when visibility changes. Always setup player to play as defaults to avoid this.

This commit is contained in:
DreamPiggy 2021-02-25 21:38:52 +08:00
parent d0afa1ce35
commit 69413ec0ee
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()
}
}
}